You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.2 KiB
75 lines
3.2 KiB
\Preamble{xhtml,html5,mathml,2,sec-filename,info,fn-in,fonts}
|
|
|
|
% Logical elements
|
|
\NewLogicalBlock{codesample}
|
|
\SetTag{codesample}{figure}
|
|
\SetBlockProperty{codesample}{role}{doc-example}% set dPub property
|
|
|
|
\NewLogicalBlock{acknowledgements}
|
|
\SetTag{acknowledgements}{section}
|
|
\SetBlockProperty{acknowledgements}{role}{doc-acknowledgements}
|
|
|
|
\NewLogicalBlock{warning}
|
|
\SetTag{warning}{section}
|
|
\SetBlockProperty{warning}{role}{doc-notice}
|
|
|
|
% external stylesheet
|
|
\Configure{AddCss}{style.css}
|
|
|
|
% Declare graphics extensions
|
|
\DeclareGraphicsExtensions{.svg,.png,.jpg}
|
|
|
|
\makeatletter
|
|
\ExplSyntaxOn
|
|
\Configure{Gin-dim}{style="width:\fp_eval:n{round(\Gin@req@width/\textwidth*100,2)}\%"}
|
|
\ExplSyntaxOff
|
|
\makeatother
|
|
|
|
|
|
% Mini TOC
|
|
\Configure{crosslinks+}{%
|
|
\bgroup
|
|
% container for the page toc
|
|
\Configure{tableofcontents}{\IgnorePar\EndP\HCode{<nav class="TOC">}\IgnorePar}
|
|
{\HCode{\Hnewline}}{\IgnorePar\HCode{</nav>\Hnewline}\ShowPar}{}{}%
|
|
\TableOfContents[chapter,section,subsection]% Print table of contents before crosslinks
|
|
\egroup
|
|
\ifvmode\IgnorePar\fi\EndP%
|
|
\HCode{<main class="main-content">\Hnewline<nav class="crosslinks-top">} }
|
|
{\HCode{</nav>\Hnewline}}
|
|
{\ifvmode\IgnorePar\fi\EndP%
|
|
\HCode{<nav class="crosslinks-bottom">}}{\HCode{</nav>}}{}{}
|
|
|
|
% configuration for TOC on the main page
|
|
\Configure{tableofcontents}{\IgnorePar\EndP\HCode{<nav class="TOC">}\IgnorePar}
|
|
{}{\IgnorePar\HCode{</nav>\Hnewline<main class="main-content">\Hnewline}\ShowPar}{}{}%
|
|
|
|
% close the <main> element started in \Configure{crosslinks+}
|
|
\Configure{@/BODY}{\ifvmode\IgnorePar\fi\EndP\HCode{</main>}}
|
|
% Goatcounter counting
|
|
\Configure{@/BODY}{\HCode{<script data-goatcounter="https://kodymirus.goatcounter.com/count" async src="/js/libs/goatcounter.js"></script>\Hnewline }}
|
|
|
|
% show only crosslinks to prev, main and next pages
|
|
\Configure{crosslinks*}{prev}{up}{next}{}
|
|
|
|
|
|
% use normal space instead of non-breaking space
|
|
\Configure{ }{ }
|
|
|
|
\Configure{texttt}{\HCode{<code class="texttt">}\NoFonts}{\EndNoFonts\HCode{</code>}}
|
|
\Configure{verb}{\HCode{<code class="verb">}\NoFonts}{\EndNoFonts\HCode{</code>}}
|
|
\ConfigureEnv{texsource}{\BlockElementStart{codesample}{class="texsource"}\NoFonts\fontencoding{OT1}}{\EndNoFonts\BlockElementEnd{codesample}{}}{}{}
|
|
\ConfigureEnv{shellcommand}{\BlockElementStart{codesample}{class="shellcommand"}\NoFonts\fontencoding{OT1}}{\EndNoFonts\BlockElementEnd{codesample}{}}{}{}
|
|
\ConfigureEnv{htmlsource}{\BlockElementStart{codesample}{class="htmlsource"}\NoFonts\fontencoding{OT1}}{\EndNoFonts\BlockElementEnd{codesample}{}}{}{}
|
|
\ConfigureEnv{luasource}{\BlockElementStart{codesample}{class="luasource"}\NoFonts\fontencoding{OT1}}{\EndNoFonts\BlockElementEnd{codesample}{}}{}{}
|
|
\ConfigureEnv{textsource}{\BlockElementStart{codesample}{class="textsource"}\NoFonts\fontencoding{OT1}}{\EndNoFonts\BlockElementEnd{codesample}{}}{}{}
|
|
|
|
\Configure{htmlinput}{\BlockElementStart{codesample}{class="htmlsource"}}{\BlockElementEnd{codesample}{}}
|
|
\Configure{texinput}{\BlockElementStart{codesample}{class="texsource"}}{\BlockElementEnd{codesample}{}}
|
|
|
|
\ConfigureEnv{acknowledgements}{\BlockElementStart{acknowledgements}{}}{\BlockElementEnd{acknowledgements}{}}{}{}
|
|
\ConfigureEnv{warning}{\BlockElementStart{warning}{}}{\BlockElementEnd{warning}{}}{}{}
|
|
|
|
|
|
\begin{document}
|
|
\EndPreamble
|