Today, I am focused on creating a first cut of a pandoc writer for Bike. I will start by having a writer emit the simple output of a valid but empty Bike document. The next step would be to have the writer flatten a pandoc AST into a single list of plain text Bike nodes. I defer dealing with the rich text and hierarchical structures until I have the simple writer in place. Dealing with rich text and containment of elements requires me to better grok the pandoc AST, particularly what can contain which other element. I will use pandoc (Python library) and panflute interactively in a Jupyter notebook to facilitate that grokking. I aim for good coverage of pandoc AST examples by writing pandoc markdown, which I then convert to pandoc JSON (note the documentation on pandoc markdown.
Ideally, my pandoc Bike reader and writer will enable lossless roundtripping of Bike conversion. In other words, if I use the reader to convert a bike document to pandoc JSON and then use my pandoc Bike writer to convert the JSON to a Bike document, the resulting Bike document should essentially be the same the original document.
A question to answer as I dive into the pandoc writer for Bike: how to handle parts of the pandoc AST that I don\'t know how to translate into Bike elements but would nonetheless like to park in some placeholding structure?