Skip to content

Commit

Permalink
Added fancy pdf generation from t2t docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed May 15, 2011
1 parent 27e3a8f commit 03a2fe7
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -30,3 +30,7 @@ ms-windows/untgz/
scripts/astyle.exe
# vim temporary files
.*.swp
*.aux
*.out
*.tex
*.toc
8 changes: 8 additions & 0 deletions cmake/Txt2Tags.cmake
Expand Up @@ -46,6 +46,14 @@ MACRO(ADD_TXT2TAGS_FILES _sources)
COMMENT "Building ${_out}.html from ${_in}"
)

ADD_CUSTOM_COMMAND(
OUTPUT ${_out}.tex
COMMAND ${TXT2TAGS_EXECUTABLE}
ARGS -o${_out}.tex -t tex ${_in}
DEPENDS ${_in}
COMMENT "Building ${_out}.tex from ${_in}"
)

SET(${_sources} ${${_sources}} ${_out} ${_out}.html)
ENDFOREACH (_current_FILE)
ENDMACRO(ADD_TXT2TAGS_FILES)
35 changes: 31 additions & 4 deletions doc/CODING.t2t
Expand Up @@ -12,11 +12,37 @@ Developers guide for QGIS
%! PostProc(txt): '(?i)(\t)' ' '
%! encoding: iso-8859-1

%
% Tex processing
%
% Make sure this is first
%! PostProc(tex): '\\includegraphics' '\\includegraphics[width=100mm]'
% scartcl is from the koma script document class (apt-get install texlive-latex-recommended ttf-komatuna)
% setlength parindent suppresses first line of paragraph idents
% parskip puts blank space between paragraphs
% title pic stuff used to put a logo on the front page
%! PostProc(tex): '\\documentclass{article}' '\\documentclass{scrartcl}\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{2ex}'
% use the color table and table packages so we can pimp the tables a little
%! PostProc(tex): '\\usepackage{style.css} % user defined' '\\usepackage{fancyvrb}\n\\usepackage{colortbl} \n\\usepackage [table]{xcolor}\n\\definecolor{tableShade}{HTML}{cecece}\n\\definecolor{qgis-green}{HTML}{0E7300}\n\\usepackage{wallpaper}\n\\LRCornerWallPaper{1}{WALLPAPER-IMAGE}\n\\usepackage{hyperref}\n\\hypersetup{linkcolor=qgis-green,urlcolor=qgis-green}\\renewcommand\\thesection{\\color{qgis-green}\\thechapter\\arabic{section}}'
% Make the header row of tables have a dark background. light text
%! PostProc(tex): '\\hline \\textbf' '\\hline \\rowcolor[rgb]{0,0,0} \\color{white} \\textbf'
%! PostProc(tex): '& \\textbf' '& \\color{white} \\textbf'
% Make verbatim text a little smaller and use fancyvrb package to draw it in a box
% Note Verbatim with capital V for fancyvrb to work
%! PostProc(tex): '\\begin{verbatim}' '{\\scriptsize\\begin{Verbatim}[frame=single,rulecolor=\\color{qgis-green}, framesep=4mm, label=\\fbox{\\small\\emph{Listing}}]'
%! PostProc(tex): '\\end{verbatim}' '\\end{Verbatim}\n}'
%! PostProc(tex): '\\section' '\\newpage\\section'
%! PostProc(tex): 'section{' 'section{\\color{qgis-green}'
%! PostProc(tex): NEWPAGE '\\newpage'
% Give alternating table rows different colours and use a smaller font in tables (\tiny)
%! PostProc(tex): '\\begin{tabular}' '\\rowcolors{2}{tableShade}{white} \n\\tiny\\begin{tabular}'
%! encoding: iso-8859-1

%! PostProc(tex): WALLPAPER-IMAGE 'qgis-footer.png'
% These are comments and will not be generated in any output
% -------------------

%This document is in text2tags format. You can generate html, plain text and
%This document is in txt2tags format. You can generate html, plain text and
%moinmoin formatted documentation by running txt2tags on this document. See the
%txt2tags home page for more details. Please insert manual line breaks in this
%document as it makes diffing for changes much easier. To do this in vim
Expand All @@ -26,12 +52,13 @@ Developers guide for QGIS

% To generate the text version of this document:
% txt2tags -t txt -o CODING CODING.t2t
% To generate the moinmoin version of this document:
% txt2tags -t moin -o CODING.moin CODING.t2t
% To generate the mediawiki version of this document:
% txt2tags -t wiki --no-enum-title -o CODING.wiki CODING.t2t
% To generate the html version of this document:
% txt2tags -t html -o CODING.html CODING.t2t
% To generate the LaTeX version of this document:
% txt2tags -t tex -o CODING.tex CODING.t2t
% txt2tags -t tex -o CODING.tex CODING.t2t; pdflatex CODING.tex

%
% End of comments
% -------------------
Expand Down
36 changes: 31 additions & 5 deletions doc/INSTALL.t2t
@@ -1,7 +1,6 @@
Quantum GIS (QGIS)

Building QGIS from source - step by step

%%date(%A %B %d, %Y)

%! target : html
%! style : style.css
Expand All @@ -12,6 +11,33 @@ Building QGIS from source - step by step
% Next line will replace tabs with 2 spaces in txt generated outputs
%! PostProc(txt): '(?i)(\t)' ' '
%! encoding: iso-8859-1
%
% Tex processing
%
% Make sure this is first
%! PostProc(tex): '\\includegraphics' '\\includegraphics[width=100mm]'
% scartcl is from the koma script document class (apt-get install texlive-latex-recommended ttf-komatuna)
% setlength parindent suppresses first line of paragraph idents
% parskip puts blank space between paragraphs
% title pic stuff used to put a logo on the front page
%! PostProc(tex): '\\documentclass{article}' '\\documentclass{scrartcl}\n\\setlength{\\parindent}{0pt}\n\\setlength{\\parskip}{2ex}'
% use the color table and table packages so we can pimp the tables a little
%! PostProc(tex): '\\usepackage{style.css} % user defined' '\\usepackage{fancyvrb}\n\\usepackage{colortbl} \n\\usepackage [table]{xcolor}\n\\definecolor{tableShade}{HTML}{cecece}\n\\definecolor{qgis-green}{HTML}{0E7300}\n\\usepackage{wallpaper}\n\\LRCornerWallPaper{1}{WALLPAPER-IMAGE}\n\\usepackage{hyperref}\n\\hypersetup{linkcolor=qgis-green,urlcolor=qgis-green}\\renewcommand\\thesection{\\color{qgis-green}\\thechapter\\arabic{section}}'
% Make the header row of tables have a dark background. light text
%! PostProc(tex): '\\hline \\textbf' '\\hline \\rowcolor[rgb]{0,0,0} \\color{white} \\textbf'
%! PostProc(tex): '& \\textbf' '& \\color{white} \\textbf'
% Make verbatim text a little smaller and use fancyvrb package to draw it in a box
% Note Verbatim with capital V for fancyvrb to work
%! PostProc(tex): '\\begin{verbatim}' '{\\scriptsize\\begin{Verbatim}[frame=single,rulecolor=\\color{qgis-green}, framesep=4mm, label=\\fbox{\\small\\emph{Listing}}]'
%! PostProc(tex): '\\end{verbatim}' '\\end{Verbatim}\n}'
%! PostProc(tex): '\\section' '\\newpage\\section'
%! PostProc(tex): 'section{' 'section{\\color{qgis-green}'
%! PostProc(tex): NEWPAGE '\\newpage'
% Give alternating table rows different colours and use a smaller font in tables (\tiny)
%! PostProc(tex): '\\begin{tabular}' '\\rowcolors{2}{tableShade}{white} \n\\tiny\\begin{tabular}'
%! encoding: iso-8859-1

%! PostProc(tex): WALLPAPER-IMAGE 'qgis-footer.png'
% These are comments and will not be generated in any output
% -------------------

Expand All @@ -30,13 +56,13 @@ Building QGIS from source - step by step
% To generate the html version of this document:
% txt2tags -t html -o INSTALL.html INSTALL.t2t
% To generate the LaTeX version of this document:
% txt2tags -t tex -o INSTALL.tex INSTALL.t2t
% txt2tags -t tex -o INSTALL.tex INSTALL.t2t; pdflatex INSTALL.tex

% End of comments
% -------------------

Last update: %%date
Last change: %%mtime
Last Updated: %%date(%A %B %d, %Y)
Last Change : %%mtime(%A %B %d, %Y)

%%toc

Expand Down
3 changes: 3 additions & 0 deletions doc/iauthors.t2t
Expand Up @@ -26,3 +26,6 @@ The following people have contributed to this document:
- GNU/Linux Section
- Tim Sutton 2006
- Debian package section: Juergen Fischer 2008

- Latex Generator
- Tim Sutton 2011
Binary file added doc/qgis-footer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/qgis-footer.xcf
Binary file not shown.

0 comments on commit 03a2fe7

Please sign in to comment.