Refactor code to allow TikZ to html conversions on demand #30
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a refactoring that will allow users to perform conversions on demand, keeps the existing functionality, and fixes some bugs.
I had a use case where I wanted to do the main processing in a Worker, so I made these changes (and some more that aren't included) to support that. I've left most of the existing code intact. Also helps with #8, #20, and #24.
TikZJax.js
contains all of the conversion logic and exposes aload(wasmPath, coredumpPath)
method that can be called to instantiate the wasm module on demand.index.js
contains all of the logic that relies on being in the dom.I've updated the README with a basic example of how to load things manually.
I also had to pull in a different version of
dvi2html
to get things to build, but that should not be an issue because the interface looks to be the same.The repository seems incomplete so let me know if I've messed up some hidden workflow.