Commit 2f99a64a authored by Benoit Rat's avatar Benoit Rat

doc: improve pandoc template to generate better sh output

parent b323a623
......@@ -44,13 +44,13 @@ DIR_%:
mkdir -p $(subst DIR_,,$@)
pdf/%.pdf: %.md Makefile $(TEMPLATE) DIR_pdf
pandoc $(OPTIONS) --latex-engine=xelatex --highlight-style=haddock $(TEMPLATEARG) \
pandoc $(OPTIONS) --latex-engine=xelatex --listings --highlight-style=haddock $(TEMPLATEARG) \
-V lang=english -V fontsize=11pt -V documentclass=article -V bg-color=238,245,240 -o $@ $<
%.tex: %.md Makefile $(TEMPLATE)
@echo "$(dir $@) $< $^ $(TEX)"
pandoc $(OPTIONS) --highlight-style=haddock $(TEMPLATEARG) \
-V lang=english -V fontsize=11pt -V documentclass=article -o $@ $<
pandoc $(OPTIONS) --listings --highlight-style=haddock $(TEMPLATEARG) \
-V lang=english -V fontsize=11pt -V documentclass=article -V bg-color=238,245,240 -o $@ $<
.PHONY: clean
......
......@@ -68,12 +68,48 @@ $endif$
%% Environment for code formatting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Define the background (shade) color
\usepackage{color}
\definecolor{shadecolor}{RGB}{$bg-color$}
\definecolor{darkgreen}{RGB}{0,125,0}
\definecolor{darkred}{RGB}{170,0,0}
\definecolor{turquoise}{RGB}{20,100,100}
$if(listings)$
\usepackage{listings}
\usepackage{fancyvrb, listings, color}
\lstset{%
basicstyle=\small\ttfamily,
breaklines=true,
fancyvrb=true,
tabsize=2,
columns=fullflexible,
keywordstyle=\color{blue}\textbf,
identifierstyle=,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{red},
backgroundcolor=\color{shadecolor},
}
\lstdefinelanguage{sh}
{
sensitive=true,
keywords={sudo},
alsoletter={\#,:,>},%
emph={>:\# ,>:$$},
moreemph={wrc\# ,wrc1\# ,wrc2\# , >spusa:\# ,>tornado:\# },
emphstyle=\color{darkred},
comment=[l]{\#\#},%
morestring=[s]{\{}{\}},
keywordstyle=\color{blue}\textbf,
commentstyle=\color{darkgreen}\textit,
stringstyle=\color{turquoise},
backgroundcolor=\color{shadecolor},
}
$endif$
$if(lhs)$
\lstnewenvironment{code}
{\lstset{language=Haskell,basicstyle=\small\ttfamily}}
{}
{}
$endif$
......@@ -111,9 +147,7 @@ $if(highlighting-macros)$
}
$endif$
%% Define the background (shade) color
\usepackage{color}
\definecolor{shadecolor}{RGB}{$bg-color$}
$else$
$if(highlighting-macros)$
......@@ -243,7 +277,7 @@ $endif$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes
% allows verbatim text in footnotes
$endif$
......
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