Skip to content

Commit 586c9a6

Browse files
committed
Update docs for rtd and switch generate style list to rst
1 parent 9ae8729 commit 586c9a6

File tree

12 files changed

+722
-86
lines changed

12 files changed

+722
-86
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ instance/
7070

7171
# Sphinx documentation
7272
docs/_build/
73+
generated
74+
docs/source/_build/
7375

7476
# PyBuilder
7577
target/

docs/source/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, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
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/source/api.rst

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
1-
API
2-
===
1+
.. currentmodule:: table2ascii
32

4-
.. autosummary::
5-
:toctree: generated
3+
API Reference
4+
=============
65

7-
table2ascii
8-
9-
TableToAscii
10-
~~~~~~~~~~~~~
6+
table2ascii
7+
~~~~~~~~~~~
118

12-
.. attributetable:: TableToAscii
9+
.. autofunction:: table2ascii
1310

14-
.. autoclass:: TableToAscii
15-
:members:
1611

1712
Alignment
18-
~~~~~~~~~~
19-
20-
.. attributetable:: Alignment
13+
~~~~~~~~~
2114

22-
.. autoclass:: Alignment
15+
.. autoenum:: Alignment
2316
:members:
2417

25-
TableStyle
18+
PresetStyle
2619
~~~~~~~~~~~
2720

28-
.. attributetable:: TableStyle
29-
30-
.. autoclass:: TableStyle
21+
.. autoclass:: PresetStyle
3122
:members:
3223

33-
PresetStyle
34-
~~~~~~~~~~~~
35-
36-
.. attributetable:: PresetStyle
24+
TableStyle
25+
~~~~~~~~~~
3726

38-
.. autoclass:: PresetStyle
39-
:members:
27+
.. autoclass:: TableStyle
28+
:members:

docs/source/conf.py

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,62 @@
11
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
26

3-
# -- Project information
7+
# -- Path setup --------------------------------------------------------------
48

5-
project = 'table2ascii'
6-
copyright = '2021, Jonah Lawrence'
7-
author = 'Jonah Lawrence'
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
815

9-
release = '0.1.2'
10-
version = '0.1.2'
16+
sys.path.insert(0, os.path.abspath("."))
17+
sys.path.append(os.path.abspath("extensions"))
1118

12-
# -- General configuration
1319

20+
# -- Project information -----------------------------------------------------
21+
22+
project = "table2ascii"
23+
copyright = "2021, Jonah Lawrence"
24+
author = "Jonah Lawrence"
25+
26+
27+
# -- General configuration ---------------------------------------------------
28+
29+
# Add any Sphinx extension module names here, as strings. They can be
30+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
31+
# ones.
1432
extensions = [
15-
'sphinx.ext.duration',
16-
'sphinx.ext.doctest',
17-
'sphinx.ext.autodoc',
18-
'sphinx.ext.autosummary',
19-
'sphinx.ext.intersphinx',
33+
"sphinx.ext.duration",
34+
"sphinx.ext.doctest",
35+
"sphinx.ext.autodoc",
36+
"sphinx.ext.autosummary",
37+
"sphinx.ext.intersphinx",
38+
"enum_tools.autoenum",
2039
]
2140

22-
intersphinx_mapping = {
23-
'python': ('https://docs.python.org/3/', None),
24-
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
25-
}
26-
intersphinx_disabled_domains = ['std']
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ["_templates"]
2743

28-
templates_path = ['_templates']
44+
# List of patterns, relative to source directory, that match files and
45+
# directories to ignore when looking for source files.
46+
# This pattern also affects html_static_path and html_extra_path.
47+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
2948

3049
# -- Options for HTML output
3150

32-
html_theme = 'sphinx_rtd_theme'
51+
# The theme to use for HTML and HTML Help pages. See the documentation for
52+
# a list of builtin themes.
53+
#
54+
html_theme = "sphinx_rtd_theme"
55+
56+
# Add any paths that contain custom static files (such as style sheets) here,
57+
# relative to this directory. They are copied after the builtin static files,
58+
# so a file named "default.css" will overwrite the builtin "default.css".
59+
html_static_path = ["_static"]
3360

3461
# -- Options for EPUB output
35-
epub_show_urls = 'footnote'
62+
epub_show_urls = "footnote"

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Contents
2121

2222
usage
2323
api
24+
styles
2425

2526

2627
.. |build| image:: https://img.shields.io/github/workflow/status/DenverCoder1/table2ascii/Python%20application/main

docs/source/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)