-
Notifications
You must be signed in to change notification settings - Fork 1
Description
It would be great to have an option for including some basic styling configuration for the various custom code renderers, to achieve a more consistent look of the final documents.
How should this be done, though?
Design musings
Currently, renderers do typically output SVG images (or in general, rendered HTML containing an SVG image), so injecting CSS style="..." attribute entries should be doable.
A simple key-value "stylesheet" (think .properties files) could be used, with standardized namings, and CSS-style value entries.
This could be even done with something like XSLT transforms, especially in case the underlying renderer allows no other easy way.
The "plugin"/renderer would then provide a list of mappings of stylesheet entries to paths of specific output SVG/HTML objects.
Each stylesheet entry may apply to zero, one, or many different element paths.
Additional notes
Wavedrom
Wavedrom does support some way of skinning, though it does seem a little complicated. Not impossible, but not too fun either. Also, Wavedrom's bitfield renderer does currently use its own set of colors, not tied to the skin.svg the waveform renderer uses.
Graphviz
Graphviz does support a way of styling the resulting images by using color attributes on nodes and stuff. However, this seems a little ill-concieved for what I'd want. Why should an author care about the specific colors while just editing the "flesh" of the document? The styling should be handled separately!
There are also "colorschemes", which do appear partly useful. One could perhaps define their own based on the standard document color names, and just use those in the graph source, which would be much nicer for authoring.
However, it still isn't too obvious how would one generate and use custom color schemes, much less so with the "bifurcated" back-end structure now.
BitField
Own source, can do whatever I please. Many styling parameters are already exposed in BitField renderer's config, so styling should be rather straightforward.
- Styling of BitField output
- Styling of Wavedrom output
- Styling of GraphViz output