stardoc icon indicating copy to clipboard operation
stardoc copied to clipboard

support output plugins

Open mobileink opened this issue 4 years ago • 2 comments

Currently support for Markdown output is hard-coded in RendererMain.java. With a little work this should be generalizable so that users can provide their own renderers. Define a Render interface or base class, change renderMarkdownHeader to renderHeader, etc. DItto for MarkdownUtil - abstract the API to FormatUtil or some such, change markdownCellFormat to cellFormat, etc. Then maybe add a --renderer option, or an attribute, where the user could provide a Java class.

Maybe this is already possible using the proto output? Unfortunately I know nothing about protobuf, and the protobuf rules for Bazel are effectively undocumented (follow the links, there's nothing there there).

mobileink avatar Jan 12 '21 12:01 mobileink

I'm curious: what kinds of customizations do you use stardoc templates to accomplish? I had assumed it was used to alter the header, sidebar, and stylesheets for a given project's .bzl documentation, but the mechanism appears to expose a lot more interface than is necessary to do that.

alandonovan avatar Jan 12 '21 14:01 alandonovan

On Tue, Jan 12, 2021 at 8:30 AM alandonovan [email protected] wrote:

I'm curious: what kinds of customizations do you use stardoc templates to accomplish? I had assumed it was used to alter the header, sidebar, and stylesheets for a given project's .bzl documentation, but the mechanism appears to expose a lot more interface than is necessary to do that.

I emit DITA code for everything. Preliminary result is: works great for most stuff. The conversion of markdown in rule definitions to XML is a bit limited. I think I can just put XML in the rule defns, but I haven't tried that yet. All I need is an extension mechanism to replace e.g. markdownCellFormat with my own code.

mobileink avatar Jan 12 '21 16:01 mobileink