diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-28 15:45:25 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-28 15:45:25 +0200 |
commit | 7ae36f16c84238340dd6b39a75423f5e95f27bbc (patch) | |
tree | b23c01e5b854c066a94a889d804aabc5b087ff6d /lib/api | |
parent | 281f6d55354ee097d3a5f59f02c09ac469e47908 (diff) | |
download | gitbook-7ae36f16c84238340dd6b39a75423f5e95f27bbc.zip gitbook-7ae36f16c84238340dd6b39a75423f5e95f27bbc.tar.gz gitbook-7ae36f16c84238340dd6b39a75423f5e95f27bbc.tar.bz2 |
Add base for deprecated page.naviation
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, |