-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented documentation and API docs build via Sphinx and fixed doc…
…strings
- Loading branch information
Showing
18 changed files
with
238 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ __pycache__/ | |
/build/ | ||
/dist/ | ||
/src/*.egg-info/ | ||
/docs/api/*.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: 2 | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
apt_packages: | ||
- libcurl4-openssl-dev | ||
tools: | ||
python: "3" | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
fail_on_warning: true | ||
|
||
formats: | ||
- htmlzip | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import subprocess # nosec | ||
from importlib import metadata | ||
|
||
|
||
project = 'curldl' | ||
copyright = '2023, Michael Orlov' | ||
|
||
release = metadata.version(project) | ||
version = '.'.join(release.split('.')[:2]) | ||
release = '.'.join(release.split('.')[:3]) | ||
|
||
nitpicky = True | ||
|
||
extensions = [ | ||
'myst_parser', | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.autosectionlabel', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.viewcode', | ||
'sphinx_copybutton' | ||
] | ||
|
||
source_suffix = { | ||
'.md': 'markdown', | ||
'.rst': 'restructuredtext' | ||
} | ||
|
||
exclude_patterns = [ | ||
'CHANGELOG.md', | ||
'changelog.d/**' | ||
] | ||
|
||
suppress_warnings = [ | ||
'autosectionlabel.*' | ||
] | ||
|
||
myst_enable_extensions = [ | ||
'colon_fence', | ||
'deflist', | ||
'dollarmath', | ||
'fieldlist', | ||
'linkify', | ||
'replacements', | ||
'smartquotes', | ||
'strikethrough' | ||
] | ||
|
||
myst_linkify_fuzzy_links = False | ||
|
||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3/', None), | ||
'pycurl': ('http://pycurl.io/docs/latest/', None), | ||
'tenacity': ('https://tenacity.readthedocs.io/en/latest/', None) | ||
} | ||
|
||
nitpick_ignore = [ | ||
('py:class', 'tqdm'), | ||
('py:exc', 'argparse.ArgumentError'), | ||
('py:exc', 'metadata.PackageNotFoundError'), | ||
('py:class', 'pycurl.error'), | ||
('py:exc', 'pycurl.error') | ||
] | ||
|
||
html_theme = 'furo' | ||
|
||
html_theme_options = { | ||
'navigation_with_keys': True, | ||
'top_of_page_button': None | ||
} | ||
|
||
autoclass_content = 'both' | ||
|
||
autodoc_default_options = { | ||
'members': True, | ||
'private-members': True, | ||
'undoc-members': True, | ||
'special-members': True, | ||
'member-order': 'bysource' | ||
} | ||
|
||
autodoc_typehints = "both" | ||
autodoc_typehints_description_target = "documented" | ||
|
||
subprocess.run(f'sphinx-apidoc -feM -o api ../src/curldl'.split(), # nosec | ||
check=True, text=True, encoding='ascii') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
```{include} readme.md | ||
:end-before: "# Installation" | ||
``` | ||
|
||
|
||
```{toctree} | ||
:hidden: | ||
readme.md | ||
API Reference <api/modules.rst> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
script_dir=${0%/*} | ||
[ "${script_dir}" != "$0" ] || script_dir=. | ||
|
||
project_dir="${script_dir}/../.." | ||
docs_root="docs" | ||
build_docs_root="build/docs" | ||
doctrees_root="build/tests/doctrees" | ||
|
||
cd "${project_dir}" | ||
sphinx-build -vW -d "${doctrees_root}" "${docs_root}" "${build_docs_root}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.