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