diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-12-22 10:18:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 10:18:38 +0100 |
commit | 194ebc3da9641ff96f083f9d8ab43c2d27944f9a (patch) | |
tree | c50988f32ccf18df93ae7ab40be78e9459642818 /lib/api/encodePage.js | |
parent | 64ccb6b00b4b63fa0e516d4e35351275b34f8c07 (diff) | |
parent | 16af264360e48e8a833e9efa9ab8d194574dbc70 (diff) | |
download | gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.zip gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.tar.gz gitbook-194ebc3da9641ff96f083f9d8ab43c2d27944f9a.tar.bz2 |
Merge pull request #1543 from GitbookIO/dream
React for rendering website with plugins
Diffstat (limited to 'lib/api/encodePage.js')
-rw-r--r-- | lib/api/encodePage.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/api/encodePage.js b/lib/api/encodePage.js deleted file mode 100644 index 379d3d5..0000000 --- a/lib/api/encodePage.js +++ /dev/null @@ -1,39 +0,0 @@ -var JSONUtils = require('../json'); -var deprecate = require('./deprecate'); -var encodeProgress = require('./encodeProgress'); - -/** - Encode a page in a context to a JS API - - @param {Output} output - @param {Page} page - @return {Object} -*/ -function encodePage(output, page) { - var book = output.getBook(); - var summary = book.getSummary(); - var fs = book.getContentFS(); - var file = page.getFile(); - - // JS Page is based on the JSON output - var result = JSONUtils.encodePage(page, summary); - - result.type = file.getType(); - result.path = file.getPath(); - result.rawPath = fs.resolve(result.path); - - deprecate.field(output, 'page.progress', result, 'progress', function() { - return encodeProgress(output, page); - }, '"page.progress" property is deprecated'); - - deprecate.field(output, 'page.sections', result, 'sections', [ - { - content: result.content, - type: 'normal' - } - ], '"sections" property is deprecated, use page.content instead'); - - return result; -} - -module.exports = encodePage; |