mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 18:13:29 +00:00
Expose lookup method for parsable files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var findParsableFile = require('./findParsableFile');
|
||||
var Promise = require('../utils/promise');
|
||||
var error = require('../utils/error');
|
||||
var lookupStructureFile = require('./lookupStructureFile');
|
||||
|
||||
/**
|
||||
Parse a ParsableFile using a specific method
|
||||
@@ -55,11 +55,8 @@ function parseFile(fs, file, type) {
|
||||
*/
|
||||
function parseStructureFile(book, type) {
|
||||
var fs = book.getContentFS();
|
||||
var config = book.getConfig();
|
||||
|
||||
var fileToSearch = config.getValue(['structure', type]);
|
||||
|
||||
return findParsableFile(book, fileToSearch)
|
||||
return lookupStructureFile(book, type)
|
||||
.then(function(file) {
|
||||
if (!file) return [undefined, undefined];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user