Instalation
Include jade-interactive
in your express application:
npm install jade-interactive --save
And in your main file (usually app.js
):
var interactive = app// these lines configure jade-interactive in an express appappif not_in_production interacive// --
Then in your main jade
template (layout.jade
for example)
script !{interactiveScript}
Not using express?
Take a look to the index.js
file and you will see that the module provides some functionality to integrate jade-interactive
in any framework.
- You need to create a
/open
endpoint that receives afile
and aline
query parameter. Then callinteractive.openFile(file, line)
- Include
interactive.interactiveScript
when rendering ajade
template. - Set
debugLines
totrue
in the options passed to the render function.
Usage
- In a desktop browser use cmd/ctrl+shift+m to enable / disable the debug mode and then click on any DOM node to open the text editor
- In a touch device long press anywhere and the node will be highlighted. Tap on it again to open the text editor
Help us :)
As you can see jade-interactive
requires jade-debug
which is a fork of jade. If you like jade-interactive
please upvote this pull request https://github.com/jadejs/jade/pull/1879 and we no longer will need to use the fork :)