0

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.

Paul Meems
  • 3,002
  • 4
  • 35
  • 66
  • Your EDIT looks correct to me. I think this is a bug with the latest version of docson, so I've made a bug report - https://github.com/lbovet/docson/issues/73 In the meantime, one of our websites uses this commit, which seems to work - https://github.com/lbovet/docson/commit/4c5e24a72e94e7cb2d5cc0d4391556690dc4d5d6 – Ben Webb Mar 14 '19 at 07:24
  • Thanks @BenWebb for reporting this as a bug. Are you sure the link to the commit is the correct one? It is now pointing to some old css changes which I already have. – Paul Meems Mar 14 '19 at 16:05
  • For now I reverted back to v1.1.0 of Docson and now it is working as expected. – Paul Meems Mar 15 '19 at 09:07

0 Answers0