├── .gitignore ├── README.md ├── _layouts └── website │ └── page.html └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gitbook-plugin-addcssjs 2 |

3 | Downloads 4 |

5 | Plugin for gitbook for adding external css and js files to the git book. 6 | 7 | ## How to use 8 | - Add addcssjs plugin to your book.json: 9 | 10 | 11 | "plugins": [ 12 | "addcssjs" 13 | ] 14 | - Add plugin configuration specifying css and js files to include: 15 | 16 | 17 | "pluginsConfig": { 18 | "addcssjs": { 19 | "js": ["js/custom.js"], 20 | "css": ["css/custom.css"] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /_layouts/website/page.html: -------------------------------------------------------------------------------- 1 | {% extends template.self %} 2 | 3 | {% block style %} 4 | {{ super() }} 5 | {% for cssFile in config.pluginsConfig.addcssjs.css %} 6 | 7 | {% endfor %} 8 | {% endblock %} 9 | 10 | {% block javascript %} 11 | {{ super() }} 12 | {% for jsFile in config.pluginsConfig.addcssjs.js %} 13 | 14 | {% endfor %} 15 | {% endblock %} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gitbook-plugin-addcssjs", 3 | "version": "1.0.2", 4 | "description": "Adds external CSS and JS files to the gitbook", 5 | "keywords": ["CSS", "JS", "gitbook"], 6 | "author": { 7 | "name": "Olga Filipova", 8 | "email": "chudaol@gmail.com" 9 | }, 10 | "repository": { 11 | "type" : "git", 12 | "url" : "https://github.com/chudaol/gitbook-plugin-addcssjs" 13 | }, 14 | "engines": { 15 | "gitbook": ">=3.0.0-pre.0" 16 | }, 17 | "license": "MIT", 18 | "gitbook": { 19 | "properties": { 20 | "js": { 21 | "type": "array", 22 | "description": "List of JavaScript files to include", 23 | "default": [] 24 | }, 25 | "css": { 26 | "type": "array", 27 | "description": "List of CSS files to include", 28 | "default": [] 29 | } 30 | } 31 | } 32 | } 33 | --------------------------------------------------------------------------------