Skip to content

Commit

Permalink
Fix up notes in text (#2502)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee authored Jan 30, 2025
1 parent cc19ab3 commit ec061c1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/generate_markdown_from_doxygen_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,16 @@ def markdown_any_tag(aTag, html=False,para=True,consume=False):
#Convert "note" types
if aTag.attrib['kind']=='warning' or aTag.attrib['kind']=='note' or aTag.attrib['kind']=='attention':
#print('Debug: kind %s' % aTag.attrib['kind'])
noteTypeText=aTag.attrib['kind'].capitalize()
noteTypeText=aTag.attrib['kind'].lower()
if noteTypeText == 'note': # Vitepress expects info blocks
noteTypeText = 'info'
if para:
if html:
tag_text='<p>'+lead_text+'<b>'+noteTypeText+': </b> '+child_text+'</p>'+tail_text
else: # ONLY THIS PATH TESTED (others should not occur, but leaving in as standard.
tag_text='\n\n> **'+noteTypeText+'** '+lead_text.strip()+child_text.strip()+'\n\n'+tail_text.strip()
if html:
tag_text='<p>'+lead_text+'<b>'+noteTypeText+': </b> '+child_text+'</p>'+tail_text
else: # ONLY THIS PATH TESTED (others should not occur, but leaving in as standard.
tag_text='\n\n::: '+noteTypeText+'\n'+lead_text.strip()+child_text.strip()+'\n:::\n\n'+tail_text.strip()
else: #para disabled, render without them.
tag_text='\n\n> **'+noteTypeText+'** '+ lead_text.strip()+child_text.strip()+tail_text.strip()

tag_text='\n\n::: '+noteTypeText+'\n'+ lead_text.strip()+child_text.strip()+'\n:::\n\n'+tail_text.strip()

elif aTag.tag=='verbatim':
tag_text='\n\n'+lead_text+child_text+'\n\n'+tail_text
Expand Down

0 comments on commit ec061c1

Please sign in to comment.