Module to bundle/unbundle the XML UI files for Tabletop Simulator.
npm install @tts-tools/xmlbundlexmlbundle is a module to bundle and unbundle XML UI files from Tabletop Simulator.
It mimics the behavior for XML files of the TTS Atom plugin.
``sh`
npm install -D @tts-tools/xmlbundle
To bundle a XML UI, use the bundle function from the xmlbundle module.string
It takes the XML content as a and the include directory where additional files can be found and returns the bundled XML.
Files can be included by adding into the XML.file_path is a relative path starting from the given include directory..xml
It can contain the ending at the end, but that's not a requirement.
When an included file also contains includes, the path of the included file will be used as the root path to search for those additional includes.
Given a file named main.xml with the following content:
`xml`
This bundling call:
`ts
import { bundle } from "@tts-tools/xmlbundle";
const input = '
const bundled = bundle(input, "
console.log(bundled);
`
Will result in this output:
`xml`
The reverse happens during unbundle (but it won't create the file).
Given the following directory structure:
``
├─ main.xml
└─ nested
├─ main.xml
└─ index.xml
And those XML Files:
main.xml:
`xml
nested/index.xml:
`xml`
nested/main.xml
`xml`
Bundling the content of main.xml will result in this output:
`xml``
No rights reserved.
The author has dedicated the work to the Commons by waiving all of his or her rights to the work
worldwide under copyright law and all related or neighboring legal rights he or she had in the work,
to the extent allowable by law.
Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author.