mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
21 lines
592 B
JavaScript
21 lines
592 B
JavaScript
var findParsableFile = require('./findParsableFile');
|
|
|
|
/**
|
|
Lookup a structure file (ex: SUMMARY.md, GLOSSARY.md) in a book. Uses
|
|
book's config to find it.
|
|
|
|
@param {Book} book
|
|
@param {String} type: one of ["glossary", "readme", "summary", "langs"]
|
|
@return {Promise<File>} The path of the file found, relative
|
|
to the book content root.
|
|
*/
|
|
function lookupStructureFile(book, type) {
|
|
var config = book.getConfig();
|
|
|
|
var fileToSearch = config.getValue(['structure', type]);
|
|
|
|
return findParsableFile(book, fileToSearch);
|
|
}
|
|
|
|
module.exports = lookupStructureFile;
|