Mercurial > pub > dyncall > dyncall
annotate doc/manual/manual_tex4ht.cfg @ 624:d28b09fa2ff9
cleanup: removal of actually unnecessary require lines
author | Tassilo Philipp |
---|---|
date | Fri, 28 Oct 2022 12:22:12 +0200 |
parents | d60728b1f4a1 |
children |
rev | line source |
---|---|
70 | 1 %////////////////////////////////////////////////////////////////////////////// |
2 % | |
3 % Copyright (c) 2015-2016 Tassilo Philipp <tphilipp@potion-studios.com> | |
4 % | |
5 % Permission to use, copy, modify, and distribute this software for any | |
6 % purpose with or without fee is hereby granted, provided that the above | |
7 % copyright notice and this permission notice appear in all copies. | |
8 % | |
9 % THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
10 % WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
11 % MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
12 % ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
13 % WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
14 % ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
15 % OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
16 % | |
17 %////////////////////////////////////////////////////////////////////////////// | |
18 | |
69 | 19 % Set html output type and how the pages will be organized; index=a,b,c means a |
20 % column index, b depth partitioning per page, and if c is present and 'next', | |
21 % that next-links recurses. | |
22 % Use b=1 for outputting one big html page. b=2 would partition by sections, b=3 | |
23 % by sections and subsections, and so on... | |
72 | 24 \Preamble{html,info,index=2,1,pic-tabular,pic-align,charset="utf-8",p-width} |
69 | 25 % For manual partitioning we use b=1 above, then \CutAt |
26 %\CutAt{subsubsection,subsection,likesubsection,section,likesection,part} | |
27 \CutAt{section} | |
28 | |
29 %% Don't want TOC to be on own page. | |
30 %\ConfigureToc{likesubsubsection}{}{~}{}{ } | |
31 | |
32 % Here goes stuff that should be *before* <head>...</head> | |
33 % Use it for configurations, no actual output. | |
34 | |
35 \Configure{VERSION}{} | |
36 \Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}} | |
0 | 37 \Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}} |
71 | 38 \Configure{BODY}{\HCode{\Hnewline<body>\Hnewline<div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}} % KEEP the body on it's own line, as it's used as a marker for postprocessing. |
69 | 39 |
70 | 40 % TITLE+ is only on main page, other use section title. Prefix everything, though. |
41 \Configure{TITLE}{\HCode{<title>}dyncall Manual - }{\HCode{</title>}} | |
42 \Configure{TITLE+}{Index} | |
43 | |
69 | 44 % Clear default header, define our custom one. Using @HEAD will make this be used on all pages generated. |
92 | 45 % @@@Ideally, this wouldn't be a copy&paste of the website's header, here. Such |
46 % thing should be done in the website build, and this here a generic header | |
47 % (however, style is kinda needed). | |
0 | 48 \Configure{@HEAD}{} |
49 \Configure{@HEAD}{\HCode{<meta http-equiv="content-type" content="text/html; charset=utf-8"/>\Hnewline}} | |
50 \Configure{@HEAD}{\HCode{<meta name="resource-type" content="document"/>\Hnewline}} | |
51 \Configure{@HEAD}{\HCode{<meta name="keywords" content="C, function, dynamic, call, calling, convention, VM, abstraction, closure"/>\Hnewline}} | |
52 \Configure{@HEAD}{\HCode{<meta name="distribution" content="global"/>\Hnewline}} | |
344
d60728b1f4a1
- tweaked html doc generation again so that it'll pick up dyncall.org's css file correctly (all in all not clean, see comment in source)
Tassilo Philipp
parents:
343
diff
changeset
|
53 % should this really rely on online content (dyncall's .css) even for an offline build? @@@ also, we need a relative path here, so this complicates things further |
d60728b1f4a1
- tweaked html doc generation again so that it'll pick up dyncall.org's css file correctly (all in all not clean, see comment in source)
Tassilo Philipp
parents:
343
diff
changeset
|
54 \Configure{@HEAD}{\HCode{<link rel="stylesheet" href="/data/main.css" type="text/css" media="all"/>\Hnewline}} |
69 | 55 |
76 | 56 % Image path prefix can be set here... |
57 %\Configure{IMG} | |
58 %{\ht:special{t4ht=<img src="}} | |
59 %{\ht:special{t4ht=" alt="}} | |
60 %{" } | |
61 %{\ht:special{t4ht=" }} | |
62 %{\ht:special{t4ht=/>}} | |
63 | |
70 | 64 % Make TOC display as nested "ul"s. |
65 \Configure{tableofcontents} {}{\tocItem{0}}{}{}{} | |
66 \ConfigureToc{section} {}{\tocItem{1}{\HCode{<li>}}}{}{} | |
67 \ConfigureToc{subsection} {}{\tocItem{2}{\HCode{<li>}}}{}{} | |
68 \ConfigureToc{subsubsection} {}{\tocItem{3}{\HCode{<li>}}}{}{} | |
69 | |
70 % Logic to open/close "ul"s correctly. | |
71 \newcount\c | |
72 \def\tocItem#1{% | |
73 \loop | |
74 \ifnum \c<#1 | |
75 \advance\c by 1 | |
76 \HCode{<ul>} | |
77 \else | |
78 \ifnum \c>#1 | |
79 \advance\c by -1 | |
80 \HCode{</li></ul>} | |
81 \fi | |
82 \ifnum \c=#1 | |
83 \ifnum #1>0 \HCode{</li>} \fi | |
84 \fi | |
85 \fi | |
86 \unless\ifnum \c=#1 \repeat | |
87 } | |
88 | |
72 | 89 % Define layout of tables - for some reason tabular* renders fine |
90 % when pic-tabular is *not* used. When it is, it converts tabular | |
91 % (without the asterisk) into pictures, but also changes the rendering | |
92 % of tabular*, which we then mend with the code below. Not sure if | |
93 % this is just a hack around a tex4ht bug, but it nicely lets us | |
94 % pick which table should be a picture or not. | |
76 | 95 % This means: use tabular for pictures, tabular* for text output. @@@ might want to abstract this into \htmlpic or so |
72 | 96 \Configure{tabular} |
97 {\HCode{<table>}} | |
98 {\HCode{</table>}} | |
99 {\HCode{<tr>}} %{\HCode{<tr class="row-\HRow">}} | |
100 {\HCode{</tr>}} | |
101 {\HCode{<td \ifnum \HMultispan>1 colspan="\HMultispan"\fi >}} | |
102 {\HCode{</td>}} | |
103 | |
90 | 104 % Remove hr-tags that tex4ht inserts by default in around floats (e.g. tables) and replace them with a background. |
105 % Also remove hr-tags around figures, entirely. | |
92 | 106 \Configure{float}[]{\HCode{<div class='blockDiv'>}\HtmlParOff}{}{\HCode{</div>}\HtmlParOn} |
90 | 107 \ConfigureEnv{figure}{\HCode{}}{\HCode{}}{}{} |
108 | |
72 | 109 % @@@ Did not get that below to work, and don't understand it, either. |
110 % @@@ Default output is ok, so we're simply changing class name in | |
111 % @@@ instead of this postprocessing. See Makefile. | |
112 %% Listings, so that caption below isn't in same block | |
113 %\def\listingLineReset{\newcount\lstlineno} | |
114 %\def\listingLine{\advance\lstlineno by 1} | |
115 %\ConfigureEnv{lstlisting}{\listingLineReset\Tg<div class="ttDiv">}{\Tg</div>}{}{} | |
116 %\Configure{listings}{}{}{}{\ifnum \lstlineno>0 \Tg<br> \fi \listingLine} | |
117 | |
91 | 118 % Make listing/table captions nicer. |
72 | 119 \Configure{caption} |
91 | 120 {\HCode{<div class="blockCaption"><small>}} |
72 | 121 {\HCode{<span class="id">}} |
122 {\HCode{</span>: <span class="content">}} | |
73 | 123 {\HCode{</span></small></div>}} |
72 | 124 |
125 % All kinds of style setting for fonts, as we don't use the autogenerated | |
126 % css file, but dyncall's website one. | |
73 | 127 \Configure{texttt}{\Tg<span style="background-color:red">}{\Tg</span>} |
128 \Configure{textrm}{\Tg<span style="background-color:red">}{\Tg</span>} | |
129 \Configure{textup}{\Tg<span style="background-color:red">}{\Tg</span>} | |
130 \Configure{textsl}{\Tg<span style="background-color:red">}{\Tg</span>} | |
131 \Configure{textsf}{\Tg<span style="background-color:red">}{\Tg</span>} | |
132 \Configure{textsc}{\Tg<span style="background-color:red">}{\Tg</span>} | |
133 \Configure{textit}{\Tg<i>}{\Tg</i>} | |
134 \Configure{textbf}{\Tg<b>}{\Tg</b>} | |
72 | 135 \Configure{emph}{\Tg<em>}{\Tg</em>} |
136 | |
76 | 137 % @@@ list of things that are still open: |
138 % paragraph{xxx} - should probably be forced to always be on newline to reflect pdf | |
72 | 139 |
140 %\lstset{ language=C, basicstyle=\ttfamily, numbers=left, | |
141 %numberstyle=\tiny, numbersep=10pt, showstringspaces=false} | |
142 | |
143 %http://www.itisnotoverengineering.com/2013/06/syntax-highlighting-with-tex4ht.html | |
144 | |
91 | 145 % Simplest possible paragraphs. |
146 % Note, we don't use the optional </p> end tags, as we would end up wrapping block level | |
147 % elements like <table> in <p>...</p> pairs. | |
148 \Configure{HtmlPar}{\EndP\Tg<p>}{\EndP\Tg<p>}{\HCode{\Hnewline}}{\HCode{\Hnewline}} | |
72 | 149 |
150 | |
70 | 151 % On site navigation texts |
152 \Configure{crosslinks}% | |
153 {}%left delimiter | |
154 {}%right delimiter | |
155 {next}% | |
156 {previous}% | |
157 {}%previous-tail | |
158 {}%front | |
159 {}%tail | |
160 {index}%up | |
161 | |
162 % Which nav links to show | |
163 \Configure{crosslinks*}% | |
164 {prev}% | |
165 {up}% | |
166 {next}% | |
167 {}% | |
168 | |
169 % What's around top and bottom links section | |
170 \Configure{crosslinks+}% | |
171 {\HCode{<div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}% | |
172 {\HCode{</div></div><hr>}}% | |
173 {\HCode{<hr><div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}% | |
174 {\HCode{</div></div>}}% | |
175 | |
176 % Hacky - output div stuff before specific crosslinks, has to play together with crosslinks+, above | |
177 \Configure{crosslinks:next}{\HCode{</div><div style="width:30\%;display:inline-block;text-align:right">}} | |
178 \Configure{crosslinks:up} {\HCode{</div><div style="width:40\%;display:inline-block;text-align:center">}} | |
179 | |
180 | |
69 | 181 %\ConfigureEnv{titlepage} |
182 %{\ifvmode \IgnorePar\fi | |
183 % \EndP | |
184 % \HCode{<h1>}\IgnorePar } | |
185 %{\ifvmode \IgnorePar\fi | |
186 % \EndP \HCode{</h1>}} | |
187 %{} | |
188 %{} | |
189 %\ConfigureList{enumerate} | |
190 %{\HCode{<div>}} | |
191 %{\HCode{</div>}} | |
192 %{\HCode{<span class="mark">}} | |
193 %{\HCode{</span>} } | |
194 | |
195 % Configure element translations. | |
196 | |
197 % Sections (to include number, use \thesection) | |
70 | 198 \Configure{section} {} {} {\HCode{<h1>}} {\HCode{</h1>}} |
199 \Configure{likesection} {} {} {\HCode{<h1>}} {\HCode{</h1>}} | |
200 \Configure{subsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}} | |
201 \Configure{likesubsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}} | |
202 \Configure{subsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}} | |
203 \Configure{likesubsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}} | |
0 | 204 |
205 %\DeclareMathSizes{12}{11}{7}{6} | |
69 | 206 %\DeclareMathSizes{10}{9}{5}{4} |
0 | 207 %\DeclareMathSizes{11}{10}{6}{5} |
208 | |
69 | 209 |
70 | 210 \begin{document} |
211 | |
212 % Add here stuff that should be *in* <head>...</head>, however only for main generated page. | |
0 | 213 |
214 \EndPreamble | |
70 | 215 |
216 % vim: ft=tex | |
217 |