Allow multiple output formats
@ptomato
Submitted by Philip Chimento Link to original bug (#750534)
Description
Created attachment 304740 Output formats
I'd like to allow multiple output formats of g-ir-doc-tool via a --format switch. The default format would be "mallard" so the feature would be entirely optional and if you didn't use it, the current behaviour would remain unchanged.
My use case is outputting easy-to-scrape HTML for DevDocs [1] [2]. The HTML that yelp-build generates from the Mallard XML is not easy to scrape for various reasons, and scraping it is also fragile to changes in yelp-build's XSLT. To see an early draft of how I would be using this feature, see [3].
Tomeu's JSON output branch [4] can also be implemented as an output format if desired. The existing --write-sections-file option can be an output format as well. In this patch it is special-cased so as not to disturb the existing code, but it could just as well be implemented as an output format with templates. I could take a crack at that if there was any interest.
[1] http://devdocs.io [2] https://github.com/Thibaut/devdocs [3] https://github.com/ptomato/gobject-introspection/tree/wip/ptomato/devdocs [4] https://git.gnome.org/browse/gobject-introspection/diff/giscanner/docmain.py?h=wip/docs-json&id=f5548c41883fe0b1a08493bf9cc075a0311d1ade
Patch 304740, "Output formats":
0001-docwriter-Option-to-select-output-format.patch