tconf.py - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
(HTM) git clone git://src.adamsgaard.dk/pism
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tconf.py (4329B)
---
1 # -*- coding: utf-8 -*-
2 #
3 # PISM, a Parallel Ice Sheet Model documentation build configuration file
4 #
5 # This file is execfile()d with the current directory set to its
6 # containing dir.
7
8 # -- General configuration ------------------------------------------------
9
10 # If your documentation needs a minimal Sphinx version, state it here.
11 #
12 # needs_sphinx = '1.0'
13
14 nitpicky = True
15
16 # Add any Sphinx extension module names here, as strings. They can be
17 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
18 # ones.
19 extensions = ['sphinx.ext.mathjax',
20 'sphinxcontrib.bibtex']
21
22 # Add any paths that contain templates here, relative to this directory.
23 templates_path = ['_templates']
24
25 # The suffix(es) of source filenames.
26 source_suffix = '.rst'
27
28 # List of patterns, relative to source directory, that match files and
29 # directories to ignore when looking for source files.
30 # This patterns also affect html_static_path and html_extra_path
31 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
32
33 def git(command):
34 return subprocess.check_output(shlex.split(command)).strip().decode("utf-8")
35
36 # Get precise revision, author, and date information from Git:
37 try:
38 import subprocess
39 import shlex
40
41 git_revision = git("git describe --always --match v?.?*")
42 git_author = git('git --no-pager log -1 --pretty="format:%an"')
43 git_date = git('git --no-pager log -1 --pretty="format:%ci"')
44 except:
45 git_revision = "unknown Git revision"
46 git_author = "unknown Git author"
47 git_date = "unknown Git date"
48
49 rst_epilog = """
50 .. |git-revision| replace:: ``{git_revision}``
51 .. |git-author| replace:: {git_author}
52 .. |git-date| replace:: ``{git_date}``
53 """.format(git_revision=git_revision,
54 git_author=git_author,
55 git_date=git_date)
56
57 # This is needed to be able to put .. bibliography:: in a "References" section in HTML and
58 # just in the main document in LaTeX. (Otherwise Sphinx produces an empty "References"
59 # section in LaTeX.)
60
61 if tags.has('latex'):
62 master_doc = 'index_latex'
63 exclude_patterns.append('index.rst')
64 exclude_patterns.append('zzz_references_html.rst')
65 else:
66 master_doc = 'index'
67 exclude_patterns.append('index_latex.rst')
68 exclude_patterns.append('zzz_references_latex.rst')
69
70 # General information about the project.
71 project = 'PISM, a Parallel Ice Sheet Model'
72 copyright = '2004--2020, the PISM authors'
73 author = 'the PISM authors'
74
75 # The version info for the project you're documenting, acts as replacement for
76 # |version| and |release|, also used in various other places throughout the
77 # built documents.
78 #
79 # The short X.Y version.
80 version = '1.2.2'
81 # The full version, including alpha/beta/rc tags.
82 release = '1.2.2'
83
84 # The language for content autogenerated by Sphinx.
85 language = None
86
87 # The name of the Pygments (syntax highlighting) style to use.
88 pygments_style = 'sphinx'
89
90 # numbered figures and tables
91 numfig = True
92
93 # -- Options for HTML output ----------------------------------------------
94
95 html_context = {"git_revision": git_revision,
96 "git_author": git_author,
97 "git_date": git_date}
98
99 html_theme = 'alabaster'
100
101 html_show_sourcelink = False
102
103 html_theme_options = {"logo": "pism-logo.png",
104 "github_button": False,
105 "show_powered_by": False,
106 "body_text_align": "justify",
107 # "sidebar_collapse" : True,
108 }
109
110 # Add any paths that contain custom static files (such as style sheets) here,
111 # relative to this directory. They are copied after the builtin static files,
112 # so a file named "default.css" will overwrite the builtin "default.css".
113 html_static_path = ['_static', 'logo']
114
115 # Custom sidebar templates, must be a dictionary that maps document names
116 # to template names.
117 #
118 # This is required for the alabaster theme
119 # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
120 html_sidebars = {
121 '**': [
122 'about.html',
123 'navigation.html',
124 'searchbox.html',
125 ]
126 }
127
128 # -- Options for LaTeX output ----------------
129
130 latex_documents = [
131 (master_doc, 'pism_manual.tex', project, author, 'manual'),
132 ]
133
134 # latex_show_pagerefs = True
135
136 latex_elements = {
137 'releasename': "version",
138 'preamble': r'\usepackage{txfonts}'
139 }