Repository navigation
Expand file tree
/
Copy pathconf.py
More file actions
125 lines (101 loc) · 2.99 KB
/
Copy pathconf.py
File metadata and controls
125 lines (101 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import sys
sys.path.append('./')
from custom_conf import *
############################################################
### Extensions
############################################################
extensions = [
'sphinx_design',
'sphinx_tabs.tabs',
'sphinx_reredirects',
'youtube_links',
'related_links',
'custom_rst_roles',
'terminal_output',
'sphinx_copybutton',
'sphinxext.opengraph',
'myst_parser',
'sphinxcontrib.jquery',
'notfound.extension'
]
extensions.extend(custom_extensions)
myst_enable_extensions = [
'substitution',
'deflist',
'linkify'
]
myst_enable_extensions.extend(custom_myst_extensions)
if 'discourse_prefix' not in html_context and 'discourse' in html_context:
html_context['discourse_prefix'] = html_context['discourse'] + '/t/'
if slug:
notfound_urls_prefix = '/' + slug + '/en/latest/'
else:
notfound_urls_prefix = '/'
notfound_template = '404.html'
notfound_context = {
'title': 'Page not found',
'body': '',
}
if 'ogp_image' not in locals():
ogp_image = '_static/ngkore-logo.svg'
############################################################
### General configuration
############################################################
exclude_patterns = [
'_build',
'Thumbs.db',
'.DS_Store',
'.sphinx',
]
exclude_patterns.extend(custom_excludes)
rst_epilog = '''
.. include:: /reuse/links.txt
'''
if 'custom_rst_epilog' in locals():
rst_epilog = custom_rst_epilog
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
if 'conf_py_path' not in html_context and 'github_folder' in html_context:
html_context['conf_py_path'] = html_context['github_folder']
linkcheck_anchors_ignore_for_url = [
r'https://github\.com/.*',
"https://matrix.to/*"
]
linkcheck_anchors_ignore_for_url.extend(custom_linkcheck_anchors_ignore_for_url)
linkcheck_ignore = [r'http://.*\.mgmt/']
for tag in custom_tags:
tags.add(tag)
############################################################
### Styling
############################################################
builder = 'dirhtml'
if '-b' in sys.argv:
builder = sys.argv[sys.argv.index('-b')+1]
# epub builder fails with templates_path set
if builder in ('dirhtml', 'html'):
templates_path = ['.sphinx/_templates']
html_theme = 'furo'
html_permalinks_icon = '¶'
if html_title == '':
html_theme_options = {
'sidebar_hide_name': True
}
############################################################
### Additional files
############################################################
html_static_path = ['.sphinx/_static']
html_css_files = [
'theme.css',
'typography.css',
'content.css',
'layout.css',
'github_issue_links.css',
'bottom-logo.css'
]
html_css_files.extend(custom_html_css_files)
html_js_files = []
if 'github_issues' in html_context and html_context['github_issues'] and not disable_feedback_button:
html_js_files.append('github_issue_links.js')
html_js_files.extend(custom_html_js_files)