citeproc-ruby
citeproc-ruby copied to clipboard
How to add a new output format?
I'm looking to create an output format that outputs ansi console codes -- any tips on where to start on creating a new output format?
You can see the current formats here. To create a new format you need to sub-class Format and override any of the methods here and add apply_* methods for any CSL formatting directive you wish to implement (e.g., apply_font_style, apply_vertical_align, etc.).
Interesting -- I thought styles could apply stuff like bold and italics (I once created a markdown format inside Zotero) but I don't see any of it here. Maybe this isn't required though for my case and I could just stick to the plain format.
Yes, for those you need to implement apply_font_weight and apply_font_style. Take a look at the html format as an example: it maps those to CSS styles or uses <b>, <i> tags (that's an internal configuration option used by the format).