-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new base for docs #450
Merged
kevinkjt2000
merged 3 commits into
py-mine:sphinx-docs
from
PerchunPak:create-new-base-for-documentation
Jan 1, 2023
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
version: 2 | ||
|
||
build: | ||
os: ubuntu-20.04 | ||
tools: | ||
python: "3.10" | ||
python: "3.11" | ||
jobs: | ||
post_install: | ||
- pip install poetry | ||
- poetry config virtualenvs.create false | ||
- poetry install --only docs | ||
- poetry run poetry-dynamic-versioning | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs | ||
builder: dirhtml | ||
configuration: "docs/conf.py" | ||
fail_on_warning: true |
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
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 |
---|---|---|
@@ -1,53 +1,146 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
"""Configuration file for the Sphinx documentation builder. | ||
|
||
This file does only contain a selection of the most common options. For a | ||
full list see the documentation: | ||
http://www.sphinx-doc.org/en/master/config | ||
""" | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
|
||
from __future__ import annotations | ||
|
||
import os | ||
import sys | ||
from datetime import date | ||
|
||
from packaging.version import parse as parse_version | ||
|
||
if sys.version_info >= (3, 11): | ||
from tomllib import load as toml_parse | ||
else: | ||
from tomli import load as toml_parse | ||
|
||
sys.path.insert(0, os.path.abspath("..")) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = "mcstatus" | ||
copyright = "2022, Nathan Adams" | ||
author = "Nathan Adams" | ||
|
||
def _get_project_meta() -> dict[str, str]: | ||
with open("../pyproject.toml", "rb") as pyproject: | ||
return toml_parse(pyproject)["tool"]["poetry"] # type: ignore[no-any-return] | ||
|
||
|
||
pkg_meta = _get_project_meta() | ||
project = str(pkg_meta["name"]) | ||
copyright = str(date.today().year) + ", py-mine" | ||
author = "py-mine" | ||
|
||
parsed_version = parse_version(pkg_meta["version"]) | ||
|
||
# The short X.Y version | ||
version = parsed_version.base_version | ||
# The full version, including alpha/beta/rc tags | ||
release = str(parsed_version) | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# extensions coming with Sphinx (named "sphinx.ext.*") or your custom | ||
# ones. | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.todo", | ||
"sphinx.ext.coverage", | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.autosectionlabel", | ||
# Used to reference for third party projects: | ||
"sphinx.ext.intersphinx", | ||
# Used to write beautiful docstrings: | ||
"sphinx.ext.napoleon", | ||
# Used to include .md files: | ||
"m2r2", | ||
# Used to insert typehints into the final docs: | ||
"sphinx_autodoc_typehints", | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ["_templates"] | ||
autoclass_content = "class" | ||
autodoc_member_order = "bysource" | ||
|
||
autodoc_default_flags = { | ||
"members": "", | ||
"undoc-members": "code,error_template", | ||
"exclude-members": "__dict__,__weakref__", | ||
} | ||
|
||
# Set `typing.TYPE_CHECKING` to `True`: | ||
# https://pypi.org/project/sphinx-autodoc-typehints/ | ||
set_type_checking_flag = True | ||
|
||
# Automatically generate section labels: | ||
autosectionlabel_prefix_document = True | ||
|
||
# The suffix(es) of source filenames. | ||
# You can specify multiple suffix as a list of string: | ||
|
||
source_suffix = [".rst", ".md"] | ||
|
||
# The master toctree document. | ||
master_doc = "index" | ||
|
||
# The language for content autogenerated by Sphinx. Refer to documentation | ||
# for a list of supported languages. | ||
# | ||
# This is also used if you do content translation via gettext catalogs. | ||
# Usually you set "language" from the command line for these cases. | ||
language = "en" | ||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = [] | ||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = "sphinx" | ||
|
||
add_module_names = False | ||
|
||
autodoc_default_options = { | ||
"show-inheritance": True, | ||
} | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = "furo" | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ["_static"] | ||
# Theme options are theme-specific and customize the look and feel of a theme | ||
# further. For a list of options available for each theme, see the | ||
# documentation. | ||
html_theme_options = { | ||
"navigation_with_keys": True, | ||
} | ||
|
||
# -- Extension configuration ------------------------------------------------- | ||
|
||
napoleon_include_private_with_doc = True | ||
napoleon_use_admonition_for_examples = True | ||
napoleon_use_admonition_for_references = True | ||
|
||
# Third-party projects documentation references: | ||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3", None), | ||
} | ||
|
||
|
||
# -- Options for todo extension ---------------------------------------------- | ||
|
||
# If true, `todo` and `todoList` produce output, else they produce nothing. | ||
todo_include_todos = True |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to still give attribution to dinnerbone here. I'll look for a way to add
py-mine
to the list in pyproject.toml and usepkg_meta["authors"]
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice that you mentioned Dinnerbone as author before, here it was just generated value.