Renamed urlescape to urlencode
[jinja2.git] / docs / conf.py
index 49f541185032e5adb7df24e5b6cf49fa72e9c75c..6e990be1c719ca8deb0ffd5ce25de637e0a4ffe3 100644 (file)
@@ -42,9 +42,18 @@ copyright = '2008, Armin Ronacher'
 # other places throughout the built documents.
 #
 # The short X.Y version.
-version = '2.0'
-# The full version, including alpha/beta/rc tags.
-release = '2.0'
+import pkg_resources
+try:
+    release = pkg_resources.get_distribution('Jinja2').version
+except ImportError:
+    print 'To build the documentation, The distribution information of Jinja2'
+    print 'Has to be available.  Either install the package into your'
+    print 'development environment or run "setup.py develop" to setup the'
+    print 'metadata.  A virtualenv is recommended!'
+    sys.exit(1)
+if 'dev' in release:
+    release = release.split('dev')[0] + 'dev'
+version = '.'.join(release.split('.')[:2])
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
@@ -119,21 +128,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