texlive[75071] Master/texmf-dist: header bar for fulltoc, tex4ht
commits+karl at tug.org
commits+karl at tug.org
Wed Apr 30 22:36:41 CEST 2025
Revision: 75071
https://tug.org/svn/texlive?view=revision&revision=75071
Author: karl
Date: 2025-04-30 22:36:41 +0200 (Wed, 30 Apr 2025)
Log Message:
-----------
header bar for fulltoc, tex4ht r1669
Revision Links:
--------------
https://tug.org/svn/texlive?view=revision&revision=1669
Modified Paths:
--------------
trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2025-04-30 19:32:51 UTC (rev 75070)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog 2025-04-30 20:36:41 UTC (rev 75071)
@@ -1,3 +1,8 @@
+2025-04-30 Michal Hoftich <michal.h21 at gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): added header bar with the "fulltoc"
+ option.
+
2025-04-29 Michal Hoftich <michal.h21 at gmail.com>
* tex4ht-html4.tex (html4.4ht): include section numbers in the TOC
Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex 2025-04-30 19:32:51 UTC (rev 75070)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex 2025-04-30 20:36:41 UTC (rev 75071)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1668 2025-04-29 14:59:53Z michal_h21 $
+% $Id: tex4ht-html4.tex 1669 2025-04-30 14:09:10Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -1973,6 +1973,17 @@
\NewConfigure{fulltocsections}{1}
\Configure{fulltocsections}{chapter,likechapter,section,likesection,subsection,likesubsection}
+\NewConfigure{sitetitle}{1}
+\Configure{sitetitle}{\LikeRef{TITLE+}}
+
+% print site header and the hamburger menu button
+\NewConfigure{siteheader}{1}
+\Configure{siteheader}{\ifvmode\IgnorePar\fi\EndP\HCode{<header class="header-bar">\Hnewline
+ <h1>\a:sitetitle</h1><button class="hamburger">\string≡</button>\Hnewline
+</header>}}
+
+\Configure{@BODY}{\a:siteheader}
+
% put full TOC on each page
\Configure{crosslinks+}{%
\bgroup
@@ -1984,7 +1995,7 @@
\expandafter\TableOfContents\expandafter[\a:fulltocsections]% Print table of contents before crosslinks
\egroup
\ifvmode\IgnorePar\fi\EndP%
- \HCode{<main class="main-content">\Hnewline<nav class="crosslinks-top">} }
+ \HCode{<main class="main-content"><article>\Hnewline<nav class="crosslinks-top">} }
{\HCode{</nav>\Hnewline}}%
{\ifvmode\IgnorePar\fi\EndP%
\HCode{<nav class="crosslinks-bottom">}}{\HCode{</nav>}}{}{}
@@ -1992,10 +2003,10 @@
% configuration for TOC on the main page, it is not configured by the previous command
% we added also the bookTOC class, so that we can style it differently than minitocs on subpages
\Configure{tableofcontents}{\IgnorePar\EndP\HCode{<nav class="TOC bookTOC">}\IgnorePar}
-{}{\IgnorePar\HCode{</nav>\Hnewline<main class="main-content">\Hnewline}\ShowPar}{}{}%
+{}{\IgnorePar\HCode{</nav>\Hnewline<main class="main-content"><article>\Hnewline}\ShowPar}{}{}%
% close the <main> element started in \Configure{crosslinks+} and \Configure{tableofcontents}
-\Configure{@/BODY}{\ifvmode\IgnorePar\fi\EndP\HCode{</main>}}
+\Configure{@/BODY}{\ifvmode\IgnorePar\fi\EndP\HCode{</article></main>}}
\Css{nav.TOC > span{display:block;}}
\def\:declaresectionnumberlink#1{%
% these configurations are inspired by this post: https://tex.stackexchange.com/a/523739/2891
Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht 2025-04-30 19:32:51 UTC (rev 75070)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht 2025-04-30 20:36:41 UTC (rev 75071)
@@ -1,4 +1,4 @@
-% html4.4ht (2025-04-29-13:09), generated from tex4ht-html4.tex
+% html4.4ht (2025-04-30-13:33), generated from tex4ht-html4.tex
% Copyright 2009-2025 TeX Users Group
% Copyright 1997-2009 Eitan M. Gurari
%
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2025-04-29-13:09}
+\immediate\write-1{version 2025-04-30-13:33}
\exit:ifnot{8859-6,%
CJK,%
@@ -1522,6 +1522,17 @@
\NewConfigure{fulltocsections}{1}
\Configure{fulltocsections}{chapter,likechapter,section,likesection,subsection,likesubsection}
+\NewConfigure{sitetitle}{1}
+\Configure{sitetitle}{\LikeRef{TITLE+}}
+
+% print site header and the hamburger menu button
+\NewConfigure{siteheader}{1}
+\Configure{siteheader}{\ifvmode\IgnorePar\fi\EndP\HCode{<header class="header-bar">\Hnewline
+ <h1>\a:sitetitle</h1><button class="hamburger">\string≡</button>\Hnewline
+</header>}}
+
+\Configure{@BODY}{\a:siteheader}
+
% put full TOC on each page
\Configure{crosslinks+}{%
\bgroup
@@ -1533,7 +1544,7 @@
\expandafter\TableOfContents\expandafter[\a:fulltocsections]% Print table of contents before crosslinks
\egroup
\ifvmode\IgnorePar\fi\EndP%
- \HCode{<main class="main-content">\Hnewline<nav class="crosslinks-top">} }
+ \HCode{<main class="main-content"><article>\Hnewline<nav class="crosslinks-top">} }
{\HCode{</nav>\Hnewline}}%
{\ifvmode\IgnorePar\fi\EndP%
\HCode{<nav class="crosslinks-bottom">}}{\HCode{</nav>}}{}{}
@@ -1541,10 +1552,10 @@
% configuration for TOC on the main page, it is not configured by the previous command
% we added also the bookTOC class, so that we can style it differently than minitocs on subpages
\Configure{tableofcontents}{\IgnorePar\EndP\HCode{<nav class="TOC bookTOC">}\IgnorePar}
-{}{\IgnorePar\HCode{</nav>\Hnewline<main class="main-content">\Hnewline}\ShowPar}{}{}%
+{}{\IgnorePar\HCode{</nav>\Hnewline<main class="main-content"><article>\Hnewline}\ShowPar}{}{}%
% close the <main> element started in \Configure{crosslinks+} and \Configure{tableofcontents}
-\Configure{@/BODY}{\ifvmode\IgnorePar\fi\EndP\HCode{</main>}}
+\Configure{@/BODY}{\ifvmode\IgnorePar\fi\EndP\HCode{</article></main>}}
\Css{nav.TOC > span{display:block;}}
\def\:declaresectionnumberlink#1{%
% these configurations are inspired by this post: https://tex.stackexchange.com/a/523739/2891
More information about the tex-live-commits
mailing list.