6 with open(sys.argv[1]) as f:
9 if line.startswith('/* [XML'):
10 code = line.split()[1]
11 current_tag = line.split()[2]
12 current_opt = code == '[XML:opt]'
13 line = line[5+len(code)+len(current_tag):]
15 if current_tag is not None:
16 current_doc += line.replace('/* [XML] ', '').replace('*/', '').strip() + ' '
17 if line.find('*/') != -1 and current_tag is not None:
19 optional = ' (optional)'
22 print '<listitem><code><%s></code>%s — %s</listitem>' % (current_tag, optional, current_doc.strip())
24 print '</itemizedlist>'