Skip to content

Docsify plugin that load variables from external xml file

Notifications You must be signed in to change notification settings

bandorko/docsify-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ${//item[2]}

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 ${//item[2]}

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

About

Docsify plugin that load variables from external xml file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published