From 52ac80d3a3b3fff07f4d457abded3cd0ed6b3e73 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Fri, 17 Jan 2020 16:41:18 +0100 Subject: [PATCH] mkdocs2pdf: remove changelog versions from summary --- mkdocs2pdf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkdocs2pdf.py b/mkdocs2pdf.py index 0d36204fb..76c11dda6 100644 --- a/mkdocs2pdf.py +++ b/mkdocs2pdf.py @@ -108,7 +108,11 @@ def convertMdToTex(filePath): if line.strip() == '\\begin{document}': bContent = True for i, line in enumerate(ls): - ls[i] = line.replace('\\includegraphics', '\\includegraphics[max size={\\textwidth}{0.9\\textheight}]').replace('\\begin{figure}[htbp]', '\\begin{figure}[h!]') + l = line + l = l.replace('\\includegraphics', '\\includegraphics[max size={\\textwidth}{0.9\\textheight}]') + l = l.replace('\\begin{figure}[htbp]', '\\begin{figure}[h!]') + l = re.sub(r'(\\subsubsection)({[0-9]+.[0-9]+.[0-9]+)', r'\1*\2', l) + ls[i] = l with open('{}.tex'.format(filePath), 'w') as f: f.writelines(ls) -- GitLab