From 0ae310c329e413919b7959e0eb6dea899856b9fe Mon Sep 17 00:00:00 2001 From: cedounet <134267244+cedounet@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:52:27 +0100 Subject: [PATCH] Add list of flowcharts in ebook (#240) * Add list of flowcharts in ebook * Mark menu as selected on list of flowcharts --------- Co-authored-by: Hendrik Kleinwaechter --- book/tex4ebook.cfg | 5 +++++ website/modify_build.rb | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/book/tex4ebook.cfg b/book/tex4ebook.cfg index 9906e44..43adcf5 100644 --- a/book/tex4ebook.cfg +++ b/book/tex4ebook.cfg @@ -1,4 +1,9 @@ \Preamble{xhtml} +\renewcommand\listofflowcharts{% +\chapter*{\listoflocname}% +\TableOfContents[loc]% +} +\ConfigureToc{loc}{\HCode{}}{\ }{}{\HCode{
}} \begin{document} \Configure{DocumentLanguage}{en} \Configure{OpfScheme}{URI} diff --git a/website/modify_build.rb b/website/modify_build.rb index c2067af..ce2f697 100644 --- a/website/modify_build.rb +++ b/website/modify_build.rb @@ -237,7 +237,7 @@ class ModifyBuild # https://github.com/hendricius/the-sourdough-framework/pull/188 for more # details appendix_html = %Q{ - + List of Flowcharts @@ -379,6 +379,14 @@ class ModifyBuild doc.css(".menu-items .chapterToc.home-link")[0].add_class("selected") return doc.to_html end + + # Special case for the flowcharts page which is added by us to the menu. + # This needs to be done for future manually added pages too + if "listoflocname.html" == filename + doc.css(".menu-items .chapterToc.flowcharts-menu")[0].add_class("selected") + return doc.to_html + end + return doc.to_html unless selected # Fix that when the menu is selected the href is empty. This way users can