Skip to content

v1.4.0

Compare
Choose a tag to compare
@glen-cheney glen-cheney released this 18 Aug 18:56
· 6 commits to master since this release

You can now use "demo-file" within the "docs-demo" field to reference a file to be included by nunjucks for the demo instead of writing the markup in JSON. For example:

"docs-demo": {
-  "demo-markup": "'<a href=\"javascript:void(0)\" class=\"btn\">Sign In</a>'"
+  "demo-file": "'demos/btn.html'"
},

The demos/btn.html file will need to exist within the nunjucks searchPaths, so make sure you have the templatePath option defined. For example, if in the example above the demo template path was style-guide-templates/demos/btn.html, you would configure the style guide like this:

const path = require('path');

styleguide.configure({
  
  templatePath: path.resolve('./style-guide-templates'),});