@@ -148,10 +148,8 @@ def extract_description(desc_element):
148148 for para in desc_element .findall ('para' ):
149149 # Skip if this para is inside a parameterlist or simplesect
150150 parent = para
151- skip = False
152151 while parent is not None :
153152 if parent .tag in ['parameterlist' , 'simplesect' ]:
154- skip = True
155153 break
156154 parent = list (desc_element .iter ()).__contains__ (parent ) # Check if still in tree
157155 parent = None # Simple approach: only check direct parent
@@ -454,7 +452,6 @@ def convert_variants_to_links(variants_text, all_functions):
454452 # Match patterns: schema.function(params) or function(params)
455453 match = re .match (r'(?:`?([^`\s]+)`?\.)?`?"?([^`"\s(]+)"?`?\(([^)]*)\)?' , line )
456454 if match :
457- schema = match .group (1 ) # might be None (we'll strip it anyway)
458455 func_name = match .group (2 )
459456 params_str = match .group (3 ) if match .group (3 ) else ""
460457
@@ -585,11 +582,12 @@ def generate_markdown(func, all_functions=None, type_map=None):
585582
586583def main ():
587584 if len (sys .argv ) < 2 :
588- print ("Usage: xml-to-markdown.py <xml_dir> [output_dir]" )
585+ print ("Usage: xml-to-markdown.py <xml_dir> [output_dir] [version] " )
589586 sys .exit (1 )
590587
591588 xml_dir = Path (sys .argv [1 ])
592589 output_dir = Path (sys .argv [2 ]) if len (sys .argv ) > 2 else Path ('docs/api/markdown' )
590+ version = sys .argv [3 ] if len (sys .argv ) > 3 else 'DEV'
593591
594592 if not xml_dir .exists ():
595593 print (f"Error: XML directory not found: { xml_dir } " )
@@ -638,16 +636,14 @@ def main():
638636 "---" ,
639637 "title: EQL API Reference" ,
640638 "description: Complete API reference for the Encrypt Query Language (EQL) PostgreSQL extension." ,
639+ f"version: { version } " ,
641640 "---" ,
642641 "" ,
643- "# EQL API Reference" ,
644- "" ,
645642 "Complete API reference for the Encrypt Query Language (EQL) PostgreSQL extension." ,
646643 "" ,
647644 "## Functions" ,
648645 ""
649646 ]
650-
651647 # Add public functions to index
652648 for func in public_functions :
653649 anchor = generate_anchor (func ['signature' ])
@@ -656,7 +652,7 @@ def main():
656652 # Add private functions section to index
657653 if private_functions :
658654 index_lines .append ("" )
659- index_lines .append ("## Private Functions" )
655+ index_lines .append ("### Private Functions" )
660656 index_lines .append ("" )
661657 for func in private_functions :
662658 anchor = generate_anchor (func ['signature' ])
@@ -670,6 +666,9 @@ def main():
670666 all_funcs = public_functions + private_functions
671667 type_map = build_type_lookup_map (all_funcs )
672668
669+ index_lines .append ("" )
670+ index_lines .append ("## Functions" )
671+ index_lines .append ("" )
673672 for func in public_functions :
674673 index_lines .append (generate_markdown (func , all_funcs , type_map ))
675674
0 commit comments