added utility to remove fenced code blocks from final html docs since srcweave is a pain in that regard

This commit is contained in:
Kevin F 2022-09-08 13:35:51 -05:00
parent f2b572946a
commit ca5c748478
1 changed files with 13 additions and 0 deletions

13
util/removefencedcode.py Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env python3
# Remove fenced code blocks from generated HTML files
# We need to do this because srcweave does not support fenced code blocks
import glob
for f in glob.glob('docs/*.html'):
with open(f, 'r') as fin:
lines = fin.readlines()
with open(f, 'w') as fout:
for line in lines:
if line.startswith('<p>```'):
continue
fout.write(line)