This is awesome! \o/I'm actually searching right now for what I could use to generate documentation (to publish on firefox-source-docs) from a JSON schema. Does anyone know if there's already something available that I could look into?Ideally, I want to:- write a JSON schema in-tree- use that schema to validate a JSON file, client-side on Firefox- use that same file to generate docs about the schemaAny suggestions are welcome!
On Tue, Nov 21, 2017 at 10:37 AM, Felipe G <fel...@gmail.com> wrote:This is awesome! \o/I'm actually searching right now for what I could use to generate documentation (to publish on firefox-source-docs) from a JSON schema. Does anyone know if there's already something available that I could look into?Ideally, I want to:- write a JSON schema in-tree- use that schema to validate a JSON file, client-side on Firefox- use that same file to generate docs about the schemaAny suggestions are welcome!The tool we're using (Sphinx) is extensible in many different ways. We already have one custom extension in mozilla-central for auto-generating the moz.build symbols documentation. That lives at https://hg.mozilla.org/mozilla-central/file/72ee4800d415/python/mozbuild/mozbuild/sphinx.py (it is loaded via tools/docs/conf.py). Essentially, that extension registers a "mozbuildsymbols" rst directive that when evaluated is expanded to a bunch of standard rst directives. Sphinx then converts those standard rst directives to HTML, PDF, etc. If you want to generate docs for things like JSON schemas, IDL files, etc, you basically need to write some code that can convert some input to rst. Then you glue that into Sphinx with an extension.