	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=MIC-03-3+Starting+to+write+a+Pandoc+writer+for+Bike&amp;rft.aulast=Yee&amp;rft.aufirst=Raymond&amp;rft.subject=Uncategorized&amp;rft.source=Hypotyposis+on+a+Good+Day&amp;rft.date=2023-10-04&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=https://hypotyposis.net/blog/2023/10/04/mic-03-3-starting-to-write-a-pandoc-writer-for-bike/&amp;rft.language=English"></span>
	
	<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.title=MIC-03-3+Starting+to+write+a+Pandoc+writer+for+Bike&amp;rft.aulast=Yee&amp;rft.aufirst=Raymond&amp;rft.subject=Uncategorized&amp;rft.source=Hypotyposis+on+a+Good+Day&amp;rft.date=2023-10-04&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=https://hypotyposis.net/blog/2023/10/04/mic-03-3-starting-to-write-a-pandoc-writer-for-bike/&amp;rft.language=English"></span>
{"id":1563,"date":"2023-10-04T11:56:34","date_gmt":"2023-10-04T18:56:34","guid":{"rendered":"https:\/\/hypotyposis.net\/blog\/?p=1563"},"modified":"2023-10-04T11:56:34","modified_gmt":"2023-10-04T18:56:34","slug":"mic-03-3-starting-to-write-a-pandoc-writer-for-bike","status":"publish","type":"post","link":"https:\/\/hypotyposis.net\/blog\/2023\/10\/04\/mic-03-3-starting-to-write-a-pandoc-writer-for-bike\/","title":{"rendered":"MIC-03-3 Starting to write a Pandoc writer for Bike"},"content":{"rendered":"<p>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 <a href=\"https:\/\/boisgera.github.io\/pandoc\/\">pandoc (Python library)<\/a> and <a href=\"http:\/\/scorreia.com\/software\/panflute\/\">panflute<\/a> 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 <a href=\"https:\/\/pandoc.org\/MANUAL.html%22%20%5Cl%20%22pandocs-markdown\">documentation on pandoc markdown<\/a>.<\/p>\n<p>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.<\/p>\n<p>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?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/hypotyposis.net\/blog\/2023\/10\/04\/mic-03-3-starting-to-write-a-pandoc-writer-for-bike\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1563","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7I6qs-pd","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/comments?post=1563"}],"version-history":[{"count":1,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1563\/revisions"}],"predecessor-version":[{"id":1564,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1563\/revisions\/1564"}],"wp:attachment":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/media?parent=1563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/categories?post=1563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/tags?post=1563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}