honkit
Version:
HonKit is building beautiful books using Markdown.
22 lines (20 loc) • 840 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const findParsableFile_1 = __importDefault(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 | Undefined>} The path of the file found, relative
to the book content root.
*/
function lookupStructureFile(book, type) {
const config = book.getConfig();
const fileToSearch = config.getValue(["structure", type]);
return (0, findParsableFile_1.default)(book, fileToSearch);
}
exports.default = lookupStructureFile;