view doc/manual/manual_tex4ht.cfg @ 71:edc2afc17aa0

- more html doc work
author cslag
date Mon, 07 Mar 2016 01:45:36 +0100
parents 33c333ec5ad2
children 2b89d8497aad
line wrap: on
line source

%//////////////////////////////////////////////////////////////////////////////
%
% 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.
% Use b=1 for outputting one big html page. b=2 would partition by sections, b=3
% by sections and subsections, and so on...
\Preamble{html,info,index=2,1,next,pic-tabular,charset="utf-8",p-width,pic-align}
% For manual partitioning we use b=1 above, then \CutAt
%\CutAt{subsubsection,subsection,likesubsection,section,likesection,part}
\CutAt{section}

%% Don't want TOC to be on own page.
%\ConfigureToc{likesubsubsection}{}{~}{}{ }

% Here goes stuff that should be *before* <head>...</head>
% Use it for configurations, no actual output.

\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\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.

% 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}}
\Configure{@HEAD}{\HCode{<meta name="resource-type" content="document"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="keywords"      content="C, function, dynamic, call, calling, convention, VM, abstraction, closure"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="distribution"  content="global"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<link rel="stylesheet" id="dyn-fonts-css" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&amp;subset=latin,latin-ext" type="text/css" media="all"/>\Hnewline}}
% 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
%  \HCode{<h1>}\IgnorePar }
%{\ifvmode \IgnorePar\fi
%  \EndP \HCode{</h1>}}
%{}
%{}
%\ConfigureList{enumerate}
%{\HCode{<div>}}
%{\HCode{</div>}}
%{\HCode{<span class="mark">}}
%{\HCode{</span>} }

% Configure element translations.

% Sections (to include number, use \thesection)
\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}

% Add here stuff that should be *in* <head>...</head>, however only for main generated page.

\EndPreamble

% vim: ft=tex