1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-15 05:35:00 +00:00

Cleaned up docs/

- Linted
- Changed Github-Api-Wrapper to GitHub-API-Wrapper
This commit is contained in:
RGBCube 2022-06-25 14:07:43 +03:00
parent a33985c69b
commit f6b9852167
10 changed files with 219 additions and 174 deletions

View file

@ -6,8 +6,8 @@ import sys
# 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.
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('extensions'))
sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("extensions"))
# -- General configuration ------------------------------------------------
@ -18,34 +18,34 @@ sys.path.append(os.path.abspath('extensions'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'builder',
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinxcontrib_trio',
'details',
'exception_hierarchy',
'attributetable',
'resourcelinks',
'nitpick_file_ignorer',
"builder",
"sphinx.ext.autodoc",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinxcontrib_trio",
"details",
"exception_hierarchy",
"attributetable",
"resourcelinks",
"nitpick_file_ignorer",
]
autodoc_member_order = 'bysource'
autodoc_typehints = 'none'
autodoc_member_order = "bysource"
autodoc_typehints = "none"
# autodoc_mock_imports = ['sphinxcontrib_trio','sphinxcontrib-serializinghtml','sphinxcontrib-qthelp','sphinxcontrib-jsmath','sphinxcontrib-htmlhelp','sphinxcontrib-devhelp','sphinxcontrib-applehelp ','typing_extensions']
# maybe consider this?
# napoleon_attr_annotations = False
extlinks = {
'issue': ('https://github.com/VarMonke/Github-Api-Wrapper/issues/%s', 'GH-'),
"issue": ("https://github.com/Varmonke/GitHub-API-Wrapper/issues/%s", "GH-"),
}
# Links used for cross-referencing stuff in other documentation
intersphinx_mapping = {
'py': ('https://docs.python.org/3', None),
'aio': ('https://docs.aiohttp.org/en/stable/', None),
'req': ('https://docs.python-requests.org/en/latest/', None),
"py": ("https://docs.python.org/3", None),
"aio": ("https://docs.aiohttp.org/en/stable/", None),
"req": ("https://docs.python-requests.org/en/latest/", None),
}
rst_prolog = """
@ -56,20 +56,20 @@ rst_prolog = """
"""
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
master_doc = "index"
# General information about the project.
project = 'Github-API-Wrapper'
copyright = '2022 - Present, VarMonke & sudosnok'
project = "GitHub-API-Wrapper"
copyright = "2022-present, VarMonke, sudosnok & contributors"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -77,15 +77,15 @@ copyright = '2022 - Present, VarMonke & sudosnok'
#
# The short X.Y version.
version = ''
with open('../github/__init__.py') as f:
version = ""
with open("../github/__init__.py") as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) # type: ignore
# The full version, including alpha/beta/rc tags.
release = version
# This assumes a tag is available for final releases
branch = 'master' if version.endswith('a') else f"v{version}"
branch = "master" if version.endswith("a") else f"v{version}"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -94,7 +94,7 @@ branch = 'master' if version.endswith('a') else f"v{version}"
# Usually you set "language" from the command line for these cases.
language = None
locale_dirs = ['locale/']
locale_dirs = ["locale/"]
gettext_compact = False
# There are two options for replacing |today|: either, you set today to some
@ -105,7 +105,7 @@ gettext_compact = False
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all
# documents.
@ -123,7 +123,7 @@ exclude_patterns = ['_build']
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'friendly'
pygments_style = "friendly"
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
@ -136,13 +136,13 @@ pygments_style = 'friendly'
def _i18n_warning_filter(record: logging.LogRecord) -> bool:
return not record.msg.startswith(
(
'inconsistent references in translated message',
'inconsistent term references in translated message',
"inconsistent references in translated message",
"inconsistent term references in translated message",
)
)
_i18n_logger = logging.getLogger('sphinx')
_i18n_logger = logging.getLogger("sphinx")
_i18n_logger.addFilter(_i18n_warning_filter)
# -- Options for HTML output ----------------------------------------------
@ -151,21 +151,21 @@ html_experimental_html5_writer = True
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'basic'
html_theme = "basic"
html_context = {
'discord_invite': 'https://discord.gg/r3sSKJJ',
'discord_extensions': [
('discord.ext.commands', 'ext/commands'),
('discord.ext.tasks', 'ext/tasks'),
"discord_invite": "https://discord.gg/r3sSKJJ",
"discord_extensions": [
("discord.ext.commands", "ext/commands"),
("discord.ext.tasks", "ext/tasks"),
],
}
resource_links = {
'discord': 'https://discord.gg/W2SDTtMrZA',
'issues': 'https://github.com/VarMonke/Github-Api-Wrapper/issues',
'discussions': 'https://github.com/VarMonke/Github-Api-Wrapper/discussions',
'examples': f'https://github.com/VarMonke/Github-Api-Wrapper/examples',
"discord": "https://discord.gg/W2SDTtMrZA",
"issues": "https://github.com/Varmonke/GitHub-API-Wrapper/issues",
"discussions": "https://github.com/Varmonke/GitHub-API-Wrapper/discussions",
"examples": f"https://github.com/Varmonke/GitHub-API-Wrapper/examples",
}
# Theme options are theme-specific and customize the look and feel of a theme
@ -191,12 +191,12 @@ resource_links = {
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = './images/icon.ico'
html_favicon = "./images/icon.ico"
# 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']
html_static_path = ["_static"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
@ -256,12 +256,12 @@ html_static_path = ['_static']
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
html_search_scorer = '_static/scorer.js'
html_search_scorer = "_static/scorer.js"
html_js_files = ['custom.js', 'settings.js', 'copy.js', 'sidebar.js']
html_js_files = ["custom.js", "settings.js", "copy.js", "sidebar.js"]
# Output file base name for HTML help builder.
htmlhelp_basename = 'Github-API-Wrapper.doc'
htmlhelp_basename = "GitHub-API-Wrapper.doc"
# -- Options for LaTeX output ---------------------------------------------
@ -280,7 +280,13 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'Github-API-Wrapper.tex', 'Github-API-Wrapper Documentation', 'VarMonke & sudosnok', 'manual'),
(
"index",
"GitHub-API-Wrapper.tex",
"GitHub-API-Wrapper Documentation",
"VarMonke, sudosnok & contributors",
"manual",
),
]
# The name of an image file (relative to this directory) to place at the top of
@ -308,7 +314,15 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [('index', 'Github-API-Wrapper', 'Github-API-Wrapper Documentation', ['VarMonke & sudosnok'], 1)]
man_pages = [
(
"index",
"GitHub-API-Wrapper",
"GitHub-API-Wrapper Documentation",
["VarMonke, sudosnok & contributors"],
1,
)
]
# If true, show URL addresses after external links.
# man_show_urls = False
@ -321,13 +335,13 @@ man_pages = [('index', 'Github-API-Wrapper', 'Github-API-Wrapper Documentation',
# dir menu entry, description, category)
texinfo_documents = [
(
'index',
'Github-API-Wrapper',
'Github-API-Wrapper Documentation',
'VarMonke & sudosnok',
'Github-API-Wrapper',
'One line description of project.',
'Miscellaneous',
"index",
"GitHub-API-Wrapper",
"GitHub-API-Wrapper Documentation",
"VarMonke, sudosnok & contributors",
"GitHub-API-Wrapper",
"One line description of project.",
"Miscellaneous",
),
]
@ -345,7 +359,7 @@ texinfo_documents = [
def setup(app):
if app.config.language == 'ja':
app.config.intersphinx_mapping['py'] = ('https://docs.python.org/ja/3', None)
app.config.html_context['discord_invite'] = 'W2SDTtMrZA'
app.config.resource_links['discord'] = 'W2SDTtMrZA'
if app.config.language == "ja":
app.config.intersphinx_mapping["py"] = ("https://docs.python.org/ja/3", None)
app.config.html_context["discord_invite"] = "W2SDTtMrZA"
app.config.resource_links["discord"] = "W2SDTtMrZA"