123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- module.exports = {
- // Extend website resources and html
- website: {
- assets: "./book",
- js: [
- "test.js"
- ],
- css: [
- "test.css"
- ],
- html: {
- "html:start": function() {
- return "<!-- Start book "+this.options.title+" -->"
- },
- "html:end": function() {
- return "<!-- End of book "+this.options.title+" -->"
- },
- "head:start": "<!-- head:start -->",
- "head:end": "<!-- head:end -->",
- "body:start": "<!-- body:start -->",
- "body:end": "<!-- body:end -->"
- }
- },
- // Extend ebook resources and html
- website: {
- assets: "./book",
- js: [
- "test.js"
- ],
- css: [
- "test.css"
- ],
- html: {
- "html:start": function() {
- return "<!-- Start book "+this.options.title+" -->"
- },
- "html:end": function() {
- return "<!-- End of book "+this.options.title+" -->"
- },
- "head:start": "<!-- head:start -->",
- "head:end": "<!-- head:end -->",
- "body:start": "<!-- body:start -->",
- "body:end": "<!-- body:end -->"
- }
- },
- // Extend templating blocks
- blocks: {
- // Author will be able to write "{% myTag %}World{% endMyTag %}"
- myTag: {
- process: function(blk) {
- return "Hello "+blk.body;
- }
- }
- },
- // Extend templating filters
- filters: {
- // Author will be able to write "{{ 'test'|myFilter }}"
- myFilter: function(s) {
- return "Hello "+s;
- }
- },
- // Hook process during build
- hooks: {
- // For all the hooks, this represent the current generator
- // This is called before the book is generated
- "init": function() {
- console.log("init!");
- },
- // This is called after the book generation
- "finish": function() {
- console.log("finish!");
- }
- }
- };
|