summaryrefslogtreecommitdiffstats
path: root/lib/parse/page.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parse/page.js')
-rw-r--r--lib/parse/page.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js
index 7c188eb..6481e65 100644
--- a/lib/parse/page.js
+++ b/lib/parse/page.js
@@ -56,6 +56,9 @@ function parsePage(src) {
return section;
})
.map(function(section) {
+ // Generate a uniqueId to identify this section in our code
+ var id = _.uniqueId('gitbook_');
+
// Transform given type
if(section.type === 'exercise') {
var nonCodeNodes = _.reject(section, {
@@ -67,6 +70,7 @@ function parsePage(src) {
});
return {
+ id: id,
type: section.type,
content: render(nonCodeNodes),
code: {
@@ -79,6 +83,7 @@ function parsePage(src) {
// Render normal pages
return {
+ id: id,
type: section.type,
content: render(section)
};