mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-18 00:25:07 +00:00
Add tests for page hook
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
hooks: {
|
||||
page: function(page) {
|
||||
page.sections[0].content = 'Hello (sections) ' + page.content;
|
||||
return page;
|
||||
}
|
||||
}
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "gitbook-plugin-test-deprecated",
|
||||
"version": "1.0.0",
|
||||
"engines": {
|
||||
"gitbook": "*"
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -1,5 +1,3 @@
|
||||
var should = require('should');
|
||||
|
||||
module.exports = {
|
||||
hooks: {
|
||||
'init': function() {
|
||||
@@ -11,6 +9,10 @@ module.exports = {
|
||||
},
|
||||
'finish:before': function() {
|
||||
global._hooks.push('finish:before');
|
||||
},
|
||||
page: function(page) {
|
||||
page.content = 'Hello ' + page.content;
|
||||
return page;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user