Commit a4e3b564 authored by POTTIER Francois's avatar POTTIER Francois

Merge branch 'html-doc' into 'master'

Html rendering of the manual

See merge request !4
parents 0ff08c3c 11d8e582
......@@ -8,3 +8,8 @@
*.fdb_latexmk
*.fls
main.pdf
*.haux
*.htoc
main.image.tex
main[0-9][0-9][0-9].png
main.html
......@@ -2,14 +2,26 @@
export TEXINPUTS=.:
TEXDEPS = $(wildcard *.tex) $(wildcard *.bib) $(wildcard *.sty) $(wildcard *.mly)
all: main.pdf
%.pdf: %.tex $(wildcard *.tex) $(wildcard *.bib) $(wildcard *.sty) $(wildcard *.mly)
%.pdf: %.tex $(DEPS)
pdflatex $*
bibtex $*
pdflatex $*
pdflatex $*
main.html: main.tex $(DEPS) $(wildcard *.hva)
hevea -fix main.tex
@# Hevea interprets 'tabbing' environment in a way
@# that creates spacing errors in the rendered output
@# of "textual version of derivation trees": it
@# asks for (padding:0px;) while the TeX rendering
@# inserts spacing between columns. Change this
@# to {padding:1px;}
sed -i s/cellpadding0/cellpadding1/ main.html
loop:
latexmk -pdf -pvc main
......
% hevea : hevea.sty
% This is a very basic style file for latex document to be processed
% with hevea. It contains definitions of LaTeX environment which are
% processed in a special way by the translator.
% Mostly :
% - latexonly, not processed by hevea, processed by latex.
% - htmlonly , the reverse.
% - rawhtml, to include raw HTML in hevea output.
% - toimage, to send text to the image file.
% The package also provides hevea logos, html related commands (ahref
% etc.), void cutting and image commands.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hevea}[2002/01/11]
\RequirePackage{comment}
\newif\ifhevea\heveafalse
\@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse}
\makeatletter%
\newcommand{\heveasmup}[2]{%
\raise #1\hbox{$\m@th$%
\csname S@\f@size\endcsname
\fontsize\sf@size 0%
\math@fontsfalse\selectfont
#2%
}}%
\DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}%
\DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}%
\DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}}
%%%%%%%%% Hyperlinks hevea style
\newcommand{\ahref}[2]{{#2}}
\newcommand{\ahrefloc}[2]{{#2}}
\newcommand{\aname}[2]{{#2}}
\newcommand{\ahrefurl}[1]{\texttt{#1}}
\newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}}
\newcommand{\mailto}[1]{\texttt{#1}}
\newcommand{\imgsrc}[2][]{}
\newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1}
\AtBeginDocument
{\@ifundefined{url}
{%url package is not loaded
\let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref}
{}}
%% Void cutting instructions
\newcounter{cuttingdepth}
\newcommand{\tocnumber}{}
\newcommand{\notocnumber}{}
\newcommand{\cuttingunit}{}
\newcommand{\cutdef}[2][]{}
\newcommand{\cuthere}[2]{}
\newcommand{\cutend}{}
\newcommand{\htmlhead}[1]{}
\newcommand{\htmlfoot}[1]{}
\newcommand{\htmlprefix}[1]{}
\newenvironment{cutflow}[1]{}{}
\newcommand{\cutname}[1]{}
\newcommand{\toplinks}[3]{}
\newcommand{\setlinkstext}[3]{}
\newcommand{\flushdef}[1]{}
\newcommand{\footnoteflush}[1]{}
%%%% Html only
\excludecomment{rawhtml}
\newcommand{\rawhtmlinput}[1]{}
\excludecomment{htmlonly}
%%%% Latex only
\newenvironment{latexonly}{}{}
\newenvironment{verblatex}{}{}
%%%% Image file stuff
\def\toimage{\endgroup}
\def\endtoimage{\begingroup\def\@currenvir{toimage}}
\def\verbimage{\endgroup}
\def\endverbimage{\begingroup\def\@currenvir{verbimage}}
\newcommand{\imageflush}[1][]{}
%%% Bgcolor definition
\newsavebox{\@bgcolorbin}
\newenvironment{bgcolor}[2][]
{\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup}
{\egroup\end{lrbox}%
\begin{flushleft}%
\colorbox{\@mycolor}{\usebox{\@bgcolorbin}}%
\end{flushleft}}
%%% Style sheets macros, defined as no-ops
\newcommand{\newstyle}[2]{}
\newcommand{\addstyle}[1]{}
\newcommand{\setenvclass}[2]{}
\newcommand{\getenvclass}[1]{}
\newcommand{\loadcssfile}[1]{}
\newenvironment{divstyle}[1]{}{}
\newenvironment{cellstyle}[2]{}{}
\newif\ifexternalcss
%%% Postlude
\makeatother
......@@ -6,8 +6,8 @@
\newcommand{\seplist}[2]{#2#1${}\ldots{}$#1#2}
\newcommand{\sepspacelist}[1]{\seplist{\ }{#1}}
\newcommand{\sepcommalist}[1]{\seplist{,\ }{#1}}
\newcommand{\newprod}{\\\hskip 1cm\barre\hskip2mm}
\newcommand{\phaprod}{\\\hskip 1cm\phantom\barre\hskip2mm}
\newcommand{\newprod}{\\\hspace{1cm}\barre\hspace{2mm}}
\newcommand{\phaprod}{\\\hspace{1cm}\phantom\barre\hspace{2mm}}
% Concrete syntax.
......@@ -45,8 +45,8 @@
\newcommand{\kw}[1]{\text{\upshape\sf\bfseries #1}}
\newcommand{\inlinesidecomment}[1]{\textit{\textbf{\footnotesize // #1}}}
\newcommand{\sidecomment}[1]{\hskip 2cm\inlinesidecomment{#1}}
\newcommand{\docswitch}[1]{\vspace{1mm plus 1mm}#1.\hskip 3mm}
\newcommand{\sidecomment}[1]{\hspace{2cm}\inlinesidecomment{#1}}
\newcommand{\docswitch}[1]{\vspace{1mm plus 1mm}#1.\hspace{3mm}}
\newcommand{\error}{\kw{error}\xspace}
% Links to Menhir's repository.
......
......@@ -17,6 +17,17 @@
\def\@formatyear{\menhirversion}
\makeatother
% Hevea-specific logic; see
% http://hevea.inria.fr/doc/manual007.html
% http://hevea.inria.fr/doc/manual008.html
\usepackage{hevea}
\newenvironment{heveapicture}{
\begin{toimage}
}{
\end{toimage}
\imageflush{}
}
% ------------------------------------------------------------------------------
% Headings.
......@@ -928,7 +939,7 @@ again in \sref{sec:library}.)
\begin{figure}
\begin{center}
\begin{tabular}{r@{\hskip 2mm}c@{\hskip 2mm}l}
\begin{tabular}{r@{\hspace{2mm}}c@{\hspace{2mm}}l}
\nt{actual}\dquestion & is syntactic sugar for & \nt{option}(\nt{actual}) \\
\nt{actual}\dplus & is syntactic sugar for & \nt{nonempty\_list}(\nt{actual}) \\
\nt{actual}\dstar & is syntactic sugar for & \nt{list}(\nt{actual})
......@@ -1317,6 +1328,7 @@ fringe of some partial derivation tree is a \emph{sentential form}.
\begin{figure}
\mycommonbaseline
\begin{center}
\begin{heveapicture}
\begin{tikzpicture}[level distance=12mm]
\node { \nt{expression} }
child { node {\basic{IF}} }
......@@ -1332,6 +1344,7 @@ fringe of some partial derivation tree is a \emph{sentential form}.
}
;
\end{tikzpicture}
\end{heveapicture}
\end{center}
\caption{A partial derivation tree that justifies shifting}
\label{fig:shifting:tree}
......@@ -1374,6 +1387,7 @@ token, it makes sense for it to \emph{shift} that token.
\begin{figure}
\mycommonbaseline
\begin{center}
\begin{heveapicture}
\begin{tikzpicture}[level distance=12mm]
\node { \nt{expression} }
child { node {\basic{IF}} }
......@@ -1389,6 +1403,7 @@ token, it makes sense for it to \emph{shift} that token.
child { node {\nt{expression}} }
;
\end{tikzpicture}
\end{heveapicture}
\end{center}
\caption{A partial derivation tree that justifies reducing}
\label{fig:reducing:tree}
......@@ -1438,6 +1453,7 @@ fringe?
\begin{figure}
\mycommonbaseline
\begin{center}
\begin{heveapicture}
\begin{tikzpicture}[level distance=12mm,level 1/.style={sibling distance=18mm},
level 2/.style={sibling distance=18mm},
level 4/.style={sibling distance=24mm}]]
......@@ -1459,6 +1475,7 @@ fringe?
child { node {\nt{decls}} }
;
\end{tikzpicture}
\end{heveapicture}
\end{center}
\caption{A partial derivation tree that justifies reducing}
\label{fig:xreducing:tree}
......@@ -1695,7 +1712,7 @@ expr -> expr . TIMES expr [ # TIMES PLUS ]
\begin{tabular}{l}
\ldots \\
\dtoken \basic{END} \\
\dstart \kangle{\basic{int}} \nt{main} \hskip 1cm \textit{// instead of \nt{expr}} \\
\dstart \kangle{\basic{int}} \nt{main} \hspace{1cm} \textit{// instead of \nt{expr}} \\
\percentpercent \\
\nt{main}:
\newprod \basic{e} = \nt{expr} \basic{END} \dpaction{\basic{e}} \\
......@@ -1768,7 +1785,7 @@ the author of the lexical analyzer.)
\begin{figure}
\begin{center}
\begin{tabular}{@{}l@{\hskip 7.0mm}l@{}}
\begin{tabular}{@{}l@{\hspace{7.0mm}}l@{}}
\verb+$startpos+ & start position of the first symbol in the production's right-hand side, if there is one; \\&
end position of the most recently parsed symbol, otherwise \\
\verb+$endpos+ & end position of the first symbol in the production's right-hand side, if there is one; \\&
......@@ -1794,7 +1811,7 @@ the author of the lexical analyzer.)
% We could document $endpos($0). Not sure whether that would be a good thing.
\begin{figure}
\begin{tabular}{@{}ll@{\hskip2cm}l}
\begin{tabular}{@{}ll@{\hspace{2cm}}l}
% Positions.
\verb+symbol_start_pos()+ &
\ksymbolstartpos \\
......
\input{mymacros.sty}
\input{article.hva}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{amsmath}
\newcommand{\authorinfo}[3]{\author{\renewcommand\and{ and }#1\\#2\\\texttt{#3}}}
\newcommand{\mathstrut}[1]{#1}
\usepackage{style}
\ No newline at end of file
% Compact layout
\newstyle{body}{
max-width:800px;
width: 85\%;
margin: auto;
font-size: 1rem;
}
\newstyle{pre, .quote}{
margin-left: 2em;
font-size: 1rem;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment