Skip to content

Commit 86c3bda

Browse files
authored
Merge pull request #2 from CarliJoy/badges
Improve Documentation
2 parents 15dfab9 + b763fb4 commit 86c3bda

File tree

17 files changed

+224
-82
lines changed

17 files changed

+224
-82
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ sdist/*
4343
docs/api/*
4444
docs/_rst/*
4545
docs/_build/*
46+
docs/README.rst
4647
cover/*
4748
MANIFEST
4849

4950
# Per-project virtualenvs
5051
.venv*/
52+

.readthedocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
sphinx:
4+
configuration: docs/conf.py
5+
fail_on_warning: true
6+
7+
python:
8+
version: 3.8
9+
install:
10+
- requirements: docs/requirements.txt

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Contributors
33
============
44

5-
* Carli <Carl.Freudenberg@enercon.de>
5+
* Carli* Freudenberg <kound@posteo.de>

CHANGELOG.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
Changelog
33
=========
44

5-
Version 0.1
6-
===========
5+
Version 0.0.2
6+
=============
7+
- Documentation Only Changes
8+
- Add Badges
9+
- Import Readme to documentation
10+
- Allow build of documentation even without pywin32 installed
11+
- Use ReadTheDoc Sphinx Theme
712

8-
- Feature A added
9-
- FIX: nasty bug #1729 fixed
10-
- add your changes here!
13+
Version 0.0.1
14+
=============
15+
16+
- First Release

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2020 Carli
3+
Copyright (c) 2020 Carli* Freudenberg
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
[![Build Status](https://travis-ci.org/CarliJoy/SyncGitlab2MSProject.svg?branch=master)](https://travis-ci.org/CarliJoy/SyncGitlab2MSProject)
2+
[![](https://img.shields.io/pypi/v/SyncGitlab2MSProject.svg)](https://pypi.org/project/SyncGitlab2MSProject/)
3+
[![](https://img.shields.io/pypi/pyversions/SyncGitlab2MSProject.svg)](https://pypi.org/project/SyncGitlab2MSProject/)
4+
[![](https://img.shields.io/pypi/wheel/SyncGitlab2MSProject.svg)](https://pypi.org/project/SyncGitlab2MSProject/)
5+
[![](https://img.shields.io/pypi/status/SyncGitlab2MSProject.svg)](https://pypi.org/project/SyncGitlab2MSProject/)
6+
[![Code Style Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8+
19
# SyncGitlab2MSProject
210

311
Sync Gitlab Issues with a Microsoft Project File.
@@ -26,6 +34,11 @@ group. Problem is that accessing issues only by ID is just allowed for admins.
2634
## Requirements
2735
This project runs only in an Windows Environment with Microsoft Project installed.
2836

37+
**Please note:** This Script has been tested only mit Microsoft Project 2016.
38+
It cloud be, that some of the API has changed in newer versions.
39+
If you run into any troubles with a new version, please open an
40+
[Issue](https://github.com/CarliJoy/SyncGitlab2MSProject/issues/new).
41+
2942
## Usage
3043
```
3144
usage: sync_gitlab2msproject [-h] [--version] [-v] [-vv] [--gitlab-url GITLAB_URL] [--gitlab-token GITLAB_TOKEN] {project,group} gitlab_resource_id project_file

docs/conf.py

Lines changed: 79 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,26 @@
1313
import inspect
1414
import 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
@@ -49,7 +62,7 @@
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)
@@ -63,48 +76,64 @@
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
77100
def 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

237263
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': '',
246270
}
247271

248272
# Grouping the document tree into LaTeX files. List of tuples
249273
# (source start file, target name, title, author, documentclass [howto/manual]).
250274
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+
),
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]))
277306
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+
}

docs/index.rst

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,7 @@ SyncGitlab2MSProject
44

55
This is the documentation of **SyncGitlab2MSProject**.
66

7-
.. note::
8-
9-
This is the main page of your project's `Sphinx`_ documentation.
10-
It is formatted in `reStructuredText`_. Add additional pages
11-
by creating rst-files in ``docs`` and adding them to the `toctree`_ below.
12-
Use then `references`_ in order to link them from this page, e.g.
13-
:ref:`authors` and :ref:`changes`.
14-
15-
It is also possible to refer to the documentation of other Python packages
16-
with the `Python domain syntax`_. By default you can reference the
17-
documentation of `Sphinx`_, `Python`_, `NumPy`_, `SciPy`_, `matplotlib`_,
18-
`Pandas`_, `Scikit-Learn`_. You can add more by extending the
19-
``intersphinx_mapping`` in your Sphinx's ``conf.py``.
20-
21-
The pretty useful extension `autodoc`_ is activated by default and lets
22-
you include documentation from docstrings. Docstrings can be written in
23-
`Google style`_ (recommended!), `NumPy style`_ and `classical style`_.
24-
7+
.. include:: README.rst
258

269
Contents
2710
========

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sphinx-rtd-theme>=0.5.0
2+
Sphinx>=3.3.1
3+
recommonmark>=0.6.0
4+
m2r2>=0.2.5

mocking/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# About this directory
2+
3+
This directory contains mocks for pywin32 classes.
4+
It is used so that the documentation can build on non Windows operating system
5+
like Linux.
6+
7+
**DON'T EXPECT ANY FUNCTIONALITY HERE!!**

mocking/__init__.py

Whitespace-only changes.

mocking/pywintypes/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class datetime(object):
2+
"""Windows Datetime (mocked)"""

mocking/win32com/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)