Mercurial > pub > dyncall > dyncall
diff doc/manual/manual_tex4ht.cfg @ 70:33c333ec5ad2
- progress on html doc generation
author | cslag |
---|---|
date | Sun, 06 Mar 2016 23:30:44 +0100 |
parents | 43675cb378ce |
children | edc2afc17aa0 |
line wrap: on
line diff
--- a/doc/manual/manual_tex4ht.cfg Sun Mar 06 16:28:01 2016 +0100 +++ b/doc/manual/manual_tex4ht.cfg Sun Mar 06 23:30:44 2016 +0100 @@ -1,3 +1,21 @@ +%////////////////////////////////////////////////////////////////////////////// +% +% Copyright (c) 2015-2016 Tassilo Philipp <tphilipp@potion-studios.com> +% +% Permission to use, copy, modify, and distribute this software for any +% purpose with or without fee is hereby granted, provided that the above +% copyright notice and this permission notice appear in all copies. +% +% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +% WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +% MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +% ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +% WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +% ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +% OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +% +%////////////////////////////////////////////////////////////////////////////// + % Set html output type and how the pages will be organized; index=a,b,c means a % column index, b depth partitioning per page, and if c is present and 'next', % that next-links recurses. @@ -19,6 +37,10 @@ \Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}} \Configure{BODY}{\HCode{<body><div class="mainDiv">\Hnewline}}{\HCode{\Hnewline</div></body>}} +% TITLE+ is only on main page, other use section title. Prefix everything, though. +\Configure{TITLE}{\HCode{<title>}dyncall Manual - }{\HCode{</title>}} +\Configure{TITLE+}{Index} + % Clear default header, define our custom one. Using @HEAD will make this be used on all pages generated. \Configure{@HEAD}{} \Configure{@HEAD}{\HCode{<meta http-equiv="content-type" content="text/html; charset=utf-8"/>\Hnewline}} @@ -29,6 +51,61 @@ % should this really rely on online content (dyncall's .css) even for an offline build? @@@ \Configure{@HEAD}{\HCode{<link rel="stylesheet" href="http://dyncall.org/data/main.css" type="text/css" media="all"/>\Hnewline}} +% Make TOC display as nested "ul"s. +\Configure{tableofcontents} {}{\tocItem{0}}{}{}{} +\ConfigureToc{section} {}{\tocItem{1}{\HCode{<li>}}}{}{} +\ConfigureToc{subsection} {}{\tocItem{2}{\HCode{<li>}}}{}{} +\ConfigureToc{subsubsection} {}{\tocItem{3}{\HCode{<li>}}}{}{} + +% Logic to open/close "ul"s correctly. +\newcount\c +\def\tocItem#1{% + \loop + \ifnum \c<#1 + \advance\c by 1 + \HCode{<ul>} + \else + \ifnum \c>#1 + \advance\c by -1 + \HCode{</li></ul>} + \fi + \ifnum \c=#1 + \ifnum #1>0 \HCode{</li>} \fi + \fi + \fi + \unless\ifnum \c=#1 \repeat +} + +% On site navigation texts +\Configure{crosslinks}% +{}%left delimiter +{}%right delimiter +{next}% +{previous}% +{}%previous-tail +{}%front +{}%tail +{index}%up + +% Which nav links to show +\Configure{crosslinks*}% +{prev}% +{up}% +{next}% +{}% + +% What's around top and bottom links section +\Configure{crosslinks+}% +{\HCode{<div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}% +{\HCode{</div></div><hr>}}% +{\HCode{<hr><div style="width:100\%;text-align:left"><div style="width:30\%;display:inline-block;text-align:left">}}% +{\HCode{</div></div>}}% + +% Hacky - output div stuff before specific crosslinks, has to play together with crosslinks+, above +\Configure{crosslinks:next}{\HCode{</div><div style="width:30\%;display:inline-block;text-align:right">}} +\Configure{crosslinks:up} {\HCode{</div><div style="width:40\%;display:inline-block;text-align:center">}} + + %\ConfigureEnv{titlepage} %{\ifvmode \IgnorePar\fi % \EndP @@ -46,15 +123,23 @@ % Configure element translations. % Sections (to include number, use \thesection) -\Configure{section} {} {} {\HCode{<h1>}} {\HCode{</h1>}} -\Configure{subsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}} -\Configure{subsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}} +\Configure{section} {} {} {\HCode{<h1>}} {\HCode{</h1>}} +\Configure{likesection} {} {} {\HCode{<h1>}} {\HCode{</h1>}} +\Configure{subsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}} +\Configure{likesubsection} {} {} {\HCode{<h2>}} {\HCode{</h2>}} +\Configure{subsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}} +\Configure{likesubsubsection} {} {} {\HCode{<h3>}} {\HCode{</h3>}} %\DeclareMathSizes{12}{11}{7}{6} %\DeclareMathSizes{10}{9}{5}{4} %\DeclareMathSizes{11}{10}{6}{5} -\begin{document} % After this comes stuff that should be *in* <head>...</head>, however only for main generated page. +\begin{document} + +% Add here stuff that should be *in* <head>...</head>, however only for main generated page. \EndPreamble + +% vim: ft=tex +