From 42cb98c69d7dd206c810fc8232053b06444197d6 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 1 May 2023 10:09:35 +0100 Subject: [PATCH] find hide/show blocks and skip them in PDFs --- openpower/mdwn_inline.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.30.2