From: Luke Kenneth Casson Leighton Date: Mon, 1 May 2023 09:09:35 +0000 (+0100) Subject: find hide/show blocks and skip them in PDFs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=42cb98c69d7dd206c810fc8232053b06444197d6;p=libreriscv.git find hide/show blocks and skip them in PDFs --- diff --git a/openpower/mdwn_inline.py b/openpower/mdwn_inline.py index e072ecb1b..c0738b353 100755 --- a/openpower/mdwn_inline.py +++ b/openpower/mdwn_inline.py @@ -32,12 +32,23 @@ wiki_path = os.path.split(openpower_path)[0] def recursive_inline(f, input_name, depth): assert depth < 10, "probably found an [[!inline]]-loop" + skip = False # found the pattern for line in f.readlines(): + # skip hide/show + if skip: + if line.startswith(""): + skip = False + continue + elif line.startswith(""): + skip = True + continue + # fix separation in comparison table if input_name.endswith("comparison_table.tex") and \ line.startswith("\begin{itemize}"): o.write(line) o.write("\\itemsep -0.3em\n") continue + # find actual inlines if not line.startswith("[[!inline"): o.write(line) continue