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...
|
|
24 \Preamble{html,info,index=2,1,next,pic-tabular,charset="utf-8",p-width,pic-align}
|
|
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>}}
|
69
|
38 \Configure{BODY}{\HCode{<body><div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}}
|
|
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
|
70
|
54 % Make TOC display as nested "ul"s.
|
|
55 \Configure{tableofcontents} {}{\tocItem{0}}{}{}{}
|
|
56 \ConfigureToc{section} {}{\tocItem{1}{\HCode{<li>}}}{}{}
|
|
57 \ConfigureToc{subsection} {}{\tocItem{2}{\HCode{<li>}}}{}{}
|
|
58 \ConfigureToc{subsubsection} {}{\tocItem{3}{\HCode{<li>}}}{}{}
|
|
59
|
|
60 % Logic to open/close "ul"s correctly.
|
|
61 \newcount\c
|
|
62 \def\tocItem#1{%
|
|
63 \loop
|
|
64 \ifnum \c<#1
|
|
65 \advance\c by 1
|
|
66 \HCode{<ul>}
|
|
67 \else
|
|
68 \ifnum \c>#1
|
|
69 \advance\c by -1
|
|
70 \HCode{</li></ul>}
|
|
71 \fi
|
|
72 \ifnum \c=#1
|
|
73 \ifnum #1>0 \HCode{</li>} \fi
|
|
74 \fi
|
|
75 \fi
|
|
76 \unless\ifnum \c=#1 \repeat
|
|
77 }
|
|
78
|
|
79 % On site navigation texts
|
|
80 \Configure{crosslinks}%
|
|
81 {}%left delimiter
|
|
82 {}%right delimiter
|
|
83 {next}%
|
|
84 {previous}%
|
|
85 {}%previous-tail
|
|
86 {}%front
|
|
87 {}%tail
|
|
88 {index}%up
|
|
89
|
|
90 % Which nav links to show
|
|
91 \Configure{crosslinks*}%
|
|
92 {prev}%
|
|
93 {up}%
|
|
94 {next}%
|
|
95 {}%
|
|
96
|
|
97 % What's around top and bottom links section
|
|
98 \Configure{crosslinks+}%
|
|
99 {\HCode{<div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
|
|
100 {\HCode{</div></div><hr>}}%
|
|
101 {\HCode{<hr><div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}%
|
|
102 {\HCode{</div></div>}}%
|
|
103
|
|
104 % Hacky - output div stuff before specific crosslinks, has to play together with crosslinks+, above
|
|
105 \Configure{crosslinks:next}{\HCode{</div><div style="width:30\%;display:inline-block;text-align:right">}}
|
|
106 \Configure{crosslinks:up} {\HCode{</div><div style="width:40\%;display:inline-block;text-align:center">}}
|
|
107
|
|
108
|
69
|
109 %\ConfigureEnv{titlepage}
|
|
110 %{\ifvmode \IgnorePar\fi
|
|
111 % \EndP
|
|
112 % \HCode{<h1>}\IgnorePar }
|
|
113 %{\ifvmode \IgnorePar\fi
|
|
114 % \EndP \HCode{</h1>}}
|
|
115 %{}
|
|
116 %{}
|
|
117 %\ConfigureList{enumerate}
|
|
118 %{\HCode{<div>}}
|
|
119 %{\HCode{</div>}}
|
|
120 %{\HCode{<span class="mark">}}
|
|
121 %{\HCode{</span>} }
|
|
122
|
|
123 % Configure element translations.
|
|
124
|
|
125 % Sections (to include number, use \thesection)
|
70
|
126 \Configure{section} {} {} {\HCode{<h1>}} {\HCode{</h1>}}
|
|
127 \Configure{likesection} {} {} {\HCode{<h1>}} {\HCode{</h1>}}
|
|
128 \Configure{subsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}}
|
|
129 \Configure{likesubsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}}
|
|
130 \Configure{subsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}}
|
|
131 \Configure{likesubsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}}
|
0
|
132
|
|
133 %\DeclareMathSizes{12}{11}{7}{6}
|
69
|
134 %\DeclareMathSizes{10}{9}{5}{4}
|
0
|
135 %\DeclareMathSizes{11}{10}{6}{5}
|
|
136
|
69
|
137
|
70
|
138 \begin{document}
|
|
139
|
|
140 % Add here stuff that should be *in* <head>...</head>, however only for main generated page.
|
0
|
141
|
|
142 \EndPreamble
|
70
|
143
|
|
144 % vim: ft=tex
|
|
145
|