diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/encodeNavigation.js | 14 | ||||
-rw-r--r-- | lib/api/encodePage.js | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/api/encodeNavigation.js b/lib/api/encodeNavigation.js new file mode 100644 index 0000000..fa9eb16 --- /dev/null +++ b/lib/api/encodeNavigation.js @@ -0,0 +1,14 @@ + + +/** + page.navigation is a deprecated property from GitBook v2 + + @param {Output} + @return {Object} +*/ +function encodeNavigation(output) { + // todo + return {}; +} + +module.exports = encodeNavigation; diff --git a/lib/api/encodePage.js b/lib/api/encodePage.js index 1f3a01b..b212c29 100644 --- a/lib/api/encodePage.js +++ b/lib/api/encodePage.js @@ -1,5 +1,6 @@ var JSONUtils = require('../json'); var deprecate = require('./deprecate'); +var encodeNavigation = require('./encodeNavigation'); /** Encode a page in a context to a JS API @@ -21,6 +22,14 @@ function encodePage(output, page) { result.path = file.getPath(); result.rawPath = fs.resolve(result.path); + // todo: (as deprecated) + // page.progress + // page.navigation + + // Deprecated properties + deprecate.field(output, 'page.navigation', result, 'sections', encodeNavigation(output), + '"navigation" property is deprecated'); + deprecate.field(output, 'page.sections', result, 'sections', [ { content: result.content, |