JS API docs for mozilla-central

Tom Prince mozilla at hocat.ca
Tue Nov 21 19:04:55 UTC 2017


On Tue, Nov 21, 2017 at 11:59 AM Gregory Szorc <gps at mozilla.com> wrote:

> On Tue, Nov 21, 2017 at 10:37 AM, Felipe G <felipc at 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 schema
>>
>>
>> Any 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.
>

And there may already exist plugins that do that (
https://pypi.python.org/pypi/sphinx-jsonschema which I haven't looked at).

-- Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20171121/a8046ed2/attachment.html>


More information about the firefox-dev mailing list