13
13
import inspect
14
14
import shutil
15
15
16
- __location__ = os .path .join (os .getcwd (), os .path .dirname (
17
- inspect .getfile (inspect .currentframe ())))
16
+ __location__ = os .path .join (
17
+ os .getcwd (), os .path .dirname (inspect .getfile (inspect .currentframe ()))
18
+ )
19
+
20
+ import m2r2
21
+
22
+ readme_rst_content = m2r2 .parse_from_file (os .path .join (__location__ , ".." , "README.md" ))
23
+ with open (os .path .join (__location__ , "README.rst" ), "w" ) as f :
24
+ f .write (readme_rst_content )
25
+
26
+ # Try to import win32com, otherwise use mocking
27
+ try :
28
+ import win32com
29
+ except ImportError :
30
+ sys .path .insert (0 , os .path .join (__location__ , "../mocking" ))
18
31
19
32
# If extensions (or modules to document with autodoc) are in another directory,
20
33
# add these directories to sys.path here. If the directory is relative to the
21
34
# documentation root, use os.path.abspath to make it absolute, like shown here.
22
- sys .path .insert (0 , os .path .join (__location__ , ' ../src' ))
35
+ sys .path .insert (0 , os .path .join (__location__ , " ../src" ))
23
36
24
37
# -- Run sphinx-apidoc ------------------------------------------------------
25
38
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
49
62
cmd_line = cmd_line_template .format (outputdir = output_dir , moduledir = module_dir )
50
63
51
64
args = cmd_line .split (" " )
52
- if parse_version (sphinx .__version__ ) >= parse_version (' 1.7' ):
65
+ if parse_version (sphinx .__version__ ) >= parse_version (" 1.7" ):
53
66
args = args [1 :]
54
67
55
68
apidoc .main (args )
63
76
64
77
# Add any Sphinx extension module names here, as strings. They can be extensions
65
78
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
66
- extensions = ['sphinx.ext.autodoc' , 'sphinx.ext.intersphinx' , 'sphinx.ext.todo' ,
67
- 'sphinx.ext.autosummary' , 'sphinx.ext.viewcode' , 'sphinx.ext.coverage' ,
68
- 'sphinx.ext.doctest' , 'sphinx.ext.ifconfig' , 'sphinx.ext.mathjax' ,
69
- 'sphinx.ext.napoleon' ]
70
- extensions .append ('recommonmark' )
79
+ extensions = [
80
+ "sphinx.ext.autodoc" ,
81
+ "sphinx.ext.intersphinx" ,
82
+ "sphinx.ext.todo" ,
83
+ "sphinx.ext.autosummary" ,
84
+ "sphinx.ext.viewcode" ,
85
+ "sphinx.ext.coverage" ,
86
+ "sphinx.ext.doctest" ,
87
+ "sphinx.ext.ifconfig" ,
88
+ "sphinx.ext.mathjax" ,
89
+ "sphinx.ext.napoleon" ,
90
+ "sphinx_rtd_theme" ,
91
+ "recommonmark" ,
92
+ ]
93
+
71
94
72
95
# Add any paths that contain templates here, relative to this directory.
73
- templates_path = [' _templates' ]
96
+ templates_path = [" _templates" ]
74
97
75
98
76
99
# To configure AutoStructify
77
100
def setup (app ):
78
101
from recommonmark .transform import AutoStructify
79
- app .add_config_value ('recommonmark_config' , {
80
- 'auto_toc_tree_section' : 'Contents' ,
81
- 'enable_eval_rst' : True ,
82
- 'enable_math' : True ,
83
- 'enable_inline_math' : True
84
- }, True )
102
+
103
+ app .add_config_value (
104
+ "recommonmark_config" ,
105
+ {
106
+ "auto_toc_tree_section" : "Contents" ,
107
+ "enable_eval_rst" : True ,
108
+ "enable_math" : True ,
109
+ "enable_inline_math" : True ,
110
+ },
111
+ True ,
112
+ )
85
113
app .add_transform (AutoStructify )
86
114
115
+
87
116
# The suffix of source filenames.
88
- source_suffix = [' .rst' , ' .md' ]
117
+ source_suffix = [" .rst" , " .md" ]
89
118
90
119
# The encoding of source files.
91
120
# source_encoding = 'utf-8-sig'
92
121
93
122
# The master toctree document.
94
- master_doc = ' index'
123
+ master_doc = " index"
95
124
96
125
# General information about the project.
97
- project = u' SyncGitlab2MSProject'
98
- copyright = u' 2020, Carli'
126
+ project = u" SyncGitlab2MSProject"
127
+ copyright = u" 2020, Carli* Freudenberg"
99
128
100
129
# The version info for the project you're documenting, acts as replacement for
101
130
# |version| and |release|, also used in various other places throughout the
102
131
# built documents.
103
132
#
104
133
# The short X.Y version.
105
- version = '' # Is set by calling `setup.py docs`
134
+ version = "" # Is set by calling `setup.py docs`
106
135
# The full version, including alpha/beta/rc tags.
107
- release = '' # Is set by calling `setup.py docs`
136
+ release = "" # Is set by calling `setup.py docs`
108
137
109
138
# The language for content autogenerated by Sphinx. Refer to documentation
110
139
# for a list of supported languages.
@@ -118,7 +147,7 @@ def setup(app):
118
147
119
148
# List of patterns, relative to source directory, that match files and
120
149
# directories to ignore when looking for source files.
121
- exclude_patterns = [' _build' ]
150
+ exclude_patterns = [" _build" ]
122
151
123
152
# The reST default role (used for this markup: `text`) to use for all documents.
124
153
# default_role = None
@@ -135,7 +164,7 @@ def setup(app):
135
164
# show_authors = False
136
165
137
166
# The name of the Pygments (syntax highlighting) style to use.
138
- pygments_style = ' sphinx'
167
+ pygments_style = " sphinx"
139
168
140
169
# A list of ignored prefixes for module index sorting.
141
170
# modindex_common_prefix = []
@@ -148,15 +177,12 @@ def setup(app):
148
177
149
178
# The theme to use for HTML and HTML Help pages. See the documentation for
150
179
# a list of builtin themes.
151
- html_theme = 'alabaster'
180
+ html_theme = "sphinx_rtd_theme"
152
181
153
182
# Theme options are theme-specific and customize the look and feel of a theme
154
183
# further. For a list of options available for each theme, see the
155
184
# documentation.
156
- html_theme_options = {
157
- 'sidebar_width' : '300px' ,
158
- 'page_width' : '1200px'
159
- }
185
+ html_theme_options = {"sidebar_width" : "300px" , "page_width" : "1200px" }
160
186
161
187
# Add any paths that contain custom themes here, relative to this directory.
162
188
# html_theme_path = []
@@ -185,7 +211,7 @@ def setup(app):
185
211
# Add any paths that contain custom static files (such as style sheets) here,
186
212
# relative to this directory. They are copied after the builtin static files,
187
213
# so a file named "default.css" will overwrite the builtin "default.css".
188
- html_static_path = [' _static' ]
214
+ html_static_path = [" _static" ]
189
215
190
216
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
191
217
# using the given strftime format.
@@ -229,27 +255,30 @@ def setup(app):
229
255
# html_file_suffix = None
230
256
231
257
# Output file base name for HTML help builder.
232
- htmlhelp_basename = ' syncgitlab2msproject-doc'
258
+ htmlhelp_basename = " syncgitlab2msproject-doc"
233
259
234
260
235
261
# -- Options for LaTeX output --------------------------------------------------
236
262
237
263
latex_elements = {
238
- # The paper size ('letterpaper' or 'a4paper').
239
- # 'papersize': 'letterpaper',
240
-
241
- # The font size ('10pt', '11pt' or '12pt').
242
- # 'pointsize': '10pt',
243
-
244
- # Additional stuff for the LaTeX preamble.
245
- # 'preamble': '',
264
+ # The paper size ('letterpaper' or 'a4paper').
265
+ # 'papersize': 'letterpaper',
266
+ # The font size ('10pt', '11pt' or '12pt').
267
+ # 'pointsize': '10pt',
268
+ # Additional stuff for the LaTeX preamble.
269
+ # 'preamble': '',
246
270
}
247
271
248
272
# Grouping the document tree into LaTeX files. List of tuples
249
273
# (source start file, target name, title, author, documentclass [howto/manual]).
250
274
latex_documents = [
251
- ('index' , 'user_guide.tex' , u'SyncGitlab2MSProject Documentation' ,
252
- u'Carli' , 'manual' ),
275
+ (
276
+ "index" ,
277
+ "user_guide.tex" ,
278
+ u"SyncGitlab2MSProject Documentation" ,
279
+ u"Carli" ,
280
+ "manual" ,
281
+ ),
253
282
]
254
283
255
284
# The name of an image file (relative to this directory) to place at the top of
@@ -273,13 +302,13 @@ def setup(app):
273
302
# latex_domain_indices = True
274
303
275
304
# -- External mapping ------------------------------------------------------------
276
- python_version = '.' .join (map (str , sys .version_info [0 :2 ]))
305
+ python_version = "." .join (map (str , sys .version_info [0 :2 ]))
277
306
intersphinx_mapping = {
278
- ' sphinx' : (' http://www.sphinx-doc.org/en/stable' , None ),
279
- ' python' : (' https://docs.python.org/' + python_version , None ),
280
- ' matplotlib' : (' https://matplotlib.org' , None ),
281
- ' numpy' : (' https://docs.scipy.org/doc/numpy' , None ),
282
- ' sklearn' : (' http://scikit-learn.org/stable' , None ),
283
- ' pandas' : (' http://pandas.pydata.org/pandas-docs/stable' , None ),
284
- ' scipy' : (' https://docs.scipy.org/doc/scipy/reference' , None ),
285
- }
307
+ " sphinx" : (" http://www.sphinx-doc.org/en/stable" , None ),
308
+ " python" : (" https://docs.python.org/" + python_version , None ),
309
+ " matplotlib" : (" https://matplotlib.org" , None ),
310
+ " numpy" : (" https://docs.scipy.org/doc/numpy" , None ),
311
+ " sklearn" : (" http://scikit-learn.org/stable" , None ),
312
+ " pandas" : (" http://pandas.pydata.org/pandas-docs/stable" , None ),
313
+ " scipy" : (" https://docs.scipy.org/doc/scipy/reference" , None ),
314
+ }
0 commit comments