From 89f61fdec2e46182e9a9acf9da4c427b489d7495 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 6 Feb 2011 12:19:30 +0100 Subject: [PATCH] Yay. PDF docs for Jinja2 --- Makefile | 4 +- docs/conf.py | 27 ++++++---- docs/contents.rst.inc | 29 ++++++++++ docs/index.rst | 24 +-------- docs/jinjastyle.sty | 119 ++++++++++++++++++++++++++++++++++++++++++ docs/latexindex.rst | 6 +++ docs/logo.pdf | Bin 0 -> 5677 bytes 7 files changed, 173 insertions(+), 36 deletions(-) create mode 100644 docs/contents.rst.inc create mode 100644 docs/jinjastyle.sty create mode 100644 docs/latexindex.rst create mode 100644 docs/logo.pdf diff --git a/Makefile b/Makefile index 29a6b71..5ea5669 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ test: upload-docs: $(MAKE) -C docs html dirhtml latex - #$(MAKE) -C docs/_build/latex all-pdf + $(MAKE) -C docs/_build/latex all-pdf cd docs/_build/; mv html jinja-docs; zip -r jinja-docs.zip jinja-docs; mv jinja-docs html scp -r docs/_build/dirhtml/* pocoo.org:/var/www/jinja.pocoo.org/docs/ - #scp -r docs/_build/latex/Jinja.pdf pocoo.org:/var/www/jinja.pocoo.org/docs/jinja-docs.pdf + scp -r docs/_build/latex/Jinja.pdf pocoo.org:/var/www/jinja.pocoo.org/docs/jinja-docs.pdf scp -r docs/_build/jinja-docs.zip pocoo.org:/var/www/jinja.pocoo.org/docs/ .PHONY: test diff --git a/docs/conf.py b/docs/conf.py index 49f5411..0a5157d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -119,21 +119,26 @@ latex_paper_size = 'a4' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). latex_documents = [ - ('index', 'Jinja2.tex', 'Jinja2 Documentation', 'Armin Ronacher', 'manual', 'toctree_only'), + ('latexindex', 'Jinja2.tex', 'Jinja2 Documentation', 'Armin Ronacher', + 'manual'), ] -# Additional stuff for the LaTeX preamble. -latex_preamble = ''' -\usepackage{palatino} -\definecolor{TitleColor}{rgb}{0.7,0,0} -\definecolor{InnerLinkColor}{rgb}{0.7,0,0} -\definecolor{OuterLinkColor}{rgb}{0.8,0,0} -\definecolor{VerbatimColor}{rgb}{0.985,0.985,0.985} -\definecolor{VerbatimBorderColor}{rgb}{0.8,0.8,0.8} +# Additional stuff for LaTeX +latex_elements = { + 'fontpkg': r'\usepackage{mathpazo}', + 'papersize': 'a4paper', + 'pointsize': '12pt', + 'preamble': r''' +\usepackage{jinjastyle} + +% i hate you latex +\DeclareUnicodeCharacter{14D}{o} ''' +} + +latex_use_parts = True -# Documents to append as an appendix to all manuals. -#latex_appendices = [] +latex_additional_files = ['jinjastyle.sty', 'logo.pdf'] # If false, no module index is generated. latex_use_modindex = False diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc new file mode 100644 index 0000000..35d6d23 --- /dev/null +++ b/docs/contents.rst.inc @@ -0,0 +1,29 @@ +Jinja2 Documentation +-------------------- + +.. toctree:: + :maxdepth: 2 + + intro + api + sandbox + templates + extensions + integration + switching + tricks + +Additional Information +---------------------- + +.. toctree:: + :maxdepth: 2 + + faq + changelog + +If you can't find the information you're looking for, have a look at the +index of try to find it using the search function: + +* :ref:`genindex` +* :ref:`search` diff --git a/docs/index.rst b/docs/index.rst index 6d050b4..7225e1c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,29 +25,7 @@ with the optional sandboxed template execution environment: the correct line in the template. - configurable syntax -Jinja2 Documentation --------------------- - -.. toctree:: - :maxdepth: 2 - - intro - api - sandbox - templates - extensions - integration - switching - tricks - -Additional Information ----------------------- - -.. toctree:: - :maxdepth: 2 - - faq - changelog +.. include:: contents.rst.inc If you can't find the information you're looking for, have a look at the index of try to find it using the search function: diff --git a/docs/jinjastyle.sty b/docs/jinjastyle.sty new file mode 100644 index 0000000..da811ce --- /dev/null +++ b/docs/jinjastyle.sty @@ -0,0 +1,119 @@ +\definecolor{TitleColor}{rgb}{0,0,0} +\definecolor{InnerLinkColor}{rgb}{0,0,0} +\definecolor{OuterLinkColor}{rgb}{0.8,0,0} + +\renewcommand{\maketitle}{% + \begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \ifsphinxpdfoutput + \begingroup + % This \def is required to deal with multi-line authors; it + % changes \\ to ', ' (comma-space), making it pass muster for + % generating document info in the PDF file. + \def\\{, } + \pdfinfo{ + /Author (\@author) + /Title (\@title) + } + \endgroup + \fi + \begin{flushright}% + %\sphinxlogo% + {\center + \vspace*{3cm} + \includegraphics{logo.pdf} + \vspace{3cm} + \par + {\rm\Huge \@title \par}% + {\em\LARGE \py@release\releaseinfo \par} + {\large + \@date \par + \py@authoraddress \par + }}% + \end{flushright}%\par + \@thanks + \end{titlepage}% + \cleardoublepage% + \setcounter{footnote}{0}% + \let\thanks\relax\let\maketitle\relax + %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} +} + +\fancypagestyle{normal}{ + \fancyhf{} + \fancyfoot[LE,RO]{{\thepage}} + \fancyfoot[LO]{{\nouppercase{\rightmark}}} + \fancyfoot[RE]{{\nouppercase{\leftmark}}} + \fancyhead[LE,RO]{{ \@title, \py@release}} + \renewcommand{\headrulewidth}{0.4pt} + \renewcommand{\footrulewidth}{0.4pt} +} + +\fancypagestyle{plain}{ + \fancyhf{} + \fancyfoot[LE,RO]{{\thepage}} + \renewcommand{\headrulewidth}{0pt} + \renewcommand{\footrulewidth}{0.4pt} +} + +\titleformat{\section}{\Large}% + {\py@TitleColor\thesection}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\subsection}{\large}% + {\py@TitleColor\thesubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\subsubsection}{}% + {\py@TitleColor\thesubsubsection}{0.5em}{\py@TitleColor}{\py@NormalColor} +\titleformat{\paragraph}{\large}% + {\py@TitleColor}{0em}{\py@TitleColor}{\py@NormalColor} + +\ChNameVar{\raggedleft\normalsize} +\ChNumVar{\raggedleft \bfseries\Large} +\ChTitleVar{\raggedleft \rm\Huge} + +\renewcommand\thepart{\@Roman\c@part} +\renewcommand\part{% + \pagestyle{plain} + \if@noskipsec \leavevmode \fi + \cleardoublepage + \vspace*{6cm}% + \@afterindentfalse + \secdef\@part\@spart} + +\def\@part[#1]#2{% + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + {\parindent \z@ %\center + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >\m@ne + \rm\Large \partname~\thepart + \par\nobreak + \fi + \MakeUppercase{\rm\Huge #2}% + \markboth{}{}\par}% + \nobreak + \vskip 8ex + \@afterheading} +\def\@spart#1{% + {\parindent \z@ %\center + \interlinepenalty \@M + \normalfont + \huge \bfseries #1\par}% + \nobreak + \vskip 3ex + \@afterheading} + +% use inconsolata font +\usepackage{inconsolata} + +% fix single quotes, for inconsolata. (does not work) +%%\usepackage{textcomp} +%%\begingroup +%% \catcode`'=\active +%% \g@addto@macro\@noligs{\let'\textsinglequote} +%% \endgroup +%%\endinput diff --git a/docs/latexindex.rst b/docs/latexindex.rst new file mode 100644 index 0000000..300e60d --- /dev/null +++ b/docs/latexindex.rst @@ -0,0 +1,6 @@ +:orphan: + +Jinja2 Documentation +==================== + +.. include:: contents.rst.inc diff --git a/docs/logo.pdf b/docs/logo.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3e8a9cf480ccbe4a30911bdb7d78c0b80e767c81 GIT binary patch literal 5677 zcma)gc{r49`+t;e$QETcgp_T@%wS~6zVG`|8OtzXhB1>Z`&LMn)Py`p2-(S2*~h*l z43T6jvZY94m_#X}Y;!T-^XFDgZwm)(zne z2*?Vt?<-rZW1HTVs9|P(ut6NpJVr&`F-dF3rSH@}3{w&~zISM8m6kfF9OZP{uY^S_ zWgyg2{%hx6$lWQ=skcAB9Tu)N2_Ei@+Ax29yj%bL=hmHLO`PskrW{ciz&8f!+^Px%t%U!$#9d7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