	
	<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-04-2+some+progress&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-10&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=https://hypotyposis.net/blog/2023/10/10/mic-04-2-some-progress/&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-04-2+some+progress&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-10&amp;rft.type=blogPost&amp;rft.format=text&amp;rft.identifier=https://hypotyposis.net/blog/2023/10/10/mic-04-2-some-progress/&amp;rft.language=English"></span>
{"id":1573,"date":"2023-10-10T21:55:48","date_gmt":"2023-10-11T04:55:48","guid":{"rendered":"https:\/\/hypotyposis.net\/blog\/?p=1573"},"modified":"2023-10-10T21:55:48","modified_gmt":"2023-10-11T04:55:48","slug":"mic-04-2-some-progress","status":"publish","type":"post","link":"https:\/\/hypotyposis.net\/blog\/2023\/10\/10\/mic-04-2-some-progress\/","title":{"rendered":"MIC-04-2 some progress"},"content":{"rendered":"<p>My first pass -- taking a recursive approach:<\/p>\n<pre><code class=\"language-Python\">def panflute_to_bike_etree(pfe) -&gt; ET.Element:\n    &quot;&quot;&quot;\n    pfe: panflute element    \n    base_header_level: the base header level to use for the document\n    TO DO: handle different header levels -- might need to abandon this approach in favor of non-recursive approach with a manual stack\n    &quot;&quot;&quot;\n\n    if is_inline_or_contentless(pfe):\n        p_elem = ET.Element(&quot;p&quot;)\n        p_elem.text = pf.stringify(pfe).strip()\n        return p_elem\n    else:\n        if pfe.tag == &quot;Doc&quot;:\n            etree = empty_bike_etree()\n            ul_elem = etree.xpath(&quot;\/\/ul&quot;)[0]\n        else:\n            ul_elem = ET.Element(&quot;ul&quot;)\n\n        try:\n            for c in pfe.content:\n                e = panflute_to_bike_etree(c)\n                li_elem = ET.SubElement(ul_elem, &quot;li&quot;)\n                li_elem.append(e)\n        except AttributeError:\n            pass\n        else:\n            if pfe.tag == &quot;Doc&quot;:\n                etree = add_ids_to_bike_etree(etree)\n                return etree\n            else:\n                return ul_elem\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>My first pass &#8212; taking a recursive approach: def panflute_to_bike_etree(pfe) -&gt; ET.Element: &quot;&quot;&quot; pfe: panflute element base_header_level: the base header level to use for the document TO DO: handle different header levels &#8212; might need to abandon this approach in &hellip; <a href=\"https:\/\/hypotyposis.net\/blog\/2023\/10\/10\/mic-04-2-some-progress\/\">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-1573","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-pn","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1573","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=1573"}],"version-history":[{"count":1,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1573\/revisions"}],"predecessor-version":[{"id":1574,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/posts\/1573\/revisions\/1574"}],"wp:attachment":[{"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/media?parent=1573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/categories?post=1573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hypotyposis.net\/blog\/wp-json\/wp\/v2\/tags?post=1573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}