Docs base plate?
189
docs/Makefile
|
@ -1,20 +1,183 @@
|
||||||
# Minimal makefile for Sphinx documentation
|
# Makefile for Sphinx documentation
|
||||||
#
|
#
|
||||||
|
|
||||||
# You can set these variables from the command line, and also
|
# You can set these variables from the command line.
|
||||||
# from the environment for the first two.
|
SPHINXOPTS =
|
||||||
SPHINXOPTS ?=
|
SPHINXBUILD = sphinx-build
|
||||||
SPHINXBUILD ?= sphinx-build
|
PAPER =
|
||||||
SOURCEDIR = .
|
|
||||||
BUILDDIR = _build
|
BUILDDIR = _build
|
||||||
|
|
||||||
# Put it first so that "make" without argument is like "make help".
|
# User-friendly check for sphinx-build
|
||||||
|
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||||
|
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Internal variables.
|
||||||
|
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||||
|
PAPEROPT_letter = -D latex_paper_size=letter
|
||||||
|
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||||
|
# the i18n builder cannot share the environment and doctrees with the others
|
||||||
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||||
|
|
||||||
|
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@echo "Please use \`make <target>' where <target> is one of"
|
||||||
|
@echo " html to make standalone HTML files"
|
||||||
|
@echo " dirhtml to make HTML files named index.html in directories"
|
||||||
|
@echo " singlehtml to make a single large HTML file"
|
||||||
|
@echo " pickle to make pickle files"
|
||||||
|
@echo " json to make JSON files"
|
||||||
|
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||||
|
@echo " qthelp to make HTML files and a qthelp project"
|
||||||
|
@echo " devhelp to make HTML files and a Devhelp project"
|
||||||
|
@echo " epub to make an epub"
|
||||||
|
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||||
|
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||||
|
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||||
|
@echo " text to make text files"
|
||||||
|
@echo " man to make manual pages"
|
||||||
|
@echo " texinfo to make Texinfo files"
|
||||||
|
@echo " info to make Texinfo files and run them through makeinfo"
|
||||||
|
@echo " gettext to make PO message catalogs"
|
||||||
|
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||||
|
@echo " xml to make Docutils-native XML files"
|
||||||
|
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||||
|
@echo " linkcheck to check all external links for integrity"
|
||||||
|
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||||
|
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||||
|
|
||||||
.PHONY: help Makefile
|
clean:
|
||||||
|
rm -rf $(BUILDDIR)/*
|
||||||
|
|
||||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
html:
|
||||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||||
%: Makefile
|
@echo
|
||||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||||
|
|
||||||
|
dirhtml:
|
||||||
|
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||||
|
|
||||||
|
singlehtml:
|
||||||
|
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||||
|
|
||||||
|
pickle:
|
||||||
|
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||||
|
@echo
|
||||||
|
@echo "Build finished; now you can process the pickle files."
|
||||||
|
|
||||||
|
json:
|
||||||
|
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||||
|
@echo
|
||||||
|
@echo "Build finished; now you can process the JSON files."
|
||||||
|
|
||||||
|
htmlhelp:
|
||||||
|
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||||
|
@echo
|
||||||
|
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||||
|
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||||
|
|
||||||
|
qthelp:
|
||||||
|
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||||
|
@echo
|
||||||
|
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||||
|
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||||
|
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/discord.py.qhcp"
|
||||||
|
@echo "To view the help file:"
|
||||||
|
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/discord.py.qhc"
|
||||||
|
|
||||||
|
devhelp:
|
||||||
|
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||||
|
@echo
|
||||||
|
@echo "Build finished."
|
||||||
|
@echo "To view the help file:"
|
||||||
|
@echo "# mkdir -p $$HOME/.local/share/devhelp/discord.py"
|
||||||
|
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/discord.py"
|
||||||
|
@echo "# devhelp"
|
||||||
|
|
||||||
|
epub:
|
||||||
|
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||||
|
|
||||||
|
latex:
|
||||||
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||||
|
@echo
|
||||||
|
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||||
|
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||||
|
"(use \`make latexpdf' here to do that automatically)."
|
||||||
|
|
||||||
|
latexpdf:
|
||||||
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||||
|
@echo "Running LaTeX files through pdflatex..."
|
||||||
|
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||||
|
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||||
|
|
||||||
|
latexpdfja:
|
||||||
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||||
|
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||||
|
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||||
|
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||||
|
|
||||||
|
text:
|
||||||
|
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||||
|
|
||||||
|
man:
|
||||||
|
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||||
|
|
||||||
|
texinfo:
|
||||||
|
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||||
|
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||||
|
"(use \`make info' here to do that automatically)."
|
||||||
|
|
||||||
|
info:
|
||||||
|
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||||
|
@echo "Running Texinfo files through makeinfo..."
|
||||||
|
make -C $(BUILDDIR)/texinfo info
|
||||||
|
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||||
|
|
||||||
|
gettext:
|
||||||
|
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||||
|
|
||||||
|
changes:
|
||||||
|
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||||
|
@echo
|
||||||
|
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||||
|
|
||||||
|
linkcheck:
|
||||||
|
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||||
|
@echo
|
||||||
|
@echo "Link check complete; look for any errors in the above output " \
|
||||||
|
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||||
|
|
||||||
|
doctest:
|
||||||
|
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||||
|
@echo "Testing of doctests in the sources finished, look at the " \
|
||||||
|
"results in $(BUILDDIR)/doctest/output.txt."
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||||
|
@echo "Testing of coverage in the sources finished, look at the " \
|
||||||
|
"results in $(BUILDDIR)/coverage/python.txt."
|
||||||
|
|
||||||
|
xml:
|
||||||
|
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||||
|
|
||||||
|
pseudoxml:
|
||||||
|
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||||
|
@echo
|
||||||
|
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||||
|
|
143
docs/_static/codeblocks.css
vendored
Normal file
|
@ -0,0 +1,143 @@
|
||||||
|
/* light theme: default */
|
||||||
|
.highlight .hll { background-color: #ffffcc }
|
||||||
|
.highlight { background: #f0f0f0; }
|
||||||
|
.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
|
||||||
|
.highlight .err { border: 1px solid #FF0000 } /* Error */
|
||||||
|
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
|
||||||
|
.highlight .o { color: #666666 } /* Operator */
|
||||||
|
.highlight .ch { color: #60a0b0; font-style: italic } /* Comment.Hashbang */
|
||||||
|
.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
|
||||||
|
.highlight .cp { color: #007020 } /* Comment.Preproc */
|
||||||
|
.highlight .cpf { color: #60a0b0; font-style: italic } /* Comment.PreprocFile */
|
||||||
|
.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
|
||||||
|
.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
|
||||||
|
.highlight .gd { color: #A00000 } /* Generic.Deleted */
|
||||||
|
.highlight .ge { font-style: italic } /* Generic.Emph */
|
||||||
|
.highlight .gr { color: #FF0000 } /* Generic.Error */
|
||||||
|
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||||
|
.highlight .gi { color: #00A000 } /* Generic.Inserted */
|
||||||
|
.highlight .go { color: #888888 } /* Generic.Output */
|
||||||
|
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
|
||||||
|
.highlight .gs { font-weight: bold } /* Generic.Strong */
|
||||||
|
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
|
||||||
|
.highlight .gt { color: #0044DD } /* Generic.Traceback */
|
||||||
|
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
|
||||||
|
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
|
||||||
|
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
|
||||||
|
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
|
||||||
|
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
|
||||||
|
.highlight .kt { color: #902000 } /* Keyword.Type */
|
||||||
|
.highlight .m { color: #40a070 } /* Literal.Number */
|
||||||
|
.highlight .s { color: #4070a0 } /* Literal.String */
|
||||||
|
.highlight .na { color: #4070a0 } /* Name.Attribute */
|
||||||
|
.highlight .nb { color: #007020 } /* Name.Builtin */
|
||||||
|
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
|
||||||
|
.highlight .no { color: #60add5 } /* Name.Constant */
|
||||||
|
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
|
||||||
|
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
|
||||||
|
.highlight .ne { color: #007020 } /* Name.Exception */
|
||||||
|
.highlight .nf { color: #06287e } /* Name.Function */
|
||||||
|
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
|
||||||
|
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
|
||||||
|
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
|
||||||
|
.highlight .nv { color: #bb60d5 } /* Name.Variable */
|
||||||
|
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
|
||||||
|
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
|
||||||
|
.highlight .mb { color: #40a070 } /* Literal.Number.Bin */
|
||||||
|
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
|
||||||
|
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
|
||||||
|
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
|
||||||
|
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
|
||||||
|
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
|
||||||
|
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
|
||||||
|
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
|
||||||
|
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
|
||||||
|
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
|
||||||
|
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
|
||||||
|
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
|
||||||
|
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
|
||||||
|
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
|
||||||
|
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
|
||||||
|
.highlight .sr { color: #235388 } /* Literal.String.Regex */
|
||||||
|
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
|
||||||
|
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
|
||||||
|
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
|
||||||
|
.highlight .fm { color: #06287e } /* Name.Function.Magic */
|
||||||
|
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
|
||||||
|
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
|
||||||
|
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
|
||||||
|
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
|
||||||
|
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
|
||||||
|
|
||||||
|
/* dark theme: modified "native" */
|
||||||
|
:root[data-theme="dark"] .highlight pre { background-color: #2a2a2e }
|
||||||
|
:root[data-theme="dark"] .highlight .hll { background-color: #2a2a2e }
|
||||||
|
:root[data-theme="dark"] .highlight .c { color: #999999; font-style: italic } /* Comment */
|
||||||
|
:root[data-theme="dark"] .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
|
||||||
|
:root[data-theme="dark"] .highlight .g { color: #d0d0d0 } /* Generic */
|
||||||
|
:root[data-theme="dark"] .highlight .k { color: #6ab825; font-weight: bold } /* Keyword */
|
||||||
|
:root[data-theme="dark"] .highlight .l { color: #d0d0d0 } /* Literal */
|
||||||
|
:root[data-theme="dark"] .highlight .n { color: #d0d0d0 } /* Name */
|
||||||
|
:root[data-theme="dark"] .highlight .o { color: #d0d0d0 } /* Operator */
|
||||||
|
:root[data-theme="dark"] .highlight .x { color: #d0d0d0 } /* Other */
|
||||||
|
:root[data-theme="dark"] .highlight .p { color: #d0d0d0 } /* Punctuation */
|
||||||
|
:root[data-theme="dark"] .highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */
|
||||||
|
:root[data-theme="dark"] .highlight .cp { color: #cd2828; font-weight: bold } /* Comment.Preproc */
|
||||||
|
:root[data-theme="dark"] .highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */
|
||||||
|
:root[data-theme="dark"] .highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
|
||||||
|
:root[data-theme="dark"] .highlight .gd { color: #d22323 } /* Generic.Deleted */
|
||||||
|
:root[data-theme="dark"] .highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
|
||||||
|
:root[data-theme="dark"] .highlight .gr { color: #d22323 } /* Generic.Error */
|
||||||
|
:root[data-theme="dark"] .highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
|
||||||
|
:root[data-theme="dark"] .highlight .gi { color: #589819 } /* Generic.Inserted */
|
||||||
|
:root[data-theme="dark"] .highlight .go { color: #cccccc } /* Generic.Output */
|
||||||
|
:root[data-theme="dark"] .highlight .gp { color: #aaaaaa } /* Generic.Prompt */
|
||||||
|
:root[data-theme="dark"] .highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */
|
||||||
|
:root[data-theme="dark"] .highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
|
||||||
|
:root[data-theme="dark"] .highlight .gt { color: #d22323 } /* Generic.Traceback */
|
||||||
|
:root[data-theme="dark"] .highlight .kc { color: #6ab825; font-weight: bold } /* Keyword.Constant */
|
||||||
|
:root[data-theme="dark"] .highlight .kd { color: #6ab825; font-weight: bold } /* Keyword.Declaration */
|
||||||
|
:root[data-theme="dark"] .highlight .kn { color: #6ab825; font-weight: bold } /* Keyword.Namespace */
|
||||||
|
:root[data-theme="dark"] .highlight .kp { color: #6ab825 } /* Keyword.Pseudo */
|
||||||
|
:root[data-theme="dark"] .highlight .kr { color: #6ab825; font-weight: bold } /* Keyword.Reserved */
|
||||||
|
:root[data-theme="dark"] .highlight .kt { color: #6ab825; font-weight: bold } /* Keyword.Type */
|
||||||
|
:root[data-theme="dark"] .highlight .ld { color: #d0d0d0 } /* Literal.Date */
|
||||||
|
:root[data-theme="dark"] .highlight .m { color: #7fb1d7 } /* Literal.Number */
|
||||||
|
:root[data-theme="dark"] .highlight .s { color: #ed9d13 } /* Literal.String */
|
||||||
|
:root[data-theme="dark"] .highlight .na { color: #bbbbbb; } /* Name.Attribute */
|
||||||
|
:root[data-theme="dark"] .highlight .nb { color: #29a5b3; } /* Name.Builtin */
|
||||||
|
:root[data-theme="dark"] .highlight .nc { color: #6494d8;} /* Name.Class */
|
||||||
|
:root[data-theme="dark"] .highlight .no { color: #40ffff; } /* Name.Constant */
|
||||||
|
:root[data-theme="dark"] .highlight .nd { color: #ffa500; } /* Name.Decorator */
|
||||||
|
:root[data-theme="dark"] .highlight .ni { color: #d0d0d0; } /* Name.Entity */
|
||||||
|
:root[data-theme="dark"] .highlight .ne { color: #bbbbbb; } /* Name.Exception */
|
||||||
|
:root[data-theme="dark"] .highlight .nf { color: #6494d8; } /* Name.Function */
|
||||||
|
:root[data-theme="dark"] .highlight .fm { color: #6494d8; } /* Name.Function.Magic */
|
||||||
|
:root[data-theme="dark"] .highlight .nl { color: #d0d0d0; } /* Name.Label */
|
||||||
|
:root[data-theme="dark"] .highlight .nn { color: #6494d8;} /* Name.Namespace */
|
||||||
|
:root[data-theme="dark"] .highlight .nx { color: #d0d0d0; } /* Name.Other */
|
||||||
|
:root[data-theme="dark"] .highlight .py { color: #d0d0d0; } /* Name.Property */
|
||||||
|
:root[data-theme="dark"] .highlight .nt { color: #6ab825; font-weight: bold } /* Name.Tag */
|
||||||
|
:root[data-theme="dark"] .highlight .nv { color: #40ffff; } /* Name.Variable */
|
||||||
|
:root[data-theme="dark"] .highlight .ow { color: #6ab825; font-weight: bold } /* Operator.Word */
|
||||||
|
:root[data-theme="dark"] .highlight .w { color: #666666; } /* Text.Whitespace */
|
||||||
|
:root[data-theme="dark"] .highlight .mf { color: #7fb1d7; } /* Literal.Number.Float */
|
||||||
|
:root[data-theme="dark"] .highlight .mh { color: #7fb1d7; } /* Literal.Number.Hex */
|
||||||
|
:root[data-theme="dark"] .highlight .mi { color: #7fb1d7; } /* Literal.Number.Integer */
|
||||||
|
:root[data-theme="dark"] .highlight .mo { color: #7fb1d7; } /* Literal.Number.Oct */
|
||||||
|
:root[data-theme="dark"] .highlight .sb { color: #ed9d13; } /* Literal.String.Backtick */
|
||||||
|
:root[data-theme="dark"] .highlight .sc { color: #ed9d13; } /* Literal.String.Char */
|
||||||
|
:root[data-theme="dark"] .highlight .sd { color: #ed9d13; } /* Literal.String.Doc */
|
||||||
|
:root[data-theme="dark"] .highlight .s2 { color: #ed9d13; } /* Literal.String.Double */
|
||||||
|
:root[data-theme="dark"] .highlight .se { color: #ed9d13; } /* Literal.String.Escape */
|
||||||
|
:root[data-theme="dark"] .highlight .sh { color: #ed9d13; } /* Literal.String.Heredoc */
|
||||||
|
:root[data-theme="dark"] .highlight .si { color: #ed9d13; } /* Literal.String.Interpol */
|
||||||
|
:root[data-theme="dark"] .highlight .sx { color: #ffa500; } /* Literal.String.Other */
|
||||||
|
:root[data-theme="dark"] .highlight .sr { color: #ed9d13; } /* Literal.String.Regex */
|
||||||
|
:root[data-theme="dark"] .highlight .s1 { color: #ed9d13; } /* Literal.String.Single */
|
||||||
|
:root[data-theme="dark"] .highlight .ss { color: #ed9d13; } /* Literal.String.Symbol */
|
||||||
|
:root[data-theme="dark"] .highlight .bp { color: #29a5b3; } /* Name.Builtin.Pseudo */
|
||||||
|
:root[data-theme="dark"] .highlight .vc { color: #40ffff; } /* Name.Variable.Class */
|
||||||
|
:root[data-theme="dark"] .highlight .vg { color: #40ffff; } /* Name.Variable.Global */
|
||||||
|
:root[data-theme="dark"] .highlight .vi { color: #40ffff; } /* Name.Variable.Instance */
|
||||||
|
:root[data-theme="dark"] .highlight .il { color: #7fb1d7; } /* Literal.Number.Integer.Long */
|
34
docs/_static/copy.js
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
const COPY = "content_copy";
|
||||||
|
const COPIED = "done";
|
||||||
|
|
||||||
|
const copy = async (obj) => {
|
||||||
|
// <span class="copy"><span class="material-icons">{{text}}</span></span>
|
||||||
|
await navigator.clipboard.writeText(obj.children[1].innerText).then(
|
||||||
|
() => {
|
||||||
|
let icon = obj.children[0].children[0];
|
||||||
|
icon.textContent = COPIED;
|
||||||
|
setTimeout(() => (icon.textContent = COPY), 2500);
|
||||||
|
},
|
||||||
|
(r) => alert('Could not copy codeblock:\n' + r.toString())
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
let allCodeblocks = document.querySelectorAll("div[class='highlight']");
|
||||||
|
|
||||||
|
for (let codeblock of allCodeblocks) {
|
||||||
|
codeblock.parentNode.className += " relative-copy";
|
||||||
|
let copyEl = document.createElement("span");
|
||||||
|
copyEl.addEventListener('click', () => copy(codeblock));
|
||||||
|
copyEl.className = "copy";
|
||||||
|
copyEl.setAttribute("aria-label", "Copy Code");
|
||||||
|
copyEl.setAttribute("title", "Copy Code");
|
||||||
|
|
||||||
|
let copyIcon = document.createElement("span");
|
||||||
|
copyIcon.className = "material-icons";
|
||||||
|
copyIcon.textContent = COPY;
|
||||||
|
copyEl.append(copyIcon);
|
||||||
|
|
||||||
|
codeblock.prepend(copyEl);
|
||||||
|
}
|
||||||
|
});
|
113
docs/_static/custom.js
vendored
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
'use-strict';
|
||||||
|
|
||||||
|
let activeModal = null;
|
||||||
|
let bottomHeightThreshold, sections;
|
||||||
|
let hamburgerToggle;
|
||||||
|
let mobileSearch;
|
||||||
|
let sidebar;
|
||||||
|
let toTop;
|
||||||
|
|
||||||
|
class Modal {
|
||||||
|
constructor(element) {
|
||||||
|
this.element = element;
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
activeModal = null;
|
||||||
|
this.element.style.display = 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
open() {
|
||||||
|
if (activeModal) {
|
||||||
|
activeModal.close();
|
||||||
|
}
|
||||||
|
activeModal = this;
|
||||||
|
this.element.style.display = 'flex'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchBar {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.box = document.querySelector('nav.mobile-only');
|
||||||
|
this.bar = document.querySelector('nav.mobile-only input[type="search"]');
|
||||||
|
this.openButton = document.getElementById('open-search');
|
||||||
|
this.closeButton = document.getElementById('close-search');
|
||||||
|
}
|
||||||
|
|
||||||
|
open() {
|
||||||
|
this.openButton.hidden = true;
|
||||||
|
this.closeButton.hidden = false;
|
||||||
|
this.box.style.top = "100%";
|
||||||
|
this.bar.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.openButton.hidden = false;
|
||||||
|
this.closeButton.hidden = true;
|
||||||
|
this.box.style.top = "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrollToTop() {
|
||||||
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
mobileSearch = new SearchBar();
|
||||||
|
|
||||||
|
bottomHeightThreshold = document.documentElement.scrollHeight - 30;
|
||||||
|
sections = document.querySelectorAll('section');
|
||||||
|
hamburgerToggle = document.getElementById('hamburger-toggle');
|
||||||
|
|
||||||
|
toTop = document.getElementById('to-top');
|
||||||
|
toTop.hidden = !(window.scrollY > 0);
|
||||||
|
|
||||||
|
if (hamburgerToggle) {
|
||||||
|
hamburgerToggle.addEventListener('click', (e) => {
|
||||||
|
sidebar.element.classList.toggle('sidebar-toggle');
|
||||||
|
let button = hamburgerToggle.firstElementChild;
|
||||||
|
if (button.textContent == 'menu') {
|
||||||
|
button.textContent = 'close';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
button.textContent = 'menu';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const tables = document.querySelectorAll('.py-attribute-table[data-move-to-id]');
|
||||||
|
tables.forEach(table => {
|
||||||
|
let element = document.getElementById(table.getAttribute('data-move-to-id'));
|
||||||
|
let parent = element.parentNode;
|
||||||
|
// insert ourselves after the element
|
||||||
|
parent.insertBefore(table, element.nextSibling);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('scroll', () => {
|
||||||
|
toTop.hidden = !(window.scrollY > 0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (event) => {
|
||||||
|
if (event.code == "Escape" && activeModal) {
|
||||||
|
activeModal.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function searchBarClick(event, which) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (event.button === 1 || event.buttons === 4) {
|
||||||
|
which.target = "_blank"; // Middle mouse button was clicked. Set our target to a new tab.
|
||||||
|
}
|
||||||
|
else if (event.button === 2) {
|
||||||
|
return // Right button was clicked... Don't do anything here.
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
which.target = "_self"; // Revert to same window.
|
||||||
|
}
|
||||||
|
|
||||||
|
which.submit();
|
||||||
|
}
|
10
docs/_static/icons.css
vendored
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Custom Icons';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: url('icons.woff') format('woff2');
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-icons {
|
||||||
|
font-family: 'Custom Icons' !important;
|
||||||
|
}
|
BIN
docs/_static/icons.woff
vendored
Normal file
83
docs/_static/scorer.js
vendored
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
'use-strict';
|
||||||
|
|
||||||
|
let queryBeingDone = null;
|
||||||
|
let pattern = null;
|
||||||
|
|
||||||
|
const escapedRegex = /[-\/\\^$*+?.()|[\]{}]/g;
|
||||||
|
function escapeRegex(e) {
|
||||||
|
return e.replace(escapedRegex, '\\$&');
|
||||||
|
}
|
||||||
|
|
||||||
|
// for some reason Sphinx shows some entries twice
|
||||||
|
// if something has been scored already I'd rather sort it to the bottom
|
||||||
|
const beenScored = new Set();
|
||||||
|
|
||||||
|
function __score(haystack, regex) {
|
||||||
|
let match = regex.exec(haystack);
|
||||||
|
if (match == null) {
|
||||||
|
return Number.MAX_VALUE;
|
||||||
|
}
|
||||||
|
let subLength = match[0].length;
|
||||||
|
let start = match.index;
|
||||||
|
return (subLength * 1000 + start) / 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unused for now
|
||||||
|
function __cleanNamespaces(query) {
|
||||||
|
return query.replace(/(discord\.(ext\.)?)?(.+)/, '$3');
|
||||||
|
}
|
||||||
|
|
||||||
|
Scorer = {
|
||||||
|
|
||||||
|
// Implement the following function to further tweak the score for each result
|
||||||
|
// The function takes a result array [filename, title, anchor, descr, score]
|
||||||
|
// and returns the new score.
|
||||||
|
score: (result) => {
|
||||||
|
// only inflate the score of things that are actual API reference things
|
||||||
|
const [, title, , , score] = result;
|
||||||
|
|
||||||
|
if (pattern !== null && title.startsWith('discord.')) {
|
||||||
|
let _score = __score(title, pattern);
|
||||||
|
if (_score === Number.MAX_VALUE) {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
if (beenScored.has(title)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
beenScored.add(title);
|
||||||
|
let newScore = 100 + queryBeingDone.length - _score;
|
||||||
|
// console.log(`${title}: ${score} -> ${newScore} (${_score})`);
|
||||||
|
return newScore;
|
||||||
|
}
|
||||||
|
return score;
|
||||||
|
},
|
||||||
|
|
||||||
|
// query matches the full name of an object
|
||||||
|
objNameMatch: 15,
|
||||||
|
// or matches in the last dotted part of the object name
|
||||||
|
objPartialMatch: 11,
|
||||||
|
// Additive scores depending on the priority of the object
|
||||||
|
objPrio: {
|
||||||
|
0: 15, // used to be importantResults
|
||||||
|
1: 7, // used to be objectResults
|
||||||
|
2: -5 // used to be unimportantResults
|
||||||
|
},
|
||||||
|
// Used when the priority is not in the mapping.
|
||||||
|
objPrioDefault: 0,
|
||||||
|
|
||||||
|
// query found in title
|
||||||
|
title: 15,
|
||||||
|
partialTitle: 7,
|
||||||
|
// query found in terms
|
||||||
|
term: 5,
|
||||||
|
partialTerm: 2
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
queryBeingDone = params.get('q');
|
||||||
|
if (queryBeingDone) {
|
||||||
|
let pattern = Array.from(queryBeingDone).map(escapeRegex).join('.*?');
|
||||||
|
pattern = new RegExp(pattern, 'i');
|
||||||
|
}
|
||||||
|
});
|
106
docs/_static/settings.js
vendored
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
'use-strict';
|
||||||
|
|
||||||
|
let settingsModal;
|
||||||
|
|
||||||
|
class Setting {
|
||||||
|
constructor(name, defaultValue, setter) {
|
||||||
|
this.name = name;
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
this.setValue = setter;
|
||||||
|
}
|
||||||
|
|
||||||
|
setElement() {
|
||||||
|
throw new TypeError('Abstract methods should be implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
load() {
|
||||||
|
let value = JSON.parse(localStorage.getItem(this.name));
|
||||||
|
this.value = value === null ? this.defaultValue : value;
|
||||||
|
try {
|
||||||
|
this.setValue(this.value);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to apply setting "${this.name}" With value:`, this.value);
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
throw new TypeError('Abstract methods should be implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class CheckboxSetting extends Setting {
|
||||||
|
|
||||||
|
setElement() {
|
||||||
|
let element = document.querySelector(`input[name=${this.name}]`);
|
||||||
|
element.checked = this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
update(element) {
|
||||||
|
localStorage.setItem(this.name, element.checked);
|
||||||
|
this.setValue(element.checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class RadioSetting extends Setting {
|
||||||
|
|
||||||
|
setElement() {
|
||||||
|
let element = document.querySelector(`input[name=${this.name}][value=${this.value}]`);
|
||||||
|
element.checked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
update(element) {
|
||||||
|
localStorage.setItem(this.name, `"${element.value}"`);
|
||||||
|
this.setValue(element.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRootAttributeToggle(attributeName, valueName) {
|
||||||
|
function toggleRootAttribute(set) {
|
||||||
|
if (set) {
|
||||||
|
document.documentElement.setAttribute(`data-${attributeName}`, valueName);
|
||||||
|
} else {
|
||||||
|
document.documentElement.removeAttribute(`data-${attributeName}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toggleRootAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTheme(value) {
|
||||||
|
if (value === 'automatic') {
|
||||||
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'dark');
|
||||||
|
} else {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'light');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.documentElement.setAttribute('data-theme', value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const settings = [
|
||||||
|
new CheckboxSetting('useSerifFont', false, getRootAttributeToggle('font', 'serif')),
|
||||||
|
new RadioSetting('setTheme', 'automatic', setTheme)
|
||||||
|
]
|
||||||
|
|
||||||
|
function updateSetting(element) {
|
||||||
|
let setting = settings.find((s) => s.name == element.name);
|
||||||
|
if (setting) {
|
||||||
|
setting.update(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const setting of settings) {
|
||||||
|
setting.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
settingsModal = new Modal(document.querySelector('div#settings.modal'));
|
||||||
|
for (const setting of settings) {
|
||||||
|
setting.setElement();
|
||||||
|
}
|
||||||
|
});
|
127
docs/_static/sidebar.js
vendored
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
class Sidebar {
|
||||||
|
constructor(element) {
|
||||||
|
this.element = element;
|
||||||
|
this.activeLink = null;
|
||||||
|
|
||||||
|
this.element.addEventListener('click', (e) => {
|
||||||
|
// If we click a navigation, close the hamburger menu
|
||||||
|
if (e.target.tagName == 'A' && this.element.classList.contains('sidebar-toggle')) {
|
||||||
|
this.element.classList.remove('sidebar-toggle');
|
||||||
|
let button = hamburgerToggle.firstElementChild;
|
||||||
|
button.textContent = 'menu';
|
||||||
|
|
||||||
|
// Scroll a little up to actually see the header
|
||||||
|
// Note: this is generally around ~55px
|
||||||
|
// A proper solution is getComputedStyle but it can be slow
|
||||||
|
// Instead let's just rely on this quirk and call it a day
|
||||||
|
// This has to be done after the browser actually processes
|
||||||
|
// the section movement
|
||||||
|
setTimeout(() => window.scrollBy(0, -100), 75);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createCollapsableSections() {
|
||||||
|
let toc = this.element.querySelector('ul');
|
||||||
|
if (!toc) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let allReferences = toc.querySelectorAll('a.reference.internal:not([href="#"])');
|
||||||
|
|
||||||
|
for (let ref of allReferences) {
|
||||||
|
|
||||||
|
let next = ref.nextElementSibling;
|
||||||
|
|
||||||
|
if (next && next.tagName === "UL") {
|
||||||
|
|
||||||
|
let icon = document.createElement('span');
|
||||||
|
icon.className = 'material-icons collapsible-arrow expanded';
|
||||||
|
icon.innerText = 'expand_more';
|
||||||
|
|
||||||
|
if (next.parentElement.tagName == "LI") {
|
||||||
|
next.parentElement.classList.add('no-list-style')
|
||||||
|
}
|
||||||
|
|
||||||
|
icon.addEventListener('click', () => {
|
||||||
|
if (icon.classList.contains('expanded')) {
|
||||||
|
this.collapseSection(icon);
|
||||||
|
} else {
|
||||||
|
this.expandSection(icon);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ref.classList.add('ref-internal-padding')
|
||||||
|
ref.parentNode.insertBefore(icon, ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resize() {
|
||||||
|
let rect = this.element.getBoundingClientRect();
|
||||||
|
this.element.style.height = `calc(100vh - 1em - ${rect.top + document.body.offsetTop}px)`;
|
||||||
|
}
|
||||||
|
|
||||||
|
collapseSection(icon) {
|
||||||
|
icon.classList.remove('expanded');
|
||||||
|
icon.classList.add('collapsed');
|
||||||
|
let children = icon.nextElementSibling.nextElementSibling;
|
||||||
|
// <arrow><heading>
|
||||||
|
// --> <square><children>
|
||||||
|
setTimeout(() => children.style.display = "none", 75)
|
||||||
|
}
|
||||||
|
|
||||||
|
expandSection(icon) {
|
||||||
|
icon.classList.remove('collapse');
|
||||||
|
icon.classList.add('expanded');
|
||||||
|
let children = icon.nextElementSibling.nextElementSibling;
|
||||||
|
setTimeout(() => children.style.display = "block", 75)
|
||||||
|
}
|
||||||
|
|
||||||
|
setActiveLink(section) {
|
||||||
|
if (this.activeLink) {
|
||||||
|
this.activeLink.parentElement.classList.remove('active');
|
||||||
|
}
|
||||||
|
if (section) {
|
||||||
|
this.activeLink = document.querySelector(`#sidebar a[href="#${section.id}"]`);
|
||||||
|
if (this.activeLink) {
|
||||||
|
let headingChildren = this.activeLink.parentElement.parentElement;
|
||||||
|
let heading = headingChildren.previousElementSibling.previousElementSibling;
|
||||||
|
|
||||||
|
if (heading && headingChildren.style.display === 'none') {
|
||||||
|
this.activeLink = heading;
|
||||||
|
}
|
||||||
|
this.activeLink.parentElement.classList.add('active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentSection() {
|
||||||
|
let currentSection;
|
||||||
|
if (window.scrollY + window.innerHeight > bottomHeightThreshold) {
|
||||||
|
currentSection = sections[sections.length - 1];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (sections) {
|
||||||
|
sections.forEach(section => {
|
||||||
|
let rect = section.getBoundingClientRect();
|
||||||
|
if (rect.top + document.body.offsetTop < 1) {
|
||||||
|
currentSection = section;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return currentSection;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
sidebar = new Sidebar(document.getElementById('sidebar'));
|
||||||
|
sidebar.resize();
|
||||||
|
sidebar.createCollapsableSections();
|
||||||
|
|
||||||
|
window.addEventListener('scroll', () => {
|
||||||
|
sidebar.setActiveLink(getCurrentSection());
|
||||||
|
sidebar.resize();
|
||||||
|
});
|
||||||
|
});
|
1353
docs/_static/style.css
vendored
Normal file
27
docs/_templates/genindex.html
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{%- extends "basic/genindex.html" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ super() }}
|
||||||
|
<!-- Inject some JavaScript to convert the index names into something useful. -->
|
||||||
|
<script>
|
||||||
|
let elements = document.querySelectorAll("table.indextable a");
|
||||||
|
|
||||||
|
// this is pretty finicky but it should work.
|
||||||
|
for(let el of elements) {
|
||||||
|
let key = el.getAttribute('href').split('#', 2)[1]
|
||||||
|
if(!key.startsWith('discord.')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(key.startsWith('discord.ext.')) {
|
||||||
|
key = key.substr(12); // discord.ext.
|
||||||
|
}
|
||||||
|
|
||||||
|
if(el.textContent.indexOf('()') !== -1) {
|
||||||
|
key = key + '()'
|
||||||
|
}
|
||||||
|
el.textContent = key;
|
||||||
|
}
|
||||||
|
document.querySelectorAll("td").forEach(el => el.style.width = 'auto');
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
196
docs/_templates/layout.html
vendored
Normal file
|
@ -0,0 +1,196 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||||
|
{%- block extrahead %} {% endblock %}
|
||||||
|
<!-- end extra head -->
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
{%- block css %}
|
||||||
|
{%- for css in css_files %}
|
||||||
|
{%- if css|attr("filename") %}
|
||||||
|
{{ css_tag(css) }}
|
||||||
|
{%- else %}
|
||||||
|
<link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endblock %}
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/style.css', 1)|e }}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/codeblocks.css', 1) }}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/icons.css', 1)|e }}" type="text/css" />
|
||||||
|
{%- block scripts %}
|
||||||
|
<script id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
|
||||||
|
{%- for js in script_files %}
|
||||||
|
{{ js_tag(js) }}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endblock %}
|
||||||
|
{%- if pageurl %}
|
||||||
|
<link rel="canonical" href="{{ pageurl|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if favicon %}
|
||||||
|
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1)|e }}"/>
|
||||||
|
{%- endif %}
|
||||||
|
{%- block linktags %}
|
||||||
|
{%- if hasdoc('about') %}
|
||||||
|
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('genindex') %}
|
||||||
|
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('search') %}
|
||||||
|
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('copyright') %}
|
||||||
|
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if next %}
|
||||||
|
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if prev %}
|
||||||
|
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- endblock %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{%- block header %}{% endblock %}
|
||||||
|
<div class="main-grid">
|
||||||
|
{#- The main navigation header #}
|
||||||
|
<header class="grid-item">
|
||||||
|
<nav>
|
||||||
|
<a href="{{ pathto(master_doc)|e }}" class="main-heading">Github-API-Wrapper</a>
|
||||||
|
<a href="https://github.com/VarMonke/Github-API-Wrapper" title="GitHub"><span class="material-icons custom-icons">github</span></a>
|
||||||
|
<a href="{{ discord_invite }}" title="{{ _('Discord') }}"><span class="material-icons custom-icons">discord</span></a>
|
||||||
|
<a href="{{ pathto('faq') }}" title="FAQ"><span class="material-icons">help_center</span></a>
|
||||||
|
{#- If we have more links we can put them here #}
|
||||||
|
<a onclick="mobileSearch.open();" title="{{ _('Search') }}" id="open-search" class="mobile-only"><span class="material-icons">search</span></a>
|
||||||
|
<a onclick="mobileSearch.close();" title="{{ _('Close') }}" id="close-search" class="mobile-only" hidden><span class="material-icons">close</span></a>
|
||||||
|
</nav>
|
||||||
|
<nav class="mobile-only">
|
||||||
|
<form role="search" class="search" action="{{ pathto('search') }}" method="get">
|
||||||
|
<div class="search-wrapper">
|
||||||
|
<input type="search" name="q" placeholder="{{ _('Search documentation') }}" />
|
||||||
|
<button type="submit">
|
||||||
|
<span class="material-icons">search</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<div class="sub-header grid-item">
|
||||||
|
<label for="documentation_select">{{ _('') }}</label>
|
||||||
|
{#- The sub-header with search and extension related selection #}
|
||||||
|
<form id="search-form" role="search" class="search" action="{{ pathto('search') }}" method="get">
|
||||||
|
<div class="search-wrapper">
|
||||||
|
<input type="search" name="q" placeholder="{{ _('Search documentation') }}" />
|
||||||
|
<button type="submit" onmousedown="searchBarClick(event, document.getElementById('search-form'));">
|
||||||
|
<span class="material-icons">search</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<a accesskey="S" class="settings" onclick="settingsModal.open();"><span class="material-icons">settings</span></a>
|
||||||
|
</div>
|
||||||
|
{#- The sidebar component #}
|
||||||
|
<aside class="grid-item">
|
||||||
|
{%- if display_toc %}
|
||||||
|
<span id="hamburger-toggle">
|
||||||
|
<span class="material-icons">menu</span>
|
||||||
|
</span>
|
||||||
|
{%- endif %}
|
||||||
|
<span id="settings-toggle" class="settings" onclick="settingsModal.open();">
|
||||||
|
<span class="material-icons">settings</span>
|
||||||
|
</span>
|
||||||
|
<div id="sidebar">
|
||||||
|
<form id="sidebar-form" role="search" class="search" action="{{ pathto('search') }}" method="get">
|
||||||
|
<div class="search-wrapper search-sidebar">
|
||||||
|
<input type="search" name="q" placeholder="{{ _('Search documentation') }}" />
|
||||||
|
<button type="submit" onmousedown="searchBarClick(event, document.getElementById('sidebar-form'));">
|
||||||
|
<span class="material-icons">search</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{%- include "localtoc.html" %}
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
{#- The actual body of the contents #}
|
||||||
|
<main class="grid-item" role="main">
|
||||||
|
{% block body %} {% endblock %}
|
||||||
|
</main>
|
||||||
|
{%- block footer %}
|
||||||
|
<footer class="grid-item">
|
||||||
|
{%- if show_copyright %}
|
||||||
|
{%- if hasdoc('copyright') %}
|
||||||
|
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||||
|
{%- else %}
|
||||||
|
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if last_updated %}
|
||||||
|
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if show_sphinx %}
|
||||||
|
{% trans sphinx_version=sphinx_version|e %}Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
|
||||||
|
{%- endif %}
|
||||||
|
</footer>
|
||||||
|
{%- endblock %}
|
||||||
|
</div>
|
||||||
|
{%- if READTHEDOCS %}
|
||||||
|
<script>
|
||||||
|
if (typeof READTHEDOCS_DATA !== "undefined") {
|
||||||
|
if (!READTHEDOCS_DATA.features) {
|
||||||
|
READTHEDOCS_DATA.features = {};
|
||||||
|
}
|
||||||
|
READTHEDOCS_DATA.features.docsearch_disabled = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
<div id="settings" class="modal" onclick="if (event.target == this){ settingsModal.close(); }" hidden>
|
||||||
|
<div class="modal-content">
|
||||||
|
<span class="close" onclick="settingsModal.close();" title="Close">
|
||||||
|
<span class="material-icons">close</span>
|
||||||
|
</span>
|
||||||
|
<h1>{{ _('Settings') }}</h1>
|
||||||
|
|
||||||
|
<h2>{{ _('Font') }}</h2>
|
||||||
|
<div class="setting">
|
||||||
|
<h3>{{ _('Use a serif font:') }}
|
||||||
|
<label class="toggle"
|
||||||
|
title="{{ _('Use a serif font? Your system font will be used, falling back to serif.')}}">
|
||||||
|
<input type="checkbox" name="useSerifFont" onclick="updateSetting(this);">
|
||||||
|
<span class="toggle-slider"></span>
|
||||||
|
</label>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>{{ _('Theme') }}</h2>
|
||||||
|
<div class="setting">
|
||||||
|
<h3>
|
||||||
|
<label class="toggle" title="{{ _('Set your theme based on your system preferences') }}">
|
||||||
|
<input type="radio" name="setTheme" onclick="updateSetting(this);" value="automatic" checked>
|
||||||
|
</label>
|
||||||
|
{{ _('Automatic') }}
|
||||||
|
</h3>
|
||||||
|
<h3>
|
||||||
|
<label class="toggle" title="{{ _('Set your theme to light theme') }}">
|
||||||
|
<input type="radio" name="setTheme" onclick="updateSetting(this);" value="light">
|
||||||
|
</label>
|
||||||
|
{{ _('Light') }}
|
||||||
|
</h3>
|
||||||
|
<h3>
|
||||||
|
<label class="toggle" title="{{ _('Set your theme to dark theme') }}">
|
||||||
|
<input type="radio" name="setTheme" onclick="updateSetting(this);" value="dark">
|
||||||
|
</label>
|
||||||
|
{{ _('Dark') }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="to-top" onclick="scrollToTop()"{%- if READTHEDOCS %} class="is-rtd"{%- endif %} hidden>
|
||||||
|
<span><span class="material-icons">arrow_upward</span> to top</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
1
docs/_templates/relations.html
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<!-- purposefully empty -->
|
356
docs/conf.py
|
@ -1,64 +1,368 @@
|
||||||
# Configuration file for the Sphinx documentation builder.
|
|
||||||
#
|
#
|
||||||
# This file only contains a selection of the most common options. For a full
|
# discord.py documentation build configuration file, created by
|
||||||
# list see the documentation:
|
# sphinx-quickstart on Fri Aug 21 05:43:30 2015.
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
#
|
||||||
|
# This file is execfile()d with the current directory set to its
|
||||||
|
# containing dir.
|
||||||
|
#
|
||||||
|
# Note that not all possible configuration values are present in this
|
||||||
|
# autogenerated file.
|
||||||
|
#
|
||||||
|
# All configuration values have a default; values that are commented out
|
||||||
|
# serve to show the default.
|
||||||
|
|
||||||
# -- Path setup --------------------------------------------------------------
|
import logging
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# 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
|
# 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.
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
#
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
sys.path.insert(0, os.path.abspath('..'))
|
sys.path.insert(0, os.path.abspath('..'))
|
||||||
|
sys.path.append(os.path.abspath('extensions'))
|
||||||
|
|
||||||
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
|
#needs_sphinx = '1.0'
|
||||||
project = 'Github-API-Wrapper'
|
|
||||||
copyright = '2022, Varmonke & sudosnok'
|
|
||||||
author = 'Varmonke & sudosnok'
|
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# 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.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
"sphinx.ext.autodoc"
|
'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'
|
||||||
|
# maybe consider this?
|
||||||
|
# napoleon_attr_annotations = False
|
||||||
|
|
||||||
|
extlinks = {
|
||||||
|
'issue': ('https://github.com/Rapptz/discord.py/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)
|
||||||
|
}
|
||||||
|
|
||||||
|
rst_prolog = """
|
||||||
|
.. |coro| replace:: This function is a |coroutine_link|_.
|
||||||
|
.. |maybecoro| replace:: This function *could be a* |coroutine_link|_.
|
||||||
|
.. |coroutine_link| replace:: *coroutine*
|
||||||
|
.. _coroutine_link: https://docs.python.org/3/library/asyncio-task.html#coroutine
|
||||||
|
"""
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# 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'
|
||||||
|
|
||||||
|
# The encoding of source files.
|
||||||
|
#source_encoding = 'utf-8-sig'
|
||||||
|
|
||||||
|
# The master toctree document.
|
||||||
|
master_doc = 'index'
|
||||||
|
|
||||||
|
# General information about the project.
|
||||||
|
project = 'discord.py'
|
||||||
|
copyright = '2015-present, Rapptz'
|
||||||
|
|
||||||
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
# built documents.
|
||||||
|
#
|
||||||
|
# The short X.Y version.
|
||||||
|
|
||||||
|
version = ''
|
||||||
|
with open('../github/__init__.py') as f:
|
||||||
|
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
|
||||||
|
|
||||||
|
# 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 'v' + version
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
#
|
#
|
||||||
# This is also used if you do content translation via gettext catalogs.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# Usually you set "language" from the command line for these cases.
|
||||||
language = 'Python'
|
language = None
|
||||||
|
|
||||||
|
locale_dirs = ['locale/']
|
||||||
|
gettext_compact = False
|
||||||
|
|
||||||
|
# There are two options for replacing |today|: either, you set today to some
|
||||||
|
# non-false value, then it is used:
|
||||||
|
#today = ''
|
||||||
|
# Else, today_fmt is used as the format for a strftime call.
|
||||||
|
#today_fmt = '%B %d, %Y'
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
# This pattern also affects html_static_path and html_extra_path.
|
exclude_patterns = ['_build']
|
||||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|
||||||
|
# The reST default role (used for this markup: `text`) to use for all
|
||||||
|
# documents.
|
||||||
|
#default_role = None
|
||||||
|
|
||||||
|
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||||
|
#add_function_parentheses = True
|
||||||
|
|
||||||
|
# If true, the current module name will be prepended to all description
|
||||||
|
# unit titles (such as .. function::).
|
||||||
|
#add_module_names = True
|
||||||
|
|
||||||
|
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||||
|
# output. They are ignored by default.
|
||||||
|
#show_authors = False
|
||||||
|
|
||||||
|
# The name of the Pygments (syntax highlighting) style to use.
|
||||||
|
pygments_style = 'friendly'
|
||||||
|
|
||||||
|
# A list of ignored prefixes for module index sorting.
|
||||||
|
#modindex_common_prefix = []
|
||||||
|
|
||||||
|
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||||
|
#keep_warnings = False
|
||||||
|
|
||||||
|
# Ignore warnings about inconsistent order and/or count of references in translated messages.
|
||||||
|
# This makes no sense, different languages can have different word order...
|
||||||
|
def _i18n_warning_filter(record: logging.LogRecord) -> bool:
|
||||||
|
return not record.msg.startswith(
|
||||||
|
(
|
||||||
|
'inconsistent references in translated message',
|
||||||
|
'inconsistent term references in translated message',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
_i18n_logger = logging.getLogger('sphinx')
|
||||||
|
_i18n_logger.addFilter(_i18n_warning_filter)
|
||||||
|
|
||||||
|
# -- Options for HTML output ----------------------------------------------
|
||||||
|
|
||||||
|
html_experimental_html5_writer = True
|
||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
html_theme = 'basic'
|
||||||
html_theme = 'alabaster'
|
|
||||||
html_style = '/default.css'
|
html_context = {
|
||||||
html_favicon = './assets/Github-Python.png'
|
'discord_invite': 'https://discord.gg/r3sSKJJ',
|
||||||
|
'discord_extensions': [
|
||||||
|
('discord.ext.commands', 'ext/commands'),
|
||||||
|
('discord.ext.tasks', 'ext/tasks'),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
resource_links = {
|
||||||
|
'discord': 'https://discord.gg/r3sSKJJ',
|
||||||
|
'issues': 'https://github.com/Rapptz/discord.py/issues',
|
||||||
|
'discussions': 'https://github.com/Rapptz/discord.py/discussions',
|
||||||
|
'examples': f'https://github.com/Rapptz/discord.py/tree/{branch}/examples',
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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 = {
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Add any paths that contain custom themes here, relative to this directory.
|
||||||
|
#html_theme_path = []
|
||||||
|
|
||||||
|
# The name for this set of Sphinx documents. If None, it defaults to
|
||||||
|
# "<project> v<release> documentation".
|
||||||
|
#html_title = None
|
||||||
|
|
||||||
|
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||||
|
#html_short_title = None
|
||||||
|
|
||||||
|
# The name of an image file (relative to this directory) to place at the top
|
||||||
|
# of the sidebar.
|
||||||
|
#html_logo = None
|
||||||
|
|
||||||
|
# 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'
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# 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,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
autodoc_mock_imports = ["typing_extensions"]
|
# Add any extra paths that contain custom files (such as robots.txt or
|
||||||
|
# .htaccess) here, relative to this directory. These files are copied
|
||||||
|
# directly to the root of the documentation.
|
||||||
|
#html_extra_path = []
|
||||||
|
|
||||||
|
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||||
|
# using the given strftime format.
|
||||||
|
#html_last_updated_fmt = '%b %d, %Y'
|
||||||
|
|
||||||
|
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||||
|
# typographically correct entities.
|
||||||
|
#html_use_smartypants = True
|
||||||
|
|
||||||
|
# Custom sidebar templates, maps document names to template names.
|
||||||
|
#html_sidebars = {}
|
||||||
|
|
||||||
|
# Additional templates that should be rendered to pages, maps page names to
|
||||||
|
# template names.
|
||||||
|
#html_additional_pages = {}
|
||||||
|
|
||||||
|
# If false, no module index is generated.
|
||||||
|
#html_domain_indices = True
|
||||||
|
|
||||||
|
# If false, no index is generated.
|
||||||
|
#html_use_index = True
|
||||||
|
|
||||||
|
# If true, the index is split into individual pages for each letter.
|
||||||
|
#html_split_index = False
|
||||||
|
|
||||||
|
# If true, links to the reST sources are added to the pages.
|
||||||
|
#html_show_sourcelink = True
|
||||||
|
|
||||||
|
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||||
|
#html_show_sphinx = True
|
||||||
|
|
||||||
|
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||||
|
#html_show_copyright = True
|
||||||
|
|
||||||
|
# If true, an OpenSearch description file will be output, and all pages will
|
||||||
|
# contain a <link> tag referring to it. The value of this option must be the
|
||||||
|
# base URL from which the finished HTML is served.
|
||||||
|
#html_use_opensearch = ''
|
||||||
|
|
||||||
|
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||||
|
#html_file_suffix = None
|
||||||
|
|
||||||
|
# Language to be used for generating the HTML full-text search index.
|
||||||
|
# Sphinx supports the following languages:
|
||||||
|
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
||||||
|
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
|
||||||
|
#html_search_language = 'en'
|
||||||
|
|
||||||
|
# A dictionary with options for the search language support, empty by default.
|
||||||
|
# Now only 'ja' uses this config value
|
||||||
|
#html_search_options = {'type': 'default'}
|
||||||
|
|
||||||
|
# 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_js_files = [
|
||||||
|
'custom.js',
|
||||||
|
'settings.js',
|
||||||
|
'copy.js',
|
||||||
|
'sidebar.js'
|
||||||
|
]
|
||||||
|
|
||||||
|
# Output file base name for HTML help builder.
|
||||||
|
htmlhelp_basename = 'Github-API-Wrapper.doc'
|
||||||
|
|
||||||
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
|
latex_elements = {
|
||||||
|
# The paper size ('letterpaper' or 'a4paper').
|
||||||
|
#'papersize': 'letterpaper',
|
||||||
|
|
||||||
|
# The font size ('10pt', '11pt' or '12pt').
|
||||||
|
#'pointsize': '10pt',
|
||||||
|
|
||||||
|
# Additional stuff for the LaTeX preamble.
|
||||||
|
#'preamble': '',
|
||||||
|
|
||||||
|
# Latex figure (float) alignment
|
||||||
|
#'figure_align': 'htbp',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grouping the document tree into LaTeX files. List of tuples
|
||||||
|
# (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'),
|
||||||
|
]
|
||||||
|
|
||||||
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
# the title page.
|
||||||
|
#latex_logo = None
|
||||||
|
|
||||||
|
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||||
|
# not chapters.
|
||||||
|
#latex_use_parts = False
|
||||||
|
|
||||||
|
# If true, show page references after internal links.
|
||||||
|
#latex_show_pagerefs = False
|
||||||
|
|
||||||
|
# If true, show URL addresses after external links.
|
||||||
|
#latex_show_urls = False
|
||||||
|
|
||||||
|
# Documents to append as an appendix to all manuals.
|
||||||
|
#latex_appendices = []
|
||||||
|
|
||||||
|
# If false, no module index is generated.
|
||||||
|
#latex_domain_indices = True
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for manual page output ---------------------------------------
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
]
|
||||||
|
|
||||||
|
# If true, show URL addresses after external links.
|
||||||
|
#man_show_urls = False
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for Texinfo output -------------------------------------------
|
||||||
|
|
||||||
|
# Grouping the document tree into Texinfo files. List of tuples
|
||||||
|
# (source start file, target name, title, author,
|
||||||
|
# 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'),
|
||||||
|
]
|
||||||
|
|
||||||
|
# Documents to append as an appendix to all manuals.
|
||||||
|
#texinfo_appendices = []
|
||||||
|
|
||||||
|
# If false, no module index is generated.
|
||||||
|
#texinfo_domain_indices = True
|
||||||
|
|
||||||
|
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||||
|
#texinfo_show_urls = 'footnote'
|
||||||
|
|
||||||
|
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||||
|
#texinfo_no_detailmenu = False
|
||||||
|
|
||||||
|
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'] = 'DWhwsQ5TsT'
|
||||||
|
app.config.resource_links['discord'] = 'DWhwsQ5TsT'
|
||||||
|
|
287
docs/extensions/attributetable.py
Normal file
|
@ -0,0 +1,287 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
import importlib
|
||||||
|
import inspect
|
||||||
|
import re
|
||||||
|
from typing import Dict, List, NamedTuple, Optional, Tuple, Sequence, TYPE_CHECKING
|
||||||
|
|
||||||
|
from docutils import nodes
|
||||||
|
from sphinx import addnodes
|
||||||
|
from sphinx.application import Sphinx
|
||||||
|
from sphinx.environment import BuildEnvironment
|
||||||
|
from sphinx.locale import _
|
||||||
|
from sphinx.util.docutils import SphinxDirective
|
||||||
|
from sphinx.util.typing import OptionSpec
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .builder import DPYHTML5Translator
|
||||||
|
|
||||||
|
|
||||||
|
class attributetable(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class attributetablecolumn(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class attributetabletitle(nodes.TextElement):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class attributetableplaceholder(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class attributetablebadge(nodes.TextElement):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class attributetable_item(nodes.Part, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def visit_attributetable_node(self: DPYHTML5Translator, node: attributetable) -> None:
|
||||||
|
class_ = node['python-class']
|
||||||
|
self.body.append(f'<div class="py-attribute-table" data-move-to-id="{class_}">')
|
||||||
|
|
||||||
|
|
||||||
|
def visit_attributetablecolumn_node(self: DPYHTML5Translator, node: attributetablecolumn) -> None:
|
||||||
|
self.body.append(self.starttag(node, 'div', CLASS='py-attribute-table-column'))
|
||||||
|
|
||||||
|
|
||||||
|
def visit_attributetabletitle_node(self: DPYHTML5Translator, node: attributetabletitle) -> None:
|
||||||
|
self.body.append(self.starttag(node, 'span'))
|
||||||
|
|
||||||
|
|
||||||
|
def visit_attributetablebadge_node(self: DPYHTML5Translator, node: attributetablebadge) -> None:
|
||||||
|
attributes = {
|
||||||
|
'class': 'py-attribute-table-badge',
|
||||||
|
'title': node['badge-type'],
|
||||||
|
}
|
||||||
|
self.body.append(self.starttag(node, 'span', **attributes))
|
||||||
|
|
||||||
|
|
||||||
|
def visit_attributetable_item_node(self: DPYHTML5Translator, node: attributetable_item) -> None:
|
||||||
|
self.body.append(self.starttag(node, 'li', CLASS='py-attribute-table-entry'))
|
||||||
|
|
||||||
|
|
||||||
|
def depart_attributetable_node(self: DPYHTML5Translator, node: attributetable) -> None:
|
||||||
|
self.body.append('</div>')
|
||||||
|
|
||||||
|
|
||||||
|
def depart_attributetablecolumn_node(self: DPYHTML5Translator, node: attributetablecolumn) -> None:
|
||||||
|
self.body.append('</div>')
|
||||||
|
|
||||||
|
|
||||||
|
def depart_attributetabletitle_node(self: DPYHTML5Translator, node: attributetabletitle) -> None:
|
||||||
|
self.body.append('</span>')
|
||||||
|
|
||||||
|
|
||||||
|
def depart_attributetablebadge_node(self: DPYHTML5Translator, node: attributetablebadge) -> None:
|
||||||
|
self.body.append('</span>')
|
||||||
|
|
||||||
|
|
||||||
|
def depart_attributetable_item_node(self: DPYHTML5Translator, node: attributetable_item) -> None:
|
||||||
|
self.body.append('</li>')
|
||||||
|
|
||||||
|
|
||||||
|
_name_parser_regex = re.compile(r'(?P<module>[\w.]+\.)?(?P<name>\w+)')
|
||||||
|
|
||||||
|
|
||||||
|
class PyAttributeTable(SphinxDirective):
|
||||||
|
has_content = False
|
||||||
|
required_arguments = 1
|
||||||
|
optional_arguments = 0
|
||||||
|
final_argument_whitespace = False
|
||||||
|
option_spec: OptionSpec = {}
|
||||||
|
|
||||||
|
def parse_name(self, content: str) -> Tuple[str, str]:
|
||||||
|
match = _name_parser_regex.match(content)
|
||||||
|
if match is None:
|
||||||
|
raise RuntimeError(f"content {content} somehow doesn't match regex in {self.env.docname}.")
|
||||||
|
path, name = match.groups()
|
||||||
|
if path:
|
||||||
|
modulename = path.rstrip('.')
|
||||||
|
else:
|
||||||
|
modulename = self.env.temp_data.get('autodoc:module')
|
||||||
|
if not modulename:
|
||||||
|
modulename = self.env.ref_context.get('py:module')
|
||||||
|
if modulename is None:
|
||||||
|
raise RuntimeError(f'modulename somehow None for {content} in {self.env.docname}.')
|
||||||
|
|
||||||
|
return modulename, name
|
||||||
|
|
||||||
|
def run(self) -> List[attributetableplaceholder]:
|
||||||
|
"""If you're curious on the HTML this is meant to generate:
|
||||||
|
|
||||||
|
<div class="py-attribute-table">
|
||||||
|
<div class="py-attribute-table-column">
|
||||||
|
<span>_('Attributes')</span>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="...">
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="py-attribute-table-column">
|
||||||
|
<span>_('Methods')</span>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="..."></a>
|
||||||
|
<span class="py-attribute-badge" title="decorator">D</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
However, since this requires the tree to be complete
|
||||||
|
and parsed, it'll need to be done at a different stage and then
|
||||||
|
replaced.
|
||||||
|
"""
|
||||||
|
content = self.arguments[0].strip()
|
||||||
|
node = attributetableplaceholder('')
|
||||||
|
modulename, name = self.parse_name(content)
|
||||||
|
node['python-doc'] = self.env.docname
|
||||||
|
node['python-module'] = modulename
|
||||||
|
node['python-class'] = name
|
||||||
|
node['python-full-name'] = f'{modulename}.{name}'
|
||||||
|
return [node]
|
||||||
|
|
||||||
|
|
||||||
|
def build_lookup_table(env: BuildEnvironment) -> Dict[str, List[str]]:
|
||||||
|
# Given an environment, load up a lookup table of
|
||||||
|
# full-class-name: objects
|
||||||
|
result = {}
|
||||||
|
domain = env.domains['py']
|
||||||
|
|
||||||
|
ignored = {
|
||||||
|
'data',
|
||||||
|
'exception',
|
||||||
|
'module',
|
||||||
|
'class',
|
||||||
|
}
|
||||||
|
|
||||||
|
for fullname, _, objtype, docname, _, _ in domain.get_objects():
|
||||||
|
if objtype in ignored:
|
||||||
|
continue
|
||||||
|
|
||||||
|
classname, _, child = fullname.rpartition('.')
|
||||||
|
try:
|
||||||
|
result[classname].append(child)
|
||||||
|
except KeyError:
|
||||||
|
result[classname] = [child]
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
class TableElement(NamedTuple):
|
||||||
|
fullname: str
|
||||||
|
label: str
|
||||||
|
badge: Optional[attributetablebadge]
|
||||||
|
|
||||||
|
|
||||||
|
def process_attributetable(app: Sphinx, doctree: nodes.Node, fromdocname: str) -> None:
|
||||||
|
env = app.builder.env
|
||||||
|
|
||||||
|
lookup = build_lookup_table(env)
|
||||||
|
for node in doctree.traverse(attributetableplaceholder):
|
||||||
|
modulename, classname, fullname = node['python-module'], node['python-class'], node['python-full-name']
|
||||||
|
groups = get_class_results(lookup, modulename, classname, fullname)
|
||||||
|
table = attributetable('')
|
||||||
|
for label, subitems in groups.items():
|
||||||
|
if not subitems:
|
||||||
|
continue
|
||||||
|
table.append(class_results_to_node(label, sorted(subitems, key=lambda c: c.label)))
|
||||||
|
|
||||||
|
table['python-class'] = fullname
|
||||||
|
|
||||||
|
if not table:
|
||||||
|
node.replace_self([])
|
||||||
|
else:
|
||||||
|
node.replace_self([table])
|
||||||
|
|
||||||
|
|
||||||
|
def get_class_results(
|
||||||
|
lookup: Dict[str, List[str]], modulename: str, name: str, fullname: str
|
||||||
|
) -> Dict[str, List[TableElement]]:
|
||||||
|
module = importlib.import_module(modulename)
|
||||||
|
cls = getattr(module, name)
|
||||||
|
|
||||||
|
groups: Dict[str, List[TableElement]] = {
|
||||||
|
_('Attributes'): [],
|
||||||
|
_('Methods'): [],
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
members = lookup[fullname]
|
||||||
|
except KeyError:
|
||||||
|
return groups
|
||||||
|
|
||||||
|
for attr in members:
|
||||||
|
attrlookup = f'{fullname}.{attr}'
|
||||||
|
key = _('Attributes')
|
||||||
|
badge = None
|
||||||
|
label = attr
|
||||||
|
value = None
|
||||||
|
|
||||||
|
for base in cls.__mro__:
|
||||||
|
value = base.__dict__.get(attr)
|
||||||
|
if value is not None:
|
||||||
|
break
|
||||||
|
|
||||||
|
if value is not None:
|
||||||
|
doc = value.__doc__ or ''
|
||||||
|
if inspect.iscoroutinefunction(value) or doc.startswith('|coro|'):
|
||||||
|
key = _('Methods')
|
||||||
|
badge = attributetablebadge('async', 'async')
|
||||||
|
badge['badge-type'] = _('coroutine')
|
||||||
|
elif isinstance(value, classmethod):
|
||||||
|
key = _('Methods')
|
||||||
|
label = f'{name}.{attr}'
|
||||||
|
badge = attributetablebadge('cls', 'cls')
|
||||||
|
badge['badge-type'] = _('classmethod')
|
||||||
|
elif inspect.isfunction(value):
|
||||||
|
if doc.startswith(('A decorator', 'A shortcut decorator')):
|
||||||
|
# finicky but surprisingly consistent
|
||||||
|
key = _('Methods')
|
||||||
|
badge = attributetablebadge('@', '@')
|
||||||
|
badge['badge-type'] = _('decorator')
|
||||||
|
elif inspect.isasyncgenfunction(value):
|
||||||
|
key = _('Methods')
|
||||||
|
badge = attributetablebadge('async for', 'async for')
|
||||||
|
badge['badge-type'] = _('async iterable')
|
||||||
|
else:
|
||||||
|
key = _('Methods')
|
||||||
|
badge = attributetablebadge('def', 'def')
|
||||||
|
badge['badge-type'] = _('method')
|
||||||
|
|
||||||
|
groups[key].append(TableElement(fullname=attrlookup, label=label, badge=badge))
|
||||||
|
|
||||||
|
return groups
|
||||||
|
|
||||||
|
|
||||||
|
def class_results_to_node(key: str, elements: Sequence[TableElement]) -> attributetablecolumn:
|
||||||
|
title = attributetabletitle(key, key)
|
||||||
|
ul = nodes.bullet_list('')
|
||||||
|
for element in elements:
|
||||||
|
ref = nodes.reference(
|
||||||
|
'', '', internal=True, refuri=f'#{element.fullname}', anchorname='', *[nodes.Text(element.label)]
|
||||||
|
)
|
||||||
|
para = addnodes.compact_paragraph('', '', ref)
|
||||||
|
if element.badge is not None:
|
||||||
|
ul.append(attributetable_item('', element.badge, para))
|
||||||
|
else:
|
||||||
|
ul.append(attributetable_item('', para))
|
||||||
|
|
||||||
|
return attributetablecolumn('', title, ul)
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app: Sphinx) -> None:
|
||||||
|
app.add_directive('attributetable', PyAttributeTable)
|
||||||
|
app.add_node(attributetable, html=(visit_attributetable_node, depart_attributetable_node))
|
||||||
|
app.add_node(attributetablecolumn, html=(visit_attributetablecolumn_node, depart_attributetablecolumn_node))
|
||||||
|
app.add_node(attributetabletitle, html=(visit_attributetabletitle_node, depart_attributetabletitle_node))
|
||||||
|
app.add_node(attributetablebadge, html=(visit_attributetablebadge_node, depart_attributetablebadge_node))
|
||||||
|
app.add_node(attributetable_item, html=(visit_attributetable_item_node, depart_attributetable_item_node))
|
||||||
|
app.add_node(attributetableplaceholder)
|
||||||
|
app.connect('doctree-resolved', process_attributetable)
|
77
docs/extensions/builder.py
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
|
from sphinx.environment.adapters.indexentries import IndexEntries
|
||||||
|
from sphinx.writers.html5 import HTML5Translator
|
||||||
|
|
||||||
|
class DPYHTML5Translator(HTML5Translator):
|
||||||
|
def visit_section(self, node):
|
||||||
|
self.section_level += 1
|
||||||
|
self.body.append(
|
||||||
|
self.starttag(node, 'section'))
|
||||||
|
|
||||||
|
def depart_section(self, node):
|
||||||
|
self.section_level -= 1
|
||||||
|
self.body.append('</section>\n')
|
||||||
|
|
||||||
|
def visit_table(self, node):
|
||||||
|
self.body.append('<div class="table-wrapper">')
|
||||||
|
super().visit_table(node)
|
||||||
|
|
||||||
|
def depart_table(self, node):
|
||||||
|
super().depart_table(node)
|
||||||
|
self.body.append('</div>')
|
||||||
|
|
||||||
|
class DPYStandaloneHTMLBuilder(StandaloneHTMLBuilder):
|
||||||
|
# This is mostly copy pasted from Sphinx.
|
||||||
|
def write_genindex(self) -> None:
|
||||||
|
# the total count of lines for each index letter, used to distribute
|
||||||
|
# the entries into two columns
|
||||||
|
genindex = IndexEntries(self.env).create_index(self, group_entries=False)
|
||||||
|
indexcounts = []
|
||||||
|
for _k, entries in genindex:
|
||||||
|
indexcounts.append(sum(1 + len(subitems)
|
||||||
|
for _, (_, subitems, _) in entries))
|
||||||
|
|
||||||
|
genindexcontext = {
|
||||||
|
'genindexentries': genindex,
|
||||||
|
'genindexcounts': indexcounts,
|
||||||
|
'split_index': self.config.html_split_index,
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.config.html_split_index:
|
||||||
|
self.handle_page('genindex', genindexcontext,
|
||||||
|
'genindex-split.html')
|
||||||
|
self.handle_page('genindex-all', genindexcontext,
|
||||||
|
'genindex.html')
|
||||||
|
for (key, entries), count in zip(genindex, indexcounts):
|
||||||
|
ctx = {'key': key, 'entries': entries, 'count': count,
|
||||||
|
'genindexentries': genindex}
|
||||||
|
self.handle_page('genindex-' + key, ctx,
|
||||||
|
'genindex-single.html')
|
||||||
|
else:
|
||||||
|
self.handle_page('genindex', genindexcontext, 'genindex.html')
|
||||||
|
|
||||||
|
|
||||||
|
def add_custom_jinja2(app):
|
||||||
|
env = app.builder.templates.environment
|
||||||
|
env.tests['prefixedwith'] = str.startswith
|
||||||
|
env.tests['suffixedwith'] = str.endswith
|
||||||
|
|
||||||
|
def add_builders(app):
|
||||||
|
"""This is necessary because RTD injects their own for some reason."""
|
||||||
|
app.set_translator('html', DPYHTML5Translator, override=True)
|
||||||
|
app.add_builder(DPYStandaloneHTMLBuilder, override=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
original = app.registry.builders['readthedocs']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
injected_mro = tuple(base if base is not StandaloneHTMLBuilder else DPYStandaloneHTMLBuilder
|
||||||
|
for base in original.mro()[1:])
|
||||||
|
new_builder = type(original.__name__, injected_mro, {'name': 'readthedocs'})
|
||||||
|
app.set_translator('readthedocs', DPYHTML5Translator, override=True)
|
||||||
|
app.add_builder(new_builder, override=True)
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
add_builders(app)
|
||||||
|
app.connect('builder-inited', add_custom_jinja2)
|
55
docs/extensions/details.py
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
from docutils.parsers.rst import Directive
|
||||||
|
from docutils.parsers.rst import states, directives
|
||||||
|
from docutils.parsers.rst.roles import set_classes
|
||||||
|
from docutils import nodes
|
||||||
|
|
||||||
|
class details(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class summary(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def visit_details_node(self, node):
|
||||||
|
self.body.append(self.starttag(node, 'details', CLASS=node.attributes.get('class', '')))
|
||||||
|
|
||||||
|
def visit_summary_node(self, node):
|
||||||
|
self.body.append(self.starttag(node, 'summary', CLASS=node.attributes.get('summary-class', '')))
|
||||||
|
self.body.append(node.rawsource)
|
||||||
|
|
||||||
|
def depart_details_node(self, node):
|
||||||
|
self.body.append('</details>\n')
|
||||||
|
|
||||||
|
def depart_summary_node(self, node):
|
||||||
|
self.body.append('</summary>')
|
||||||
|
|
||||||
|
class DetailsDirective(Directive):
|
||||||
|
final_argument_whitespace = True
|
||||||
|
optional_arguments = 1
|
||||||
|
|
||||||
|
option_spec = {
|
||||||
|
'class': directives.class_option,
|
||||||
|
'summary-class': directives.class_option,
|
||||||
|
}
|
||||||
|
|
||||||
|
has_content = True
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
set_classes(self.options)
|
||||||
|
self.assert_has_content()
|
||||||
|
|
||||||
|
text = '\n'.join(self.content)
|
||||||
|
node = details(text, **self.options)
|
||||||
|
|
||||||
|
if self.arguments:
|
||||||
|
summary_node = summary(self.arguments[0], **self.options)
|
||||||
|
summary_node.source, summary_node.line = self.state_machine.get_source_and_line(self.lineno)
|
||||||
|
node += summary_node
|
||||||
|
|
||||||
|
self.state.nested_parse(self.content, self.content_offset, node)
|
||||||
|
return [node]
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.add_node(details, html=(visit_details_node, depart_details_node))
|
||||||
|
app.add_node(summary, html=(visit_summary_node, depart_summary_node))
|
||||||
|
app.add_directive('details', DetailsDirective)
|
||||||
|
|
27
docs/extensions/exception_hierarchy.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
from docutils.parsers.rst import Directive
|
||||||
|
from docutils.parsers.rst import states, directives
|
||||||
|
from docutils.parsers.rst.roles import set_classes
|
||||||
|
from docutils import nodes
|
||||||
|
from sphinx.locale import _
|
||||||
|
|
||||||
|
class exception_hierarchy(nodes.General, nodes.Element):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def visit_exception_hierarchy_node(self, node):
|
||||||
|
self.body.append(self.starttag(node, 'div', CLASS='exception-hierarchy-content'))
|
||||||
|
|
||||||
|
def depart_exception_hierarchy_node(self, node):
|
||||||
|
self.body.append('</div>\n')
|
||||||
|
|
||||||
|
class ExceptionHierarchyDirective(Directive):
|
||||||
|
has_content = True
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
self.assert_has_content()
|
||||||
|
node = exception_hierarchy('\n'.join(self.content))
|
||||||
|
self.state.nested_parse(self.content, self.content_offset, node)
|
||||||
|
return [node]
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.add_node(exception_hierarchy, html=(visit_exception_hierarchy_node, depart_exception_hierarchy_node))
|
||||||
|
app.add_directive('exception_hierarchy', ExceptionHierarchyDirective)
|
22
docs/extensions/nitpick_file_ignorer.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from sphinx.application import Sphinx
|
||||||
|
from sphinx.util import logging as sphinx_logging
|
||||||
|
|
||||||
|
|
||||||
|
class NitpickFileIgnorer(logging.Filter):
|
||||||
|
|
||||||
|
def __init__(self, app: Sphinx) -> None:
|
||||||
|
self.app = app
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
def filter(self, record: sphinx_logging.SphinxLogRecord) -> bool:
|
||||||
|
if getattr(record, 'type', None) == 'ref':
|
||||||
|
return record.location.get('refdoc') not in self.app.config.nitpick_ignore_files
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app: Sphinx):
|
||||||
|
app.add_config_value('nitpick_ignore_files', [], '')
|
||||||
|
f = NitpickFileIgnorer(app)
|
||||||
|
sphinx_logging.getLogger('sphinx.transforms.post_transforms').logger.addFilter(f)
|
44
docs/extensions/resourcelinks.py
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# Credit to sphinx.ext.extlinks for being a good starter
|
||||||
|
# Copyright 2007-2020 by the Sphinx team
|
||||||
|
# Licensed under BSD.
|
||||||
|
|
||||||
|
from typing import Any, Dict, List, Tuple
|
||||||
|
|
||||||
|
from docutils import nodes, utils
|
||||||
|
from docutils.nodes import Node, system_message
|
||||||
|
from docutils.parsers.rst.states import Inliner
|
||||||
|
|
||||||
|
import sphinx
|
||||||
|
from sphinx.application import Sphinx
|
||||||
|
from sphinx.util.nodes import split_explicit_title
|
||||||
|
from sphinx.util.typing import RoleFunction
|
||||||
|
|
||||||
|
|
||||||
|
def make_link_role(resource_links: Dict[str, str]) -> RoleFunction:
|
||||||
|
def role(
|
||||||
|
typ: str,
|
||||||
|
rawtext: str,
|
||||||
|
text: str,
|
||||||
|
lineno: int,
|
||||||
|
inliner: Inliner,
|
||||||
|
options: Dict = {},
|
||||||
|
content: List[str] = []
|
||||||
|
) -> Tuple[List[Node], List[system_message]]:
|
||||||
|
|
||||||
|
text = utils.unescape(text)
|
||||||
|
has_explicit_title, title, key = split_explicit_title(text)
|
||||||
|
full_url = resource_links[key]
|
||||||
|
if not has_explicit_title:
|
||||||
|
title = full_url
|
||||||
|
pnode = nodes.reference(title, title, internal=False, refuri=full_url)
|
||||||
|
return [pnode], []
|
||||||
|
return role
|
||||||
|
|
||||||
|
|
||||||
|
def add_link_role(app: Sphinx) -> None:
|
||||||
|
app.add_role('resource', make_link_role(app.config.resource_links))
|
||||||
|
|
||||||
|
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||||
|
app.add_config_value('resource_links', {}, 'env')
|
||||||
|
app.connect('builder-inited', add_link_role)
|
||||||
|
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
|
BIN
docs/images/Github-Python-rounded.png
Normal file
After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
BIN
docs/images/discord_py_logo.ico
Normal file
After Width: | Height: | Size: 264 KiB |
4
docs/images/drop_down_icon.svg
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'>
|
||||||
|
<path d='M7 10l5 5 5-5z'/>
|
||||||
|
<path d='M0 0h24v24H0z' fill='none'/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 177 B |
BIN
docs/images/icon.ico
Normal file
After Width: | Height: | Size: 56 KiB |
17
docs/images/snake.svg
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<svg style="width: 100%; height: 100%"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1036 597.33331" height="597.333" width="1036">
|
||||||
|
<path d="M498.46 84.248c-1.6 1.665-2.4 3.597-2.4 5.93 0 2.333.8 4.265 2.4 5.863 1.667 1.67 3.6 2.47 5.932 2.47 2.332 0 4.265-.8 5.864-2.46 1.665-1.59 2.465-3.53 2.465-5.86 0-2.33-.8-4.26-2.46-5.93-1.6-1.6-3.53-2.4-5.86-2.4s-4.26.8-5.93 2.4m-9.06 5.93c0-2.33-.8-4.26-2.46-5.93-1.6-1.6-3.53-2.4-5.862-2.4s-4.265.8-5.93 2.4c-1.6 1.67-2.4 3.6-2.4 5.93 0 2.33.8 4.27 2.4 5.86 1.665 1.67 3.598 2.47 5.93 2.47s4.265-.8 5.864-2.46c1.663-1.593 2.463-3.53 2.463-5.86m46.647 0c0-2.333-.8-4.27-2.467-5.93-1.6-1.6-3.53-2.4-5.86-2.4s-4.265.8-5.93 2.4c-1.6 1.665-2.4 3.597-2.4 5.93 0 2.333.8 4.265 2.4 5.863 1.665 1.67 3.598 2.467 5.93 2.467s4.265-.8 5.864-2.468c1.667-1.598 2.467-3.53 2.467-5.86" fill="#e0e0e0"/>
|
||||||
|
<path d="M2748.2-850.22H155.382c-76.964 0-115.447-48.474-115.447-144.932V-4303.65c0-96.45 38.483-144.93 115.447-144.93H6321.57c76.97 0 115.45 48.48 115.45 144.93v3308.498c0 96.458-38.48 144.933-115.45 144.933H3737.75" fill="none" stroke="#e0e0e0" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M4177.05-3798.87v2178.5H998.996v-2178.5c0-133.44 66.474-199.91 199.914-199.91h2778.23c133.44 0 199.91 66.47 199.91 199.91z" fill="none" stroke="#e0e0e0" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M6274.1-4181.2v2844.7c0 82.97-36.49 124.45-108.95 124.45H322.307c-72.47 0-108.952-41.48-108.952-124.45v-2844.7c0-82.96 36.483-124.44 108.952-124.44H6165.15c72.46 0 108.95 41.48 108.95 124.44zM449.25-41.084h147.43m182.418 0h339.842m1407.86 0c0-91.458 46.98-151.43 140.94-179.92 23.99-7.497 50.97-12.493 80.46-15.993m0 0c24.49-2.497 51.48-3.997 79.96-3.997h820.63c32.49 0 61.97 2 88.96 5.497M1348.84-41.084H2526.8m221.4-195.913V-850.22m989.55 614.723c26.49 3 49.98 7.996 71.47 14.493 93.96 28.49 140.93 88.462 140.93 179.92m2024.08 0h50.98m-468.28 0h219.89m-1826.67 0h1416.86M3737.75-235.497V-850.22m212.4 809.136H2526.8M3737.75-850.22H2748.2" fill="none" stroke="#e0e0e0" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M2126.79-2789.58c-38.13 38.49-57.37 85.01-57.37 139.59 0 54.22 19.24 100.75 57.37 139.23 38.48 38.48 85.01 57.73 139.59 57.73 54.22 0 100.75-19.25 139.23-57.73 38.49-38.48 57.73-85.01 57.73-139.23 0-54.58-19.24-101.1-57.73-139.59-38.48-38.13-85.01-57.37-139.23-57.37-54.58 0-101.11 19.24-139.59 57.37z" fill="none" stroke="#e0e0e0" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M2640.7-3448.32c-286.51-11.2-546.09 38.83-778.73 150.43 143.08-106.7 307.5-172.47 493.27-197.66-6.3-14.34-18.9-29.04-38.13-43.73h-62.98c-210.25 36.73-380.62 103.9-511.11 201.16-197.66 325.7-291.76 678.68-281.62 1058.6 142.39 189.97 349.49 279.53 621.31 267.98l122.45-129.44c-148.68-52.82-255.03-123.49-318.7-212 214.1 133.99 465.63 199.41 754.24 196.26" fill="none" stroke="#e0e0e0" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M-3149.74-2789.58c-38.13 38.49-57.37 85.01-57.37 139.59 0 54.22 19.24 100.75 57.37 139.23 38.49 38.48 85.01 57.73 139.59 57.73 54.22 0 100.75-19.25 139.23-57.73 38.49-38.48 57.73-85.01 57.73-139.23 0-54.58-19.24-101.1-57.73-139.59-38.48-38.13-85.01-57.37-139.23-57.37-54.58 0-101.1 19.24-139.59 57.37z" fill="none" stroke="#e0e0e0" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(-.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M-2635.83-3448.32c-286.51-11.2-546.09 38.83-778.73 150.43 143.08-106.7 307.5-172.47 493.27-197.66-6.3-14.34-18.89-29.04-38.13-43.73h-62.98c-210.25 36.73-380.62 103.9-511.11 201.16-197.66 325.7-291.76 678.68-281.62 1058.6 142.39 189.97 349.49 279.53 621.32 267.98l122.44-129.44c-148.68-52.82-255.03-123.49-318.7-212 214.1 133.99 465.63 199.41 754.24 196.26" fill="none" stroke="#e0e0e0" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(-.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M474.47 230.785c-17.793 0-26.655 8.863-26.655 26.654v261.2-23.99H207.912h47.98v-58.9 34.91h143.94-47.98v23.99h95.963v-94.88c-.534-16.73-9.396-25.06-26.656-25.06H186.58c-17.792 0-26.656 8.86-26.656 26.65v163.85c0 17.26 8.33 26.12 25.057 26.65h333.8c16.66-.53 24.99-9.39 24.99-26.65V326.74h-34.65c-16.66.667-24.65-7.33-23.99-23.987h300.28c4.2-7.13 6.27-15.126 6.27-23.99v-21.32c0-17.792-8.86-26.655-26.65-26.655zm-13.327 311.842l23.99 22.588-23.99-22.588" fill="#eadc62"/>
|
||||||
|
<path d="M777.616 312.677c3.132-3.132 5.73-6.397 7.796-9.928h-300.28c-.665 16.65 7.33 24.65 23.992 23.98h234.572c13.26 0 24.523-4.67 33.92-14.06" fill="#f2edc8"/>
|
||||||
|
<path d="M3890.68-40.99H1387.32m1971.1-1440.85v-1067.51c0-133.44 66.47-199.91 199.91-199.91h2179.01c133.44 0 199.91 66.47 199.91 199.91v159.93c0 66.47-15.49 126.44-46.98 179.92" fill="none" stroke="#000" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M5890.27-2209.5c-15.49 26.48-34.98 50.97-58.47 74.46-70.47 70.47-154.93 105.45-254.39 105.45H4078.1M3358.42-590.243V-770.16m719.68-1259.43h-259.88m-459.8 1259.43v-711.68M3638.3-240.9l-179.92-169.423M4449.93-40.99h-559.25m187.42-1988.6V-240.9c0 129.44-62.48 195.91-187.42 199.91m1007.04 0H4717.8M1559.24-770.16h359.84m4777.83-1259.43l-179.92-179.91m0 0l179.92-179.92M949.022-40.99h438.298M6516.99-2209.5h-626.72m-3971.19 997.54v261.88m0 0v179.92m1079.51-179.92h-359.84m0 0v179.92m-719.67-179.92h719.67m0 179.92h-719.67M1387.32-40.99c-125.44-4-187.91-70.47-187.91-199.91v-1228.94c0-133.44 66.47-199.91 199.9-199.91h1759.2c129.45 0 195.92 62.47 199.91 187.91m-719.67 711.68h719.67" fill="none" stroke="#000" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M7716.44-2209.5H7356.6m0 539.75l-179.92-179.92m179.92-899.59l-179.92 179.92" fill="none" stroke="#e0e0e0" stroke-width="99.954" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M769.485 258.24c-2.332-2.333-5.13-3.467-8.462-3.467s-6.198 1.134-8.53 3.466c-2.333 2.33-3.466 5.19-3.466 8.52s1.133 6.13 3.466 8.46c2.332 2.33 5.198 3.53 8.53 3.53 3.332 0 6.13-1.2 8.462-3.53 2.334-2.34 3.532-5.13 3.532-8.47 0-3.33-1.198-6.2-3.532-8.53"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 6.7 KiB |
17
docs/images/snake_dark.svg
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<svg style="width: 100%; height: 100%"
|
||||||
|
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1036 597.33331" height="597.333" width="1036">
|
||||||
|
<path d="M498.46 84.248c-1.6 1.665-2.4 3.597-2.4 5.93 0 2.333.8 4.265 2.4 5.863 1.667 1.67 3.6 2.47 5.932 2.47 2.332 0 4.265-.8 5.864-2.46 1.665-1.59 2.465-3.53 2.465-5.86 0-2.33-.8-4.26-2.46-5.93-1.6-1.6-3.53-2.4-5.86-2.4s-4.26.8-5.93 2.4m-9.06 5.93c0-2.33-.8-4.26-2.46-5.93-1.6-1.6-3.53-2.4-5.862-2.4s-4.265.8-5.93 2.4c-1.6 1.67-2.4 3.6-2.4 5.93 0 2.33.8 4.27 2.4 5.86 1.665 1.67 3.598 2.47 5.93 2.47s4.265-.8 5.864-2.46c1.663-1.593 2.463-3.53 2.463-5.86m46.647 0c0-2.333-.8-4.27-2.467-5.93-1.6-1.6-3.53-2.4-5.86-2.4s-4.265.8-5.93 2.4c-1.6 1.665-2.4 3.597-2.4 5.93 0 2.333.8 4.265 2.4 5.863 1.665 1.67 3.598 2.467 5.93 2.467s4.265-.8 5.864-2.468c1.667-1.598 2.467-3.53 2.467-5.86" fill="#161616"/>
|
||||||
|
<path d="M2748.2-850.22H155.382c-76.964 0-115.447-48.474-115.447-144.932V-4303.65c0-96.45 38.483-144.93 115.447-144.93H6321.57c76.97 0 115.45 48.48 115.45 144.93v3308.498c0 96.458-38.48 144.933-115.45 144.933H3737.75" fill="none" stroke="#161616" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M4177.05-3798.87v2178.5H998.996v-2178.5c0-133.44 66.474-199.91 199.914-199.91h2778.23c133.44 0 199.91 66.47 199.91 199.91z" fill="none" stroke="#161616" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M6274.1-4181.2v2844.7c0 82.97-36.49 124.45-108.95 124.45H322.307c-72.47 0-108.952-41.48-108.952-124.45v-2844.7c0-82.96 36.483-124.44 108.952-124.44H6165.15c72.46 0 108.95 41.48 108.95 124.44zM449.25-41.084h147.43m182.418 0h339.842m1407.86 0c0-91.458 46.98-151.43 140.94-179.92 23.99-7.497 50.97-12.493 80.46-15.993m0 0c24.49-2.497 51.48-3.997 79.96-3.997h820.63c32.49 0 61.97 2 88.96 5.497M1348.84-41.084H2526.8m221.4-195.913V-850.22m989.55 614.723c26.49 3 49.98 7.996 71.47 14.493 93.96 28.49 140.93 88.462 140.93 179.92m2024.08 0h50.98m-468.28 0h219.89m-1826.67 0h1416.86M3737.75-235.497V-850.22m212.4 809.136H2526.8M3737.75-850.22H2748.2" fill="none" stroke="#161616" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M2126.79-2789.58c-38.13 38.49-57.37 85.01-57.37 139.59 0 54.22 19.24 100.75 57.37 139.23 38.48 38.48 85.01 57.73 139.59 57.73 54.22 0 100.75-19.25 139.23-57.73 38.49-38.48 57.73-85.01 57.73-139.23 0-54.58-19.24-101.1-57.73-139.59-38.48-38.13-85.01-57.37-139.23-57.37-54.58 0-101.11 19.24-139.59 57.37z" fill="none" stroke="#161616" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M2640.7-3448.32c-286.51-11.2-546.09 38.83-778.73 150.43 143.08-106.7 307.5-172.47 493.27-197.66-6.3-14.34-18.9-29.04-38.13-43.73h-62.98c-210.25 36.73-380.62 103.9-511.11 201.16-197.66 325.7-291.76 678.68-281.62 1058.6 142.39 189.97 349.49 279.53 621.31 267.98l122.45-129.44c-148.68-52.82-255.03-123.49-318.7-212 214.1 133.99 465.63 199.41 754.24 196.26" fill="none" stroke="#161616" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M-3149.74-2789.58c-38.13 38.49-57.37 85.01-57.37 139.59 0 54.22 19.24 100.75 57.37 139.23 38.49 38.48 85.01 57.73 139.59 57.73 54.22 0 100.75-19.25 139.23-57.73 38.49-38.48 57.73-85.01 57.73-139.23 0-54.58-19.24-101.1-57.73-139.59-38.48-38.13-85.01-57.37-139.23-57.37-54.58 0-101.1 19.24-139.59 57.37z" fill="none" stroke="#161616" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(-.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M-2635.83-3448.32c-286.51-11.2-546.09 38.83-778.73 150.43 143.08-106.7 307.5-172.47 493.27-197.66-6.3-14.34-18.89-29.04-38.13-43.73h-62.98c-210.25 36.73-380.62 103.9-511.11 201.16-197.66 325.7-291.76 678.68-281.62 1058.6 142.39 189.97 349.49 279.53 621.32 267.98l122.44-129.44c-148.68-52.82-255.03-123.49-318.7-212 214.1 133.99 465.63 199.41 754.24 196.26" fill="none" stroke="#161616" stroke-width="69.967" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(-.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M474.47 230.785c-17.793 0-26.655 8.863-26.655 26.654v261.2-23.99H207.912h47.98v-58.9 34.91h143.94-47.98v23.99h95.963v-94.88c-.534-16.73-9.396-25.06-26.656-25.06H186.58c-17.792 0-26.656 8.86-26.656 26.65v163.85c0 17.26 8.33 26.12 25.057 26.65h333.8c16.66-.53 24.99-9.39 24.99-26.65V326.74h-34.65c-16.66.667-24.65-7.33-23.99-23.987h300.28c4.2-7.13 6.27-15.126 6.27-23.99v-21.32c0-17.792-8.86-26.655-26.65-26.655zm-13.327 311.842l23.99 22.588-23.99-22.588" fill="#376fa1"/>
|
||||||
|
<path d="M777.616 312.677c3.132-3.132 5.73-6.397 7.796-9.928h-300.28c-.665 16.65 7.33 24.65 23.992 23.98h234.572c13.26 0 24.523-4.67 33.92-14.06" fill="#578fc1"/>
|
||||||
|
<path d="M3890.68-40.99H1387.32m1971.1-1440.85v-1067.51c0-133.44 66.47-199.91 199.91-199.91h2179.01c133.44 0 199.91 66.47 199.91 199.91v159.93c0 66.47-15.49 126.44-46.98 179.92" fill="none" stroke="#000" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M5890.27-2209.5c-15.49 26.48-34.98 50.97-58.47 74.46-70.47 70.47-154.93 105.45-254.39 105.45H4078.1M3358.42-590.243V-770.16m719.68-1259.43h-259.88m-459.8 1259.43v-711.68M3638.3-240.9l-179.92-169.423M4449.93-40.99h-559.25m187.42-1988.6V-240.9c0 129.44-62.48 195.91-187.42 199.91m1007.04 0H4717.8M1559.24-770.16h359.84m4777.83-1259.43l-179.92-179.91m0 0l179.92-179.92M949.022-40.99h438.298M6516.99-2209.5h-626.72m-3971.19 997.54v261.88m0 0v179.92m1079.51-179.92h-359.84m0 0v179.92m-719.67-179.92h719.67m0 179.92h-719.67M1387.32-40.99c-125.44-4-187.91-70.47-187.91-199.91v-1228.94c0-133.44 66.47-199.91 199.9-199.91h1759.2c129.45 0 195.92 62.47 199.91 187.91m-719.67 711.68h719.67" fill="none" stroke="#000" stroke-width="79.964" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M7716.44-2209.5H7356.6m0 539.75l-179.92-179.92m179.92-899.59l-179.92 179.92" fill="none" stroke="#161616" stroke-width="99.954" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" transform="matrix(.13334 0 0 .13333 0 597.333)"/>
|
||||||
|
<path d="M769.485 258.24c-2.332-2.333-5.13-3.467-8.462-3.467s-6.198 1.134-8.53 3.466c-2.333 2.33-3.466 5.19-3.466 8.52s1.133 6.13 3.466 8.46c2.332 2.33 5.198 3.53 8.53 3.53 3.332 0 6.13-1.2 8.462-3.53 2.334-2.34 3.532-5.13 3.532-8.47 0-3.33-1.198-6.2-3.532-8.53"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 6.6 KiB |
|
@ -3,9 +3,12 @@
|
||||||
You can adapt this file completely to your liking, but it should at least
|
You can adapt this file completely to your liking, but it should at least
|
||||||
contain the root `toctree` directive.
|
contain the root `toctree` directive.
|
||||||
|
|
||||||
Welcome to Github-API-Wrapper's documentation!
|
Welcome to Github-API-Wrapper.
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
|
.. :: /images/snake.svg
|
||||||
|
.. :: /images/snake_dark.svg
|
||||||
|
|
||||||
.. automodule:: github
|
.. automodule:: github
|
||||||
|
|
||||||
|
|
||||||
|
|
250
docs/make.bat
|
@ -1,16 +1,62 @@
|
||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
|
|
||||||
pushd %~dp0
|
|
||||||
|
|
||||||
REM Command file for Sphinx documentation
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
if "%SPHINXBUILD%" == "" (
|
if "%SPHINXBUILD%" == "" (
|
||||||
set SPHINXBUILD=sphinx-build
|
set SPHINXBUILD=sphinx-build
|
||||||
)
|
)
|
||||||
set SOURCEDIR=.
|
|
||||||
set BUILDDIR=_build
|
set BUILDDIR=_build
|
||||||
|
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||||
|
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||||
|
if NOT "%PAPER%" == "" (
|
||||||
|
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||||
|
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||||
|
)
|
||||||
|
|
||||||
%SPHINXBUILD% >NUL 2>NUL
|
if "%1" == "" goto help
|
||||||
|
|
||||||
|
if "%1" == "help" (
|
||||||
|
:help
|
||||||
|
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||||
|
echo. html to make standalone HTML files
|
||||||
|
echo. dirhtml to make HTML files named index.html in directories
|
||||||
|
echo. singlehtml to make a single large HTML file
|
||||||
|
echo. pickle to make pickle files
|
||||||
|
echo. json to make JSON files
|
||||||
|
echo. htmlhelp to make HTML files and a HTML help project
|
||||||
|
echo. qthelp to make HTML files and a qthelp project
|
||||||
|
echo. devhelp to make HTML files and a Devhelp project
|
||||||
|
echo. epub to make an epub
|
||||||
|
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||||
|
echo. text to make text files
|
||||||
|
echo. man to make manual pages
|
||||||
|
echo. texinfo to make Texinfo files
|
||||||
|
echo. gettext to make PO message catalogs
|
||||||
|
echo. changes to make an overview over all changed/added/deprecated items
|
||||||
|
echo. xml to make Docutils-native XML files
|
||||||
|
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
||||||
|
echo. linkcheck to check all external links for integrity
|
||||||
|
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||||
|
echo. coverage to run coverage check of the documentation if enabled
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "clean" (
|
||||||
|
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||||
|
del /q /s %BUILDDIR%\*
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
REM Check if sphinx-build is available and fallback to Python version if any
|
||||||
|
%SPHINXBUILD% 2> nul
|
||||||
|
if errorlevel 9009 goto sphinx_python
|
||||||
|
goto sphinx_ok
|
||||||
|
|
||||||
|
:sphinx_python
|
||||||
|
|
||||||
|
set SPHINXBUILD=python -m sphinx.__init__
|
||||||
|
%SPHINXBUILD% 2> nul
|
||||||
if errorlevel 9009 (
|
if errorlevel 9009 (
|
||||||
echo.
|
echo.
|
||||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
@ -19,17 +65,199 @@ if errorlevel 9009 (
|
||||||
echo.may add the Sphinx directory to PATH.
|
echo.may add the Sphinx directory to PATH.
|
||||||
echo.
|
echo.
|
||||||
echo.If you don't have Sphinx installed, grab it from
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
echo.https://www.sphinx-doc.org/
|
echo.http://sphinx-doc.org/
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%1" == "" goto help
|
:sphinx_ok
|
||||||
|
|
||||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:help
|
if "%1" == "html" (
|
||||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "dirhtml" (
|
||||||
|
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "singlehtml" (
|
||||||
|
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "pickle" (
|
||||||
|
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished; now you can process the pickle files.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "json" (
|
||||||
|
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished; now you can process the JSON files.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "htmlhelp" (
|
||||||
|
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||||
|
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "qthelp" (
|
||||||
|
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||||
|
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||||
|
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\discord.py.qhcp
|
||||||
|
echo.To view the help file:
|
||||||
|
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\discord.py.ghc
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "devhelp" (
|
||||||
|
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "epub" (
|
||||||
|
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "latex" (
|
||||||
|
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "latexpdf" (
|
||||||
|
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||||
|
cd %BUILDDIR%/latex
|
||||||
|
make all-pdf
|
||||||
|
cd %~dp0
|
||||||
|
echo.
|
||||||
|
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "latexpdfja" (
|
||||||
|
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||||
|
cd %BUILDDIR%/latex
|
||||||
|
make all-pdf-ja
|
||||||
|
cd %~dp0
|
||||||
|
echo.
|
||||||
|
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "text" (
|
||||||
|
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "man" (
|
||||||
|
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "texinfo" (
|
||||||
|
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "gettext" (
|
||||||
|
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "changes" (
|
||||||
|
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.The overview file is in %BUILDDIR%/changes.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "linkcheck" (
|
||||||
|
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Link check complete; look for any errors in the above output ^
|
||||||
|
or in %BUILDDIR%/linkcheck/output.txt.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "doctest" (
|
||||||
|
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Testing of doctests in the sources finished, look at the ^
|
||||||
|
results in %BUILDDIR%/doctest/output.txt.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "coverage" (
|
||||||
|
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Testing of coverage in the sources finished, look at the ^
|
||||||
|
results in %BUILDDIR%/coverage/python.txt.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "xml" (
|
||||||
|
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
|
if "%1" == "pseudoxml" (
|
||||||
|
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
||||||
|
if errorlevel 1 exit /b 1
|
||||||
|
echo.
|
||||||
|
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
||||||
|
goto end
|
||||||
|
)
|
||||||
|
|
||||||
:end
|
:end
|
||||||
popd
|
|
||||||
|
|