Changeset View
Changeset View
Standalone View
Standalone View
Kirigami/source/conf.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- | ||
---|---|---|---|---|---|
2 | # | 2 | # | ||
3 | # Configuration file for the Sphinx documentation builder. | 3 | # Configuration file for the Sphinx documentation builder. | ||
4 | # | 4 | # | ||
5 | # This file does only contain a selection of the most common options. For a | 5 | # This file does only contain a selection of the most common options. For a | ||
6 | # full list see the documentation: | 6 | # full list see the documentation: | ||
7 | # http://www.sphinx-doc.org/en/master/config | 7 | # http://www.sphinx-doc.org/en/master/config | ||
8 | 8 | | |||
9 | # -- Path setup -------------------------------------------------------------- | 9 | # -- Path setup -------------------------------------------------------------- | ||
10 | 10 | | |||
11 | # If extensions (or modules to document with autodoc) are in another directory, | 11 | # If extensions (or modules to document with autodoc) are in another directory, | ||
12 | # add these directories to sys.path here. If the directory is relative to the | 12 | # add these directories to sys.path here. If the directory is relative to the | ||
13 | # documentation root, use os.path.abspath to make it absolute, like shown here. | 13 | # documentation root, use os.path.abspath to make it absolute, like shown here. | ||
14 | # | 14 | # | ||
15 | from sphinx.util.console import bold | 15 | | ||
16 | import requests | | |||
17 | import os | 16 | import os | ||
18 | import sys | 17 | import sys | ||
19 | sys.path.insert(0, os.path.abspath('.')) | 18 | sys.path.insert(0, os.path.abspath('.')) | ||
20 | sys.path.insert(0, os.path.abspath('../..')) | 19 | sys.path.insert(0, os.path.abspath('../..')) | ||
21 | 20 | | |||
22 | 21 | | |||
23 | # -- Project information ----------------------------------------------------- | 22 | # -- Project information ----------------------------------------------------- | ||
24 | 23 | | |||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
184 | # epub_uid = '' | 183 | # epub_uid = '' | ||
185 | 184 | | |||
186 | # A list of files that should not be packed into the epub file. | 185 | # A list of files that should not be packed into the epub file. | ||
187 | epub_exclude_files = ['search.html'] | 186 | epub_exclude_files = ['search.html'] | ||
188 | 187 | | |||
189 | 188 | | |||
190 | # -- Extension configuration ------------------------------------------------- | 189 | # -- Extension configuration ------------------------------------------------- | ||
191 | 190 | | |||
192 | doxylink = { | 191 | from globalconf import get_doxylink | ||
193 | 'kirigamiapi' : ('Kirigami2.tags', 'https://api.kde.org/frameworks/kirigami/html/'), # https://api.kde.org/frameworks/kirigami/html/Kirigami2.tags | 192 | doxylink = get_doxylink() | ||
194 | 'kwidgetsaddonsapi' : ('KWidgetsAddons.tags', 'https://api.kde.org/frameworks/kwidgetsaddons/html/'), # https://api.kde.org/frameworks/kwidgetsaddons/html/KWidgetsAddons.tags | | |||
195 | 'plasmaapi' : ('Plasma.tags', 'https://api.kde.org/frameworks/plasma-framework/html/') # https://api.kde.org/frameworks/plasma-framework/html/Plasma.tags | | |||
196 | } | | |||
197 | | ||||
198 | for doc in doxylink.values(): | | |||
199 | print(bold("Downloading file {} to {}".format(doc[1] + "/" + doc[0], doc[0]))) | | |||
200 | tagFile = open("../" + doc[0], "w") | | |||
201 | tagFile.write(requests.get(doc[1] + "/" + doc[0]).text) | | |||
202 | tagFile.close() | | |||
203 | 193 | | |||
204 | # -- Options for intersphinx extension --------------------------------------- | 194 | # -- Options for intersphinx extension --------------------------------------- | ||
205 | 195 | | |||
206 | # Example configuration for intersphinx: refer to the Python standard library. | 196 | # Example configuration for intersphinx: refer to the Python standard library. | ||
207 | intersphinx_mapping = { | 197 | intersphinx_mapping = { | ||
208 | 'hig': ('https://hig.kde.org/', None), | 198 | 'hig': ('https://hig.kde.org/', None), | ||
209 | 'pm': ('https://docs.plasma-mobile.org', None) | 199 | 'pm': ('https://docs.plasma-mobile.org', None) | ||
210 | } | 200 | } | ||
211 | 201 | | |||
212 | # add css file | 202 | # add css file | ||
213 | def setup(app): | 203 | def setup(app): | ||
214 | app.add_stylesheet('css/breeze.css') | 204 | app.add_stylesheet('css/breeze.css') |