update to the latest Haddock style
authorSimon Marlow <marlowsd@gmail.com>
Wed, 30 Jun 2010 13:42:04 +0000 (13:42 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 30 Jun 2010 13:42:04 +0000 (13:42 +0000)
report/Makefile
report/haddock-style.verb [deleted file]
report/haddock.sty [new file with mode: 0644]
report/haskell.verb
report/ht/haddock.sty [moved from report/ht/haddock-style.tex with 51% similarity]
report/ht/haskell.cfg

index 1fb6df7..a2428ab 100644 (file)
@@ -120,7 +120,7 @@ haskell.tex: haskell.verb
 #      cp index.html *.png *.gif haskell-report-html
 
 haskell.dvi: haskell.tex haskell.ind ${PARTS}
-haskell.pdf: haskell.tex haskell.ind haddock-style.tex ${PARTS}
+haskell.pdf: haskell.tex haskell.ind haddock.sty ${PARTS}
 
 haskell.ps : haskell.dvi
        dvips haskell.dvi -o haskell.ps
@@ -150,7 +150,7 @@ ht/classes.eps : classes.eps
        $(CP) $< $@
 
 .PHONY: html
-html: $(HT_TEXS) ht/classes.eps ht/haddock-style.tex
+html: $(HT_TEXS) ht/classes.eps ht/haddock.sty
        cd ht && htlatex haskell.tex "haskell,2"
 
 #########################################
@@ -167,8 +167,7 @@ clean:
                ht/*.4ct ht/*.4tc
        $(RM) *.dvi *.log *.aux *.ilg *.blg *.toc *.bbl *.idx *.tmp *.out \
                ${PARTS} \
-               haskell.tex haskell.ps haskell.pdf *.o lex.yy.c haskell-report-html/* \
-               haddock-style.tex
+               haskell.tex haskell.ps haskell.pdf *.o lex.yy.c haskell-report-html/*
 
 
 #########################################
diff --git a/report/haddock-style.verb b/report/haddock-style.verb
deleted file mode 100644 (file)
index 4ab4b27..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-% Haddock style sheet
-
-\newcommand{\haddockbeginheader}{\hrulefill}
-\newcommand{\haddockendheader}{\hrulefill}
-
-% a little gap before the ``Methods'' header
-\newcommand{\haddockpremethods}{\vspace{2ex}}
-
-% inserted before \\begin{verbatim}
-\newcommand{\haddockverb}{\small}
-
-% an identifier: we add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\indextt{#1}}
-
-% \newcommand{\haddockbeginconstrs}{\vspace{-2ex}\begin{tabular}{llp{4in}}}
-\newcommand{\haddockbeginconstrs}{\begin{tabular}{@@{}llp{4in}}}
-\newcommand{\haddockendconstrs}{\end{tabular}}
-
-\newcommand{\haddockbeginargs}{\begin{tabular}{@@{}llp{4in}}}
-\newcommand{\haddockendargs}{\end{tabular}}
-
-\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
-\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
-
-\makeatletter
-\newenvironment{haddockdesc}
-               {\list{}{\labelwidth\z@@ \itemindent-\leftmargin
-                        \let\makelabel\haddocklabel}}
-               {\endlist}
-\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
-\makeatother
-
-% after a declaration, start a new line for the documentation.
-% Otherwise, the documentation starts right after the declaration,
-% because we're using the list environment and the declaration is the
-% ``label''.  I tried making this newline part of the label, but
-% couldn't get that to work reliably (the space seemed to stretch
-% sometimes).
-\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
diff --git a/report/haddock.sty b/report/haddock.sty
new file mode 100644 (file)
index 0000000..60e8323
--- /dev/null
@@ -0,0 +1,53 @@
+% Modified version of the Haddock style sheet
+
+\usepackage{tabulary} % see below
+
+\newenvironment{haddocktitle}
+  {\begin{center}\bgroup\large\bfseries}
+  {\egroup\end{center}}
+\newenvironment{haddockprologue}{\vspace{1in}}{}
+
+\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
+
+\newcommand{\haddockbeginheader}{\hrulefill}
+\newcommand{\haddockendheader}{\noindent\hrulefill}
+
+% a little gap before the ``Methods'' header
+\newcommand{\haddockpremethods}{\vspace{2ex}}
+
+% inserted before \\begin{verbatim}
+\newcommand{\haddockverb}{\small}
+
+% an identifier: add an index entry
+\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
+
+% The tabulary environment lets us have a column that takes up ``the
+% rest of the space''.  Unfortunately it doesn't allow
+% the \end{tabulary} to be in the expansion of a macro, it must appear
+% literally in the document text, so Haddock inserts
+% the \end{tabulary} itself.
+\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
+\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}}
+
+\newcommand{\haddocktt}[1]{{\small \texttt{#1}}}
+\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}}
+
+\makeatletter
+\newenvironment{haddockdesc}
+               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+                        \let\makelabel\haddocklabel}}
+               {\endlist}
+\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}}
+\makeatother
+
+% after a declaration, start a new line for the documentation.
+% Otherwise, the documentation starts right after the declaration,
+% because we're using the list environment and the declaration is the
+% ``label''.  I tried making this newline part of the label, but
+% couldn't get that to work reliably (the space seemed to stretch
+% sometimes).
+\newcommand{\haddockbegindoc}{\hfill\\[1ex]}
+
+% spacing between paragraphs and no \parindent looks better
+\parskip=10pt plus2pt minus2pt
+\setlength{\parindent}{0cm}
index c2bbeb4..62e52b6 100644 (file)
 \hyphenation{Has-kell}
 
 % Macros for Haddock output
-\input{haddock-style}
+\usepackage{haddock}
 
 \begin{document}
 
similarity index 51%
rename from report/ht/haddock-style.tex
rename to report/ht/haddock.sty
index 71b48b3..46f7419 100644 (file)
@@ -1,4 +1,13 @@
-% Haddock style sheet
+% Modified version of the Haddock style sheet
+
+\usepackage{tabulary} % see below
+
+\newenvironment{haddocktitle}
+  {\begin{center}\bgroup\large\bfseries}
+  {\egroup\end{center}}
+\newenvironment{haddockprologue}{\vspace{1in}}{}
+
+\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}}
 
 \newcommand{\haddockbeginheader}{\begin{quote}}
 \newcommand{\haddockendheader}{\end{quote}}
 % inserted before \\begin{verbatim}
 \newcommand{\haddockverb}{}
 
-% an identifier: we add an index entry
-\newcommand{\haddockid}[1]{\haddocktt{#1}\indextt{#1}}
+% an identifier: add an index entry
+\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}}
 
-% \newcommand{\haddockbeginconstrs}{\vspace{-2ex}\begin{tabular}{llp{4in}}}
-\newcommand{\haddockbeginconstrs}{\begin{tabular}{@{}llp{4in}}}
-\newcommand{\haddockendconstrs}{\end{tabular}}
-
-\newcommand{\haddockbeginargs}{\begin{tabular}{@{}llp{4in}}}
-\newcommand{\haddockendargs}{\end{tabular}}
+% The tabulary environment lets us have a column that takes up ``the
+% rest of the space''.  Unfortunately it doesn't allow
+% the \end{tabulary} to be in the expansion of a macro, it must appear
+% literally in the document text, so Haddock inserts
+% the \end{tabulary} itself.
+\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{llL}}
+\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{llL}}
 
 \newcommand{\haddocktt}[1]{{\texttt{#1}}}
 \newcommand{\haddockdecltt}[1]{{\bfseries \texttt{#1}}}
@@ -37,3 +47,7 @@
 % couldn't get that to work reliably (the space seemed to stretch
 % sometimes).
 \newcommand{\haddockbegindoc}{}
+
+% spacing between paragraphs and no \parindent looks better
+\parskip=10pt plus2pt minus2pt
+\setlength{\parindent}{0cm}
index 093c2d4..ab087f6 100644 (file)
   % }
   % don't center the text in our fboxes
   div.center div.fbox { text-align: left; }
+  %
+  % get rid of borders on tables
+  table[rules] { border-left: 0;
+                 border-right: 0; }
 }
 
 \EndPreamble