Skip to content

Commit 83ddb46

Browse files
Merge pull request #9 from ConorSheehan1/docs
Docs, closes #4
2 parents 7494342 + 7a005e9 commit 83ddb46

17 files changed

+711
-19
lines changed

Pipfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dev_osxdocker = "python osxdocker/docker_logs.py"
99
dev_install = "flit install --symlink"
1010
tests = "python -m pytest tests"
1111
lint = "black ."
12+
build_docs= "sphinx-autobuild docs/source docs/build/html"
1213
# need ~/.pypirc setup
1314
publish_test = "flit publish --repository testpypi"
1415
publish = "flit publish"
@@ -20,10 +21,14 @@ flit = "*"
2021
pytest = "*"
2122
docker = "*"
2223
isort = {extras = ["pipfile"],version = "*"}
24+
sphinx = "==2.4.4"
25+
recommonmark = "*"
26+
sphinx-autobuild = "*"
2327

2428
[packages]
2529
fire = "*"
2630
termcolor = "*"
31+
sphinx = "*"
2732

2833
[requires]
2934
python_version = "3"

Pipfile.lock

Lines changed: 409 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,8 @@ pipenv run lint
103103
# to sort imports
104104
pipenv run isort -y
105105
```
106+
107+
#### Docs
108+
```bash
109+
pipenv run build_docs
110+
```

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
To build docs
2+
```bash
3+
pipenv shell
4+
sphinx-apidoc -o . ../osxdocker
5+
make html
6+
```

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
osxdocker
2+
=========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
osxdocker

docs/osxdocker.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
osxdocker package
2+
=================
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 4
9+
10+
osxdocker.utils
11+
12+
Submodules
13+
----------
14+
15+
osxdocker.docker\_logs module
16+
-----------------------------
17+
18+
.. automodule:: osxdocker.docker_logs
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
24+
Module contents
25+
---------------
26+
27+
.. automodule:: osxdocker
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:

docs/osxdocker.utils.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
osxdocker.utils package
2+
=======================
3+
4+
Submodules
5+
----------
6+
7+
osxdocker.utils.docker\_base module
8+
-----------------------------------
9+
10+
.. automodule:: osxdocker.utils.docker_base
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
osxdocker.utils.warn module
16+
---------------------------
17+
18+
.. automodule:: osxdocker.utils.warn
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
24+
Module contents
25+
---------------
26+
27+
.. automodule:: osxdocker.utils
28+
:members:
29+
:undoc-members:
30+
:show-inheritance:

docs/source/conf.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# -*- coding: utf-8 -*-
2+
# Configuration file for the Sphinx documentation builder.
3+
#
4+
# This file only contains a selection of the most common options. For a full
5+
# list see the documentation:
6+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
7+
8+
# -- Path setup --------------------------------------------------------------
9+
10+
# If extensions (or modules to document with autodoc) are in another directory,
11+
# add these directories to sys.path here. If the directory is relative to the
12+
# documentation root, use os.path.abspath to make it absolute, like shown here.
13+
#
14+
import os
15+
import sys
16+
17+
sys.path.insert(0, os.path.abspath("../.."))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
project = "osxdocker"
22+
copyright = "2020, Conor Sheehan"
23+
author = "Conor Sheehan"
24+
25+
from osxdocker import __version__
26+
27+
# The short X.Y version.
28+
version = __version__
29+
# The full version, including alpha/beta/rc tags.
30+
release = version
31+
32+
# -- General configuration ---------------------------------------------------
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"recommonmark",
38+
"sphinx.ext.autodoc",
39+
"sphinx.ext.napoleon",
40+
"sphinx.ext.autosummary",
41+
]
42+
43+
autodoc_default_flags = ["members"]
44+
autosummary_generate = True
45+
46+
# Add any paths that contain templates here, relative to this directory.
47+
templates_path = ["_templates"]
48+
49+
# List of patterns, relative to source directory, that match files and
50+
# directories to ignore when looking for source files.
51+
# This pattern also affects html_static_path and html_extra_path.
52+
exclude_patterns = []
53+
54+
55+
# -- Options for HTML output -------------------------------------------------
56+
# The theme to use for HTML and HTML Help pages. See the documentation for
57+
# a list of builtin themes.
58+
#
59+
html_theme = "alabaster"
60+
61+
# Theme options are theme-specific and customize the look and feel of a theme
62+
# further. For a list of options available for each theme, see the
63+
# documentation.
64+
#
65+
html_theme_options = {
66+
"description": "A CLI for working with docker on OSX",
67+
"fixed_sidebar": True,
68+
}
69+
70+
# Add any paths that contain custom static files (such as style sheets) here,
71+
# relative to this directory. They are copied after the builtin static files,
72+
# so a file named "default.css" will overwrite the builtin "default.css".
73+
html_static_path = ["_static"]
74+
75+
from recommonmark.parser import CommonMarkParser
76+
77+
source_parsers = {
78+
".md": CommonMarkParser,
79+
}
80+
81+
# https://www.sphinx-doc.org/en/master/usage/markdown.html
82+
source_suffix = [".rst", ".md"]
83+
84+
# If true, `todo` and `todoList` produce output, else they produce nothing.
85+
todo_include_todos = False
86+
87+
# Napoleon settings
88+
napoleon_google_docstring = True
89+
napoleon_numpy_docstring = False

docs/source/index.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.. TODO: README.md can't be added until https://github.com/sphinx-doc/sphinx/issues/7000 is resolved
2+
.. autosummary::
3+
.. :toctree: stubs
4+
5+
.. osxdocker.DockerLogs
6+
.. osxdocker.utils.DockerBase
7+
.. Does work but causes duplicate object description warnings
8+
.. If only using autosummary, class is missing from genindex
9+
.. If only using auoclass, class is missing from navigation in sidebar.
10+
11+
12+
osxdocker
13+
=====================================
14+
.. autosummary::
15+
:toctree: modules
16+
17+
osxdocker.DockerLogs
18+
osxdocker.utils.DockerBase
19+
osxdocker.utils.warn
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:caption: Contents:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
osxdocker.DockerLogs
2+
====================
3+
4+
.. currentmodule:: osxdocker
5+
6+
.. autoclass:: DockerLogs
7+
8+
9+
.. automethod:: __init__
10+
11+
12+
.. rubric:: Methods
13+
14+
.. autosummary::
15+
16+
~DockerLogs.__init__
17+
~DockerLogs.cat_log
18+
~DockerLogs.clear_log
19+
~DockerLogs.log_path
20+
~DockerLogs.version
21+
22+
23+
24+
25+
26+

0 commit comments

Comments
 (0)