Skip to content

Commit 4be645f

Browse files
committed
3.0 and docs
1 parent 268eac4 commit 4be645f

File tree

14 files changed

+989
-276
lines changed

14 files changed

+989
-276
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ __pycache__/
44
*.pyc
55
/dist/
66
/*.egg-info/
7+
docs/build
8+
docs/_static/

.readthedocs.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
formats: []
3+
4+
build:
5+
image: testing
6+
7+
sphinx:
8+
configuration: docs/conf.py
9+
fail_on_warning: false
10+
builder: html
11+
12+
python:
13+
version: 3.9
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- docs

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/client.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
API Reference
2+
=============
3+
4+
.. currentmodule:: mystbin
5+
6+
Client
7+
------
8+
.. autoclass:: Client
9+
:members:
10+
11+
.. autoclass:: SyncClient
12+
:members:
13+
14+
Paste
15+
-----
16+
.. autoclass:: Paste
17+
:members:
18+
19+
.. autoclass:: PasteData
20+
:members:

docs/conf.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import re
15+
import sys
16+
17+
18+
sys.path.insert(0, os.path.abspath(".."))
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = "Mystbin"
23+
copyright = "2021, Alex Nørgaard"
24+
author = "Alex Nørgaard"
25+
26+
# The full version, including alpha/beta/rc tags
27+
version = ""
28+
29+
with open("../mystbin/__init__.py") as f:
30+
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
31+
32+
release = version
33+
34+
35+
# -- General configuration ---------------------------------------------------
36+
37+
# Add any Sphinx extension module names here, as strings. They can be
38+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+
# ones.
40+
extensions = [
41+
"sphinx.ext.autodoc",
42+
"sphinx.ext.extlinks",
43+
"sphinx.ext.intersphinx",
44+
"sphinx.ext.napoleon",
45+
"sphinxcontrib_trio",
46+
]
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
templates_path = ["_templates"]
50+
51+
autodoc_typehints = "none"
52+
53+
# List of patterns, relative to source directory, that match files and
54+
# directories to ignore when looking for source files.
55+
# This pattern also affects html_static_path and html_extra_path.
56+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
57+
58+
# Links used for cross-referencing other documentation
59+
intersphinx_mapping = {
60+
"py": ("https://docs.python.org/3", None),
61+
"aio": ("https://docs.aiohttp.org/en/stable/", None),
62+
"req": ("https://docs.python-requests.org/en/latest/", None),
63+
}
64+
65+
# Prolog for asynchronous functions
66+
rst_prolog = """
67+
.. |coro| replace:: This function is a |coroutine_link|_.
68+
.. |maybecoro| replace:: This function *could be a* |coroutine_link|_.
69+
.. |coroutine_link| replace:: *coroutine*
70+
.. _coroutine_link: https://docs.python.org/3/library/asyncio-task.html#coroutine
71+
"""
72+
73+
# -- Options for HTML output -------------------------------------------------
74+
75+
# The theme to use for HTML and HTML Help pages. See the documentation for
76+
# a list of builtin themes.
77+
#
78+
html_theme = "furo"
79+
80+
# Add any paths that contain custom static files (such as style sheets) here,
81+
# relative to this directory. They are copied after the builtin static files,
82+
# so a file named "default.css" will overwrite the builtin "default.css".
83+
html_static_path = ["_static"]

docs/exceptions.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Exceptions
2+
==========
3+
4+
.. currentmodule:: mystbin
5+
6+
BadPasteID
7+
~~~~~~~~~~
8+
.. autoexception:: BadPasteID()
9+
10+
MystbinException
11+
~~~~~~~~~~~~~~~~
12+
.. autoexception:: MystbinException()
13+
14+
APIError
15+
~~~~~~~~
16+
.. autoexception:: APIError()

docs/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. Hondana documentation master file, created by
2+
sphinx-quickstart on Thu Jul 15 19:02:45 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Hondana's documentation!
7+
=======================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
client
14+
exceptions
15+
16+
17+
Indices and tables
18+
==================
19+
20+
* :ref:`genindex`
21+
* :ref:`modindex`
22+
* :ref:`search`

docs/make.bat

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

mystbin/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@
2424

2525
from typing import Literal, NamedTuple
2626

27-
from .client import HTTPClient as Client
27+
from .client import Client as Client
28+
from .client import SyncClient as SyncClient
2829
from .errors import *
30+
from .objects import Paste as Paste
31+
from .objects import PasteData as PasteData
2932

3033

3134
class VersionInfo(NamedTuple):
@@ -36,5 +39,5 @@ class VersionInfo(NamedTuple):
3639
serial: int
3740

3841

39-
__version__ = "2.2.0"
40-
version_info: VersionInfo = VersionInfo(major=2, minor=2, micro=0, releaselevel="final", serial=0)
42+
__version__ = "3.0.0"
43+
version_info: VersionInfo = VersionInfo(major=3, minor=0, micro=0, releaselevel="final", serial=0)

0 commit comments

Comments
 (0)