Skip to content

Commit 25f3d6d

Browse files
committed
Docs
1 parent 6b84411 commit 25f3d6d

File tree

10 files changed

+248
-0
lines changed

10 files changed

+248
-0
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = dotenv-linter
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/.gitkeep

Whitespace-only changes.

docs/_templates/moreinfo.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<h3>
2+
Links
3+
</h3>
4+
<ul>
5+
<li>
6+
<a href="https://github.com/dry-python/classes">GitHub</a>
7+
</li>
8+
<li>
9+
<a href="https://pypi.python.org/pypi/classes">PyPI</a>
10+
</li>
11+
<li>
12+
<a href="https://travis-ci.org/dry-python/classes">Travis CI</a>
13+
</li>
14+
<li>
15+
<a href="https://coveralls.io/github/dry-python/classes?branch=master">Coverage</a>
16+
</li>
17+
</ul>

docs/conf.py

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
15+
import os
16+
import sys
17+
18+
sys.path.insert(0, os.path.abspath('..'))
19+
20+
21+
# -- Project information -----------------------------------------------------
22+
23+
def _get_project_meta():
24+
import tomlkit # noqa: WPS433
25+
26+
with open('../pyproject.toml') as pyproject:
27+
file_contents = pyproject.read()
28+
29+
return tomlkit.parse(file_contents)['tool']['poetry']
30+
31+
32+
pkg_meta = _get_project_meta()
33+
project = pkg_meta['name']
34+
copyright = '2019, dry-python team' # noqa: A001
35+
author = 'dry-python team'
36+
37+
# The short X.Y version
38+
version = pkg_meta['version']
39+
# The full version, including alpha/beta/rc tags
40+
release = version
41+
42+
43+
# -- General configuration ---------------------------------------------------
44+
45+
# Add any Sphinx extension module names here, as strings. They can be
46+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47+
# ones.
48+
extensions = [
49+
'sphinx.ext.autodoc',
50+
'sphinx.ext.doctest',
51+
'sphinx.ext.todo',
52+
'sphinx.ext.coverage',
53+
'sphinx.ext.viewcode',
54+
'sphinx.ext.autosummary',
55+
'sphinx.ext.napoleon',
56+
57+
# Used to include .md files:
58+
'm2r',
59+
60+
# Used to insert typehints into the final docs:
61+
'sphinx_autodoc_typehints',
62+
63+
# Used to build graphs:
64+
'sphinxcontrib.mermaid',
65+
]
66+
67+
autoclass_content = 'class'
68+
autodoc_member_order = 'bysource'
69+
70+
autodoc_member_order = 'bysource'
71+
autodoc_default_flags = {
72+
'members': '',
73+
'undoc-members': 'code,error_template',
74+
'exclude-members': '__dict__,__weakref__',
75+
}
76+
77+
# Set `typing.TYPE_CHECKING` to `True`:
78+
# https://pypi.org/project/sphinx-autodoc-typehints/
79+
set_type_checking_flag = False
80+
81+
# Add any paths that contain templates here, relative to this directory.
82+
templates_path = ['_templates']
83+
84+
# The suffix(es) of source filenames.
85+
# You can specify multiple suffix as a list of string:
86+
87+
source_suffix = ['.rst', '.md']
88+
89+
# The master toctree document.
90+
master_doc = 'index'
91+
92+
# The language for content autogenerated by Sphinx. Refer to documentation
93+
# for a list of supported languages.
94+
#
95+
# This is also used if you do content translation via gettext catalogs.
96+
# Usually you set "language" from the command line for these cases.
97+
language = None
98+
99+
# List of patterns, relative to source directory, that match files and
100+
# directories to ignore when looking for source files.
101+
# This pattern also affects html_static_path and html_extra_path .
102+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
103+
104+
# The name of the Pygments (syntax highlighting) style to use.
105+
pygments_style = 'sphinx'
106+
107+
add_module_names = False
108+
109+
autodoc_default_options = {
110+
'show-inheritance': True,
111+
}
112+
113+
114+
# -- Options for HTML output -------------------------------------------------
115+
116+
# The theme to use for HTML and HTML Help pages. See the documentation for
117+
# a list of builtin themes.
118+
#
119+
html_theme = 'sphinx_typlog_theme'
120+
121+
# Theme options are theme-specific and customize the look and feel of a theme
122+
# further. For a list of options available for each theme, see the
123+
# documentation.
124+
html_theme_options = {
125+
'logo_name': 'classes',
126+
'description': (
127+
'Make your functions return something meaningful, typed, and safe!'
128+
),
129+
'github_user': 'dry-python',
130+
'github_repo': 'classes',
131+
}
132+
133+
# Add any paths that contain custom static files (such as style sheets) here,
134+
# relative to this directory. They are copied after the builtin static files,
135+
# so a file named "default.css" will overwrite the builtin "default.css".
136+
html_static_path = ['_static']
137+
138+
# Custom sidebar templates, must be a dictionary that maps document names
139+
# to template names.
140+
html_sidebars = {
141+
'**': [
142+
'logo.html',
143+
'globaltoc.html',
144+
'github.html',
145+
'searchbox.html',
146+
'moreinfo.html',
147+
],
148+
}
149+
150+
151+
# -- Extension configuration -------------------------------------------------
152+
153+
napoleon_numpy_docstring = False
154+
155+
# -- Options for todo extension ----------------------------------------------
156+
157+
# If true, `todo` and `todoList` produce output, else they produce nothing.
158+
todo_include_todos = True

docs/index.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.. mdinclude:: ../README.md
2+
3+
Inspirations
4+
------------
5+
6+
This module is heavily based on:
7+
8+
- `python-typeclasses <https://github.com/thejohnfreeman/python-typeclasses>`_
9+
10+
Contents
11+
--------
12+
13+
.. toctree::
14+
:maxdepth: 2
15+
:caption: Userguide
16+
17+
pages/concept.rst
18+
pages/typeclass.rst
19+
pages/typesafety.rst
20+
21+
.. toctree::
22+
:maxdepth: 1
23+
:caption: Changelog
24+
25+
pages/changelog.rst
26+
27+
28+
Indices and tables
29+
------------------
30+
31+
* :ref:`genindex`
32+
* :ref:`modindex`
33+
* :ref:`search`

docs/pages/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. mdinclude:: ../../CHANGELOG.md

docs/pages/concept.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Typeclass: the concept
2+
======================

docs/pages/typeclass.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Typeclass
2+
=========

docs/pages/typesafety.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Type safety
2+
===========

docs/requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file is used to setup env
2+
# to generate documentation.
3+
4+
sphinx==2.2.0
5+
sphinx_autodoc_typehints==1.7.0
6+
sphinxcontrib-mermaid==0.3.1
7+
sphinx-typlog-theme==0.7.3
8+
recommonmark==0.6.0
9+
m2r==0.2.1
10+
tomlkit==0.5.5
11+
12+
# Dependencies of our project:
13+
typing-extensions==3.7.4

0 commit comments

Comments
 (0)