1.3.0 • Published 5 years ago
docsify-variables v1.3.0
docsify-variables
Docsify plugin that load variables form external xml or json file
Install
- insert script into docsify document
<script src="//unpkg.com/docsify-variables/dist/docsify-variables.min.js"></script>
- add a variablesFile property to docsify config
window.$docsify = {
variablesFile : 'variables.xml'
}
Usage
docsify-variables will replace ${<variable>} references to a value in the variablesFile
to reference a value in an xml file you can use:
- fully qualified path to the tag. eg.: ${var.foo}
- or an XPath expression. eg.: ${/var/foo} or ${//item2}
to reference a value in a json file you can use:
- fully qualified path to the value. eg.: ${var.foo}
- or an XPath expression. eg.: ${/var/foo} or ${//item2}
XML Example source
Live example
https://bandorko.github.io/docsify-variables/examples/xml/#/
JSON Example source
Live example
https://bandorko.github.io/docsify-variables/examples/json/#/