-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconf.py
151 lines (115 loc) · 4.11 KB
/
conf.py
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# -*- coding: utf-8 -*-
import sys
import sphinx.builders.manpage
import docutils.nodes
import os
import glob
from os.path import basename
# -- General configuration ------------------------------------------------
product_name = os.environ.get('PRODUCT', 'NetXMS')
product_key = product_name.replace(' ', '-').lower()
rst_epilog = '.. |product_name| replace:: %s' % product_name
print((os.path.abspath('../_lib')))
sys.path.insert(0, os.path.abspath('../_lib'))
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.ifconfig',
'wikipedia',
]
templates_path = ['../_templates']
source_suffix = {'.rst': 'restructuredtext'}
master_doc = 'index'
project_author = "Raden Solutions, SIA"
copyright = '2025, ' + project_author
version = '5.1'
release = '5.1.2'
exclude_patterns = ['build']
pygments_style = 'sphinx'
locale_dirs = ['_locale']
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
html_short_title = "Home"
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd:
html_theme = 'default'
else:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
#html_logo = '_images/logo.png'
html_favicon = '../favicon.ico'
html_static_path = ['_static']
html_show_sourcelink = False
html_show_sphinx = False
#html_show_copyright = True
if 'CI' in os.environ:
html_js_files = [('https://stats.raden.solutions/script.js', {'async': 'async', 'data-website-id':'e5a25886-8178-4d34-860f-f8cb9009a7e7'})]
# -- Options for LaTeX output ---------------------------------------------
latex_engine = 'xelatex'
# 'figure_align': 'H', - to avoid image floating to next page if it does not fit
latex_elements = {
'papersize': 'a4paper',
'pointsize': '8t',
'figure_align': 'H',
}
#latex_elements = {
# 'papersize': '',
# 'fontpkg': '',
# 'fncychap': '',
# 'maketitle': '\\cover',
# 'pointsize': '',
# 'preamble': '',
# 'releasename': "",
# 'babel': '',
# 'printindex': '',
# 'fontenc': '',
# 'inputenc': '',
# 'classoptions': '',
# 'utf8extra': '',
#}
#latex_additional_files = ["../netxms.sty" ]
latex_show_pagerefs = False
latex_domain_indices = False
latex_use_modindex = False
#latex_logo = '_images/logo.png'
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- PlantUML settings ---------------------------------------------------------
plantuml = '/usr/bin/java -Djava.awt.headless=true -jar ../_lib/plantuml.jar'
plantuml_latex_output_format = 'pdf'
# -- Custom code ---------------------------------------------------------------
def add_man_header_nodes(app, doctree, docname):
if isinstance(app.builder, sphinx.builders.manpage.ManualPageBuilder):
doctree.insert(0, docutils.nodes.raw('', '.if n .ad l\n.nh\n', format='manpage'))
def setup(app):
# fix hyphenation in generated man pages
app.connect('doctree-resolved', add_man_header_nodes)
# ignore custom modules except listed in $MODULES
modules = os.environ['MODULES'].split(',') if 'MODULES' in os.environ else []
extDirs = glob.glob('source/extensions/*')
for module in modules:
extDirs = [d for d in extDirs if module.strip() not in d]
for d in extDirs:
exclude_patterns.append(d[7:]) # remove 'source/'
app.add_css_file("theme_overrides.css")
if product_name == 'NetXMS':
app.add_config_value('release_type', 'oss', 'env')
else:
app.add_config_value('release_type', 'ee', 'env')
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_author = project_author
epub_publisher = project_author
epub_copyright = copyright
epub_theme = 'epub'
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']