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.
|
0
|
45 \Configure{@HEAD}{}
|
|
46 \Configure{@HEAD}{\HCode{<meta http-equiv="content-type" content="text/html; charset=utf-8"/>\Hnewline}}
|
|
47 \Configure{@HEAD}{\HCode{<meta name="resource-type" content="document"/>\Hnewline}}
|
|
48 \Configure{@HEAD}{\HCode{<meta name="keywords" content="C, function, dynamic, call, calling, convention, VM, abstraction, closure"/>\Hnewline}}
|
|
49 \Configure{@HEAD}{\HCode{<meta name="distribution" content="global"/>\Hnewline}}
|
|
50 \Configure{@HEAD}{\HCode{<link rel="stylesheet" id="dyn-fonts-css" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&subset=latin,latin-ext" type="text/css" media="all"/>\Hnewline}}
|
|
51 % should this really rely on online content (dyncall's .css) even for an offline build? @@@
|
|
52 \Configure{@HEAD}{\HCode{<link rel="stylesheet" href="http://dyncall.org/data/main.css" type="text/css" media="all"/>\Hnewline}}
|
69
|
53
|
76
|
54 % Image path prefix can be set here...
|
|
55 %\Configure{IMG}
|
|
56 %{\ht:special{t4ht=<img src="}}
|
|
57 %{\ht:special{t4ht=" alt="}}
|
|
58 %{" }
|
|
59 %{\ht:special{t4ht=" }}
|
|
60 %{\ht:special{t4ht=/>}}
|
|
61
|
70
|
62 % Make TOC display as nested "ul"s.
|
|
63 \Configure{tableofcontents} {}{\tocItem{0}}{}{}{}
|
|
64 \ConfigureToc{section} {}{\tocItem{1}{\HCode{<li>}}}{}{}
|
|
65 \ConfigureToc{subsection} {}{\tocItem{2}{\HCode{<li>}}}{}{}
|
|
66 \ConfigureToc{subsubsection} {}{\tocItem{3}{\HCode{<li>}}}{}{}
|
|
67
|
|
68 % Logic to open/close "ul"s correctly.
|
|
69 \newcount\c
|
|
70 \def\tocItem#1{%
|
|
71 \loop
|
|
72 \ifnum \c<#1
|
|
73 \advance\c by 1
|
|
74 \HCode{<ul>}
|
|
75 \else
|
|
76 \ifnum \c>#1
|
|
77 \advance\c by -1
|
|
78 \HCode{</li></ul>}
|
|
79 \fi
|
|
80 \ifnum \c=#1
|
|
81 \ifnum #1>0 \HCode{</li>} \fi
|
|
82 \fi
|
|
83 \fi
|
|
84 \unless\ifnum \c=#1 \repeat
|
|
85 }
|
|
86
|
72
|
87 % Define layout of tables - for some reason tabular* renders fine
|
|
88 % when pic-tabular is *not* used. When it is, it converts tabular
|
|
89 % (without the asterisk) into pictures, but also changes the rendering
|
|
90 % of tabular*, which we then mend with the code below. Not sure if
|
|
91 % this is just a hack around a tex4ht bug, but it nicely lets us
|
|
92 % pick which table should be a picture or not.
|
76
|
93 % This means: use tabular for pictures, tabular* for text output. @@@ might want to abstract this into \htmlpic or so
|
72
|
94 \Configure{tabular}
|
|
95 {\HCode{<table>}}
|
|
96 {\HCode{</table>}}
|
|
97 {\HCode{<tr>}} %{\HCode{<tr class="row-\HRow">}}
|
|
98 {\HCode{</tr>}}
|
|
99 {\HCode{<td \ifnum \HMultispan>1 colspan="\HMultispan"\fi >}}
|
|
100 {\HCode{</td>}}
|
|
101
|
|
102 % @@@ Did not get that below to work, and don't understand it, either.
|
|
103 % @@@ Default output is ok, so we're simply changing class name in
|
|
104 % @@@ instead of this postprocessing. See Makefile.
|
|
105 %% Listings, so that caption below isn't in same block
|
|
106 %\def\listingLineReset{\newcount\lstlineno}
|
|
107 %\def\listingLine{\advance\lstlineno by 1}
|
|
108 %\ConfigureEnv{lstlisting}{\listingLineReset\Tg<div class="ttDiv">}{\Tg</div>}{}{}
|
|
109 %\Configure{listings}{}{}{}{\ifnum \lstlineno>0 \Tg<br> \fi \listingLine}
|
|
110
|
73
|
111 % Make listing/table captions nicer. NOTE: the -0.5em might need to be adapted if the main css changes.@@@
|
72
|
112 \Configure{caption}
|
73
|
113 {\HCode{<div class="caption" style="margin:-0.5em 0;text-align:right;color:\#A0A0A0"><small>}}
|
72
|
114 {\HCode{<span class="id">}}
|
|
115 {\HCode{</span>: <span class="content">}}
|
73
|
116 {\HCode{</span></small></div>}}
|
72
|
117
|
|
118 % All kinds of style setting for fonts, as we don't use the autogenerated
|
|
119 % css file, but dyncall's website one.
|
73
|
120 \Configure{texttt}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
121 \Configure{textrm}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
122 \Configure{textup}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
123 \Configure{textsl}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
124 \Configure{textsf}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
125 \Configure{textsc}{\Tg<span style="background-color:red">}{\Tg</span>}
|
|
126 \Configure{textit}{\Tg<i>}{\Tg</i>}
|
|
127 \Configure{textbf}{\Tg<b>}{\Tg</b>}
|
72
|
128 \Configure{emph}{\Tg<em>}{\Tg</em>}
|
|
129
|
76
|
130 % @@@ list of things that are still open:
|
|
131 % paragraph{xxx} - should probably be forced to always be on newline to reflect pdf
|
72
|
132
|
|
133 %\lstset{ language=C, basicstyle=\ttfamily, numbers=left,
|
|
134 %numberstyle=\tiny, numbersep=10pt, showstringspaces=false}
|
|
135
|
|
136 %http://www.itisnotoverengineering.com/2013/06/syntax-highlighting-with-tex4ht.html
|
|
137
|
|
138 % Simplest possible paragraphs
|
|
139 \Configure{HtmlPar}{\EndP\Tg<p >}{\EndP\Tg<p>}{\HCode{</p>\Hnewline}}{\HCode{</p>\Hnewline}}
|
|
140
|
|
141
|
|
142
|
70
|
143 % On site navigation texts
|
|
144 \Configure{crosslinks}%
|
|
145 {}%left delimiter
|
|
146 {}%right delimiter
|
|
147 {next}%
|
|
148 {previous}%
|
|
149 {}%previous-tail
|
|
150 {}%front
|
|
151 {}%tail
|
|
152 {index}%up
|
|
153
|
|
154 % Which nav links to show
|
|
155 \Configure{crosslinks*}%
|
|
156 {prev}%
|
|
157 {up}%
|
|
158 {next}%
|
|
159 {}%
|
|
160
|
|
161 % What's around top and bottom links section
|
|
162 \Configure{crosslinks+}%
|
|
163 {\HCode{<div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
|
|
164 {\HCode{</div></div><hr>}}%
|
|
165 {\HCode{<hr><div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
|
|
166 {\HCode{</div></div>}}%
|
|
167
|
|
168 % Hacky - output div stuff before specific crosslinks, has to play together with crosslinks+, above
|
|
169 \Configure{crosslinks:next}{\HCode{</div><div style="width:30\%;display:inline-block;text-align:right">}}
|
|
170 \Configure{crosslinks:up} {\HCode{</div><div style="width:40\%;display:inline-block;text-align:center">}}
|
|
171
|
|
172
|
69
|
173 %\ConfigureEnv{titlepage}
|
|
174 %{\ifvmode \IgnorePar\fi
|
|
175 % \EndP
|
|
176 % \HCode{<h1>}\IgnorePar }
|
|
177 %{\ifvmode \IgnorePar\fi
|
|
178 % \EndP \HCode{</h1>}}
|
|
179 %{}
|
|
180 %{}
|
|
181 %\ConfigureList{enumerate}
|
|
182 %{\HCode{<div>}}
|
|
183 %{\HCode{</div>}}
|
|
184 %{\HCode{<span class="mark">}}
|
|
185 %{\HCode{</span>} }
|
|
186
|
|
187 % Configure element translations.
|
|
188
|
|
189 % Sections (to include number, use \thesection)
|
70
|
190 \Configure{section} {} {} {\HCode{<h1>}} {\HCode{</h1>}}
|
|
191 \Configure{likesection} {} {} {\HCode{<h1>}} {\HCode{</h1>}}
|
|
192 \Configure{subsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}}
|
|
193 \Configure{likesubsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}}
|
|
194 \Configure{subsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}}
|
|
195 \Configure{likesubsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}}
|
0
|
196
|
|
197 %\DeclareMathSizes{12}{11}{7}{6}
|
69
|
198 %\DeclareMathSizes{10}{9}{5}{4}
|
0
|
199 %\DeclareMathSizes{11}{10}{6}{5}
|
|
200
|
69
|
201
|
70
|
202 \begin{document}
|
|
203
|
|
204 % Add here stuff that should be *in* <head>...</head>, however only for main generated page.
|
0
|
205
|
|
206 \EndPreamble
|
70
|
207
|
|
208 % vim: ft=tex
|
|
209
|