|
1 | 1 | # -*- coding: utf-8 -*-
|
2 |
| -import sys |
3 |
| -import os |
4 |
| -import glob |
5 |
| -import shutil |
| 2 | +""" |
| 3 | +Sphinx documentation configuration file. |
| 4 | +""" |
| 5 | +# pylint: disable=invalid-name |
| 6 | + |
6 | 7 | import datetime
|
7 |
| -import sphinx_rtd_theme |
8 |
| -import sphinx_gallery |
9 |
| -from sphinx_gallery.sorting import FileNameSortKey, ExplicitOrder |
| 8 | +from sphinx_gallery.sorting import ( # pylint: disable=no-name-in-module |
| 9 | + FileNameSortKey, |
| 10 | + ExplicitOrder, |
| 11 | +) |
10 | 12 | from pygmt import __version__, __commit__
|
11 | 13 | from pygmt.sphinx_gallery import PyGMTScraper
|
12 | 14 |
|
|
91 | 93 | templates_path = ["_templates"]
|
92 | 94 | exclude_patterns = ["_build", "**.ipynb_checkpoints"]
|
93 | 95 | source_suffix = ".rst"
|
| 96 | +needs_sphinx = "1.8" |
94 | 97 | # The encoding of source files.
|
95 | 98 | source_encoding = "utf-8-sig"
|
96 | 99 | master_doc = "index"
|
97 | 100 |
|
98 | 101 | # General information about the project
|
99 | 102 | year = datetime.date.today().year
|
100 | 103 | project = "PyGMT"
|
101 |
| -copyright = "2017-{}, The PyGMT Developers.".format(year) |
| 104 | +copyright = f"2017-{year}, The PyGMT Developers." # pylint: disable=redefined-builtin |
102 | 105 | if len(__version__.split("+")) > 1 or __version__ == "unknown":
|
103 | 106 | version = "dev"
|
104 | 107 | else:
|
|
118 | 121 | html_logo = ""
|
119 | 122 | html_favicon = "_static/favicon.png"
|
120 | 123 | html_static_path = ["_static"]
|
| 124 | +html_css_files = ["style.css"] |
121 | 125 | html_extra_path = []
|
122 | 126 | pygments_style = "default"
|
123 | 127 | add_function_parentheses = False
|
|
129 | 133 | html_theme = "sphinx_rtd_theme"
|
130 | 134 | html_theme_options = {}
|
131 | 135 | repository = "GenericMappingTools/pygmt"
|
132 |
| -commit_link = f'<a href="https://github.com/GenericMappingTools/pygmt/commit/{ __commit__ }">{ __commit__[:7] }</a>' |
| 136 | +repository_url = "https://github.com/GenericMappingTools/pygmt" |
| 137 | +commit_link = f'<a href="{repository_url}/commit/{ __commit__ }">{ __commit__[:7] }</a>' |
133 | 138 | html_context = {
|
134 | 139 | "menu_links": [
|
135 | 140 | (
|
136 | 141 | '<i class="fa fa-users fa-fw"></i> Contributing',
|
137 |
| - "https://github.com/GenericMappingTools/pygmt/blob/master/CONTRIBUTING.md", |
| 142 | + f"{repository_url}/blob/master/CONTRIBUTING.md", |
138 | 143 | ),
|
139 | 144 | (
|
140 | 145 | '<i class="fa fa-gavel fa-fw"></i> Code of Conduct',
|
141 |
| - "https://github.com/GenericMappingTools/pygmt/blob/master/CODE_OF_CONDUCT.md", |
| 146 | + f"{repository_url}/blob/master/CODE_OF_CONDUCT.md", |
142 | 147 | ),
|
143 | 148 | (
|
144 | 149 | '<i class="fa fa-book fa-fw"></i> License',
|
145 |
| - "https://github.com/GenericMappingTools/pygmt/blob/master/LICENSE.txt", |
| 150 | + f"{repository_url}/blob/master/LICENSE.txt", |
146 | 151 | ),
|
147 | 152 | (
|
148 | 153 | '<i class="fa fa-comment fa-fw"></i> Contact',
|
149 | 154 | "https://forum.generic-mapping-tools.org",
|
150 | 155 | ),
|
151 | 156 | (
|
152 | 157 | '<i class="fa fa-github fa-fw"></i> Source Code',
|
153 |
| - "https://github.com/GenericMappingTools/pygmt", |
| 158 | + repository_url, |
154 | 159 | ),
|
155 | 160 | ],
|
156 | 161 | # Custom variables to enable "Improve this page"" and "Download notebook"
|
|
164 | 169 | "github_version": "master",
|
165 | 170 | "commit": commit_link,
|
166 | 171 | }
|
167 |
| - |
168 |
| - |
169 |
| -# Load the custom CSS files (needs sphinx >= 1.6 for this to work) |
170 |
| -def setup(app): |
171 |
| - app.add_stylesheet("style.css") |
0 commit comments