问题
I'm working on the documentation (https://global-coffee-data-standard.readthedocs.io) of my JSON schema (https://raw.githubusercontent.com/andrejellema/GlobalCoffeeDataStandard/master/schema/global-coffee-data-standard.schema.json)
The basics I have working (thanks to a lot of help from this forum) but now I would like to include the docson widget to show my code more beautiful (https://global-coffee-data-standard.readthedocs.io/en/latest/explanation.html#id13)
I've read this page https://threesixtygiving-standard.readthedocs.io/en/latest/_static/docson/README/ and I'm wondering how to install docson locally but more important on ReadTheDocs.
Do I need to run npm i docson
localy? If so which files do I commit to my _static
folder so ReadTheDocs can work with it as well?
Or can I put some magic in conf.py
to let Sphinx handle it?
EDIT
I tried adding the docson files to my _static
folder and it seems to work when I add this code to my ReST file:
<script src="_static/docson/js/widget.js" data-schema="https://raw.githubusercontent.com/andrejellema/GlobalCoffeeDataStandard/master/schema/global-unique-id.json"></script>
But only when I add just one docson widget. When I add more I get this error in the console:
only one instance of babel-polyfill is allowed
.
So I'm assuming this is not the correct workflow.
What is the correct workflow to add multiple docson widgets to my page.
来源:https://stackoverflow.com/questions/54706831/how-to-use-docson-widget-with-sphinx-on-readthedocs