1.3.0 • Published 5 years ago

docsify-variables v1.3.0

Weekly downloads
57
License
MIT
Repository
github
Last release
5 years ago

docsify-variables

Docsify plugin that load variables form external xml or json file

Install

  1. insert script into docsify document
<script src="//unpkg.com/docsify-variables/dist/docsify-variables.min.js"></script>
  1. 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/#/

Related

1.3.0

5 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago