hendricius / the-sourdough-framework

Open source book dedicated to helping you to make the best possible sourdough bread at home.
https://breadco.de/book
Creative Commons Attribution Share Alike 4.0 International
2.58k stars 128 forks source link

Add a flowchart environnement and its listof #188

Closed cedounet closed 11 months ago

cedounet commented 11 months ago

So we can more easily access those flowcharts from pdf and website, rather than looking in the crowded list of figures.

hendricius commented 11 months ago

For some reason they are not shown in the websiten editioimage

I could remove the list for now on the website?

cedounet commented 11 months ago

That is the easy "fix"...

Is the file book.loc (list of charts...) created?

hendricius commented 11 months ago

Good point. The CI doesn't run trying to make the ebook version. This seems to be broken too. Got this error when running make bake

[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]

[WARNING] domfilter: DOM parsing of listtablename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]

[WARNING] domfilter: DOM parsing of listfigurename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=22667]

[WARNING] domfilter: DOM parsing of listfigurename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=22667]

[WARNING] exec_epub: Missing opf file
...023/texmf-dist/scripts/tex4ebook/tex4ebook-exec_epub.lua:341: attempt to index a nil value (local 'f')
cedounet commented 11 months ago

:/ Let me have a look.

cedounet commented 11 months ago

Yeah that is something wrong with make4ht/tex4ebook

the-sourdough-framework/book ➤ 9611b25|list_of_flowchart⚡ 3814 ± : head book_serif/book.loc [-28208758m] ✹ ✭ \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \contentsline {flowchart}{\numberline {1}{\ignorespaces Process for starter from scratch}}{19}{flowchart.caption.14}% \contentsline {flowchart}{\numberline {2}{\ignorespaces Sourdough readiness flow chart}}{22}{flowchart.caption.16}% \contentsline {flowchart}{\numberline {3}{\ignorespaces Sourdough starter maintenance flowchart}}{24}{flowchart.caption.17}% \addvspace {10\p@ }

it is all empty with maek4ht book ➤ 9611b25|list_of_flowchart⚡ 3815 ± : head book.loc [-28208758m] ✹ ✭ \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ } \addvspace {10\p@ }

cedounet commented 11 months ago

Good point. The CI doesn't run trying to make the ebook version. This seems to be broken too. Got this error when running make bake

[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]
[...]
[WARNING] exec_epub: Missing opf file
...023/texmf-dist/scripts/tex4ebook/tex4ebook-exec_epub.lua:341: attempt to index a nil value (local 'f')

FWIW local builds work on my debian machine.

Our website issue is related to the .loc file being empty.

cedounet commented 11 months ago

Some more debug info the file book.4ct has loc, lof and lot infos..

My google-fu is failing me right now.

grep loc book.4ct | head \doTocEntry\tocloc{1}{\csname a:TocLink\endcsname{7}{x7-14002r1}{}{\ignorespaces Process for starter from scratch}}{flowchart}\relax \doTocEntry\tocloc{2}{\csname a:TocLink\endcsname{7}{x7-15001r2}{}{\ignorespaces Sourdough readiness flow chart}}{flowchart}\relax \doTocEntry\tocloc{3}{\csname a:TocLink\endcsname{7}{x7-16001r3}{}{\ignorespaces Sourdough starter maintenance flowchart}}{flowchart}\relax \doTocEntry\tocloc{4}{\csname a:TocLink\endcsname{10}{x10-27001r4}{}{\ignorespaces Flat bread process}}{flowchart}\relax \doTocEntry\tocloc{5}{\csname a:TocLink\endcsname{11}{x11-29001r5}{}{\ignorespaces The typical process of making a wheat-based sourdough bread.\relax }}{flowchart}\relax \doTocEntry\tocloc{6}{\csname a:TocLink\endcsname{11}{x11-30001r6}{}{\ignorespaces Process to prepare your starter before baking}}{flowchart}\relax \doTocEntry\tocloc{7}{\csname a:TocLink\endcsname{11}{x11-36001r7}{}{\ignorespaces The gluten development process for a wheat-based dough.\relax }}{flowchart}\relax \doTocEntry\tocloc{8}{\csname a:TocLink\endcsname{11}{x11-37002r8}{}{\ignorespaces Process to check the bulk fermentation}}{flowchart}\relax \doTocEntry\tocloc{9}{\csname a:TocLink\endcsname{11}{x11-39001r9}{}{\ignorespaces Dividing decision tree}}{flowchart}\relax \doTocEntry\tocloc{10}{\csname a:TocLink\endcsname{11}{x11-40001r10}{}{\ignorespaces Shaping process}}{flowchart}\relax

hendricius commented 11 months ago

Maybe I can reach out to Michal?

On Sun 20. Aug 2023 at 15:11, cedounet @.***> wrote:

Some more debug info the file book.4ct has loc, lof and lot infos..

My google-fu is failing me right now.

grep loc book.4ct | head \doTocEntry\tocloc{1}{\csname a:TocLink\endcsname{7}{x7-14002r1}{}{\ignorespaces Process for starter from scratch}}{flowchart}\relax \doTocEntry\tocloc{2}{\csname a:TocLink\endcsname{7}{x7-15001r2}{}{\ignorespaces Sourdough readiness flow chart}}{flowchart}\relax \doTocEntry\tocloc{3}{\csname a:TocLink\endcsname{7}{x7-16001r3}{}{\ignorespaces Sourdough starter maintenance flowchart}}{flowchart}\relax \doTocEntry\tocloc{4}{\csname a:TocLink\endcsname{10}{x10-27001r4}{}{\ignorespaces Flat bread process}}{flowchart}\relax \doTocEntry\tocloc{5}{\csname a:TocLink\endcsname{11}{x11-29001r5}{}{\ignorespaces The typical process of making a wheat-based sourdough bread.\relax }}{flowchart}\relax \doTocEntry\tocloc{6}{\csname a:TocLink\endcsname{11}{x11-30001r6}{}{\ignorespaces Process to prepare your starter before baking}}{flowchart}\relax \doTocEntry\tocloc{7}{\csname a:TocLink\endcsname{11}{x11-36001r7}{}{\ignorespaces The gluten development process for a wheat-based dough.\relax }}{flowchart}\relax \doTocEntry\tocloc{8}{\csname a:TocLink\endcsname{11}{x11-37002r8}{}{\ignorespaces Process to check the bulk fermentation}}{flowchart}\relax \doTocEntry\tocloc{9}{\csname a:TocLink\endcsname{11}{x11-39001r9}{}{\ignorespaces Dividing decision tree}}{flowchart}\relax \doTocEntry\tocloc{10}{\csname a:TocLink\endcsname{11}{x11-40001r10}{}{\ignorespaces Shaping process}}{flowchart}\relax

— Reply to this email directly, view it on GitHub https://github.com/hendricius/the-sourdough-framework/pull/188#issuecomment-1685282301, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGHNW5ZZ4XTVBZ2XPY76NTXWIEHLANCNFSM6AAAAAA3XER7GQ . You are receiving this because you commented.Message ID: @.***>

cedounet commented 11 months ago

Was planning to Google some more and if not do a MWE before reaching out.

cedounet commented 11 months ago

OK here my MWE if you could confirm it "works" (i.e. fails) for you too: `\documentclass{scrbook} \DeclareNewTOC[ type=flowchart,% types=flowcharts,% , float, name=Flowchart,% listname = {List of Flowcharts} ]{loc} \setuptoc{loc}{chapteratlist}

\begin{document} \begin{flowchart}[!htb] \caption{A flowchart} \end{flowchart}

\begin{figure}[!htb] \caption{A figure} \end{figure} \listofflowcharts \listoffigures

\end{document}`

If i do lualatex mwe.tex then cat mwe.loc I get: \contentsline {flowchart}{\numberline {1}{\ignorespaces A flowchart}}{1}{}% \providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file and the pdf is as expected

If I do make4ht --lua -a debug mwe.tex then cat mwe.loc I get an empty file: \providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file

hendricius commented 11 months ago

@cedounet great test. Can confirm - I get the same error.

cedounet commented 11 months ago

raised https://github.com/michal-h21/tex4ebook/issues/114

cedounet commented 11 months ago

Updated with michal's comments. @hendricius please have a look if that works (reverted your workaround). My ruby install is flaky right now.

hendricius commented 11 months ago

@cedounet thank you!!!

For some reason after trying - I still don't see the list of tables in the navigation bar on the right. However - the file is generated. I will add a workaround for this for now. I will merge the PR and create a followup PR. Side note - could you maybe directly create your branches on this repo? Then I can push to your PRs and/or you can push to mine. Thank you!

cedounet commented 11 months ago

Side note - could you maybe directly create your branches on this repo? Then I can push to your PRs and/or you can push to mine. Thank you!

I will try yes