1313import inspect
1414import shutil
1515
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" ))
1831
1932# If extensions (or modules to document with autodoc) are in another directory,
2033# add these directories to sys.path here. If the directory is relative to the
2134# 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" ))
2336
2437# -- Run sphinx-apidoc ------------------------------------------------------
2538# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
4962 cmd_line = cmd_line_template .format (outputdir = output_dir , moduledir = module_dir )
5063
5164 args = cmd_line .split (" " )
52- if parse_version (sphinx .__version__ ) >= parse_version (' 1.7' ):
65+ if parse_version (sphinx .__version__ ) >= parse_version (" 1.7" ):
5366 args = args [1 :]
5467
5568 apidoc .main (args )
6376
6477# Add any Sphinx extension module names here, as strings. They can be extensions
6578# 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+
7194
7295# Add any paths that contain templates here, relative to this directory.
73- templates_path = [' _templates' ]
96+ templates_path = [" _templates" ]
7497
7598
7699# To configure AutoStructify
77100def setup (app ):
78101 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+ )
85113 app .add_transform (AutoStructify )
86114
115+
87116# The suffix of source filenames.
88- source_suffix = [' .rst' , ' .md' ]
117+ source_suffix = [" .rst" , " .md" ]
89118
90119# The encoding of source files.
91120# source_encoding = 'utf-8-sig'
92121
93122# The master toctree document.
94- master_doc = ' index'
123+ master_doc = " index"
95124
96125# General information about the project.
97- project = u' SyncGitlab2MSProject'
98- copyright = u' 2020, Carli'
126+ project = u" SyncGitlab2MSProject"
127+ copyright = u" 2020, Carli* Freudenberg"
99128
100129# The version info for the project you're documenting, acts as replacement for
101130# |version| and |release|, also used in various other places throughout the
102131# built documents.
103132#
104133# The short X.Y version.
105- version = '' # Is set by calling `setup.py docs`
134+ version = "" # Is set by calling `setup.py docs`
106135# 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`
108137
109138# The language for content autogenerated by Sphinx. Refer to documentation
110139# for a list of supported languages.
@@ -118,7 +147,7 @@ def setup(app):
118147
119148# List of patterns, relative to source directory, that match files and
120149# directories to ignore when looking for source files.
121- exclude_patterns = [' _build' ]
150+ exclude_patterns = [" _build" ]
122151
123152# The reST default role (used for this markup: `text`) to use for all documents.
124153# default_role = None
@@ -135,7 +164,7 @@ def setup(app):
135164# show_authors = False
136165
137166# The name of the Pygments (syntax highlighting) style to use.
138- pygments_style = ' sphinx'
167+ pygments_style = " sphinx"
139168
140169# A list of ignored prefixes for module index sorting.
141170# modindex_common_prefix = []
@@ -148,15 +177,12 @@ def setup(app):
148177
149178# The theme to use for HTML and HTML Help pages. See the documentation for
150179# a list of builtin themes.
151- html_theme = 'alabaster'
180+ html_theme = "sphinx_rtd_theme"
152181
153182# Theme options are theme-specific and customize the look and feel of a theme
154183# further. For a list of options available for each theme, see the
155184# documentation.
156- html_theme_options = {
157- 'sidebar_width' : '300px' ,
158- 'page_width' : '1200px'
159- }
185+ html_theme_options = {"sidebar_width" : "300px" , "page_width" : "1200px" }
160186
161187# Add any paths that contain custom themes here, relative to this directory.
162188# html_theme_path = []
@@ -185,7 +211,7 @@ def setup(app):
185211# Add any paths that contain custom static files (such as style sheets) here,
186212# relative to this directory. They are copied after the builtin static files,
187213# so a file named "default.css" will overwrite the builtin "default.css".
188- html_static_path = [' _static' ]
214+ html_static_path = [" _static" ]
189215
190216# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
191217# using the given strftime format.
@@ -229,27 +255,30 @@ def setup(app):
229255# html_file_suffix = None
230256
231257# Output file base name for HTML help builder.
232- htmlhelp_basename = ' syncgitlab2msproject-doc'
258+ htmlhelp_basename = " syncgitlab2msproject-doc"
233259
234260
235261# -- Options for LaTeX output --------------------------------------------------
236262
237263latex_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': '',
246270}
247271
248272# Grouping the document tree into LaTeX files. List of tuples
249273# (source start file, target name, title, author, documentclass [howto/manual]).
250274latex_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+ ),
253282]
254283
255284# The name of an image file (relative to this directory) to place at the top of
@@ -273,13 +302,13 @@ def setup(app):
273302# latex_domain_indices = True
274303
275304# -- External mapping ------------------------------------------------------------
276- python_version = '.' .join (map (str , sys .version_info [0 :2 ]))
305+ python_version = "." .join (map (str , sys .version_info [0 :2 ]))
277306intersphinx_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