diff --git a/.vscode/settings.json b/.vscode/settings.json index e760f5c..7c3add2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "autoDocstring.docstringFormat": "sphinx", + "restructuredtext.confPath": "${workspaceFolder}/docs", "python.pythonPath": "${workspaceFolder}/venv/bin/python3" } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 1ff7e5f..3705f34 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,24 +2,33 @@ alabaster==0.7.12 Babel==2.8.0 bcrypt==3.1.7 beautifulsoup4==4.9.1 +bleach==3.1.5 certifi==2020.6.20 cffi==1.14.1 chardet==3.0.4 +colorama==0.4.3 cryptography==3.0 docutils==0.16 idna==2.10 imagesize==1.2.0 +jeepney==0.4.3 Jinja2==2.11.2 +keyring==21.2.1 lxml==4.5.2 MarkupSafe==1.1.1 packaging==20.4 paramiko==2.7.1 +pkginfo==1.5.0.1 pycparser==2.20 Pygments==2.6.1 PyNaCl==1.4.0 pyparsing==2.4.7 pytz==2020.1 +readme-renderer==26.0 requests==2.24.0 +requests-toolbelt==0.9.1 +rfc3986==1.4.0 +SecretStorage==3.1.2 six==1.15.0 snowballstemmer==2.0.0 soupsieve==2.0.1 @@ -31,4 +40,7 @@ sphinxcontrib-htmlhelp==1.0.3 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.4 +tqdm==4.48.0 +twine==3.2.0 urllib3==1.25.10 +webencodings==0.5.1 diff --git a/sphinx/Makefile b/sphinx/Makefile new file mode 100644 index 0000000..f9464a2 --- /dev/null +++ b/sphinx/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= -d _doctrees -b dirhtml +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/sphinx/_doctrees/api.doctree b/sphinx/_doctrees/api.doctree new file mode 100644 index 0000000..706a366 Binary files /dev/null and b/sphinx/_doctrees/api.doctree differ diff --git a/sphinx/_doctrees/environment.pickle b/sphinx/_doctrees/environment.pickle new file mode 100644 index 0000000..bfb4e3c Binary files /dev/null and b/sphinx/_doctrees/environment.pickle differ diff --git a/sphinx/_doctrees/index.doctree b/sphinx/_doctrees/index.doctree new file mode 100644 index 0000000..eeb90ee Binary files /dev/null and b/sphinx/_doctrees/index.doctree differ diff --git a/sphinx/api.rst b/sphinx/api.rst new file mode 100644 index 0000000..5269d9b --- /dev/null +++ b/sphinx/api.rst @@ -0,0 +1,43 @@ +API Reference +============= + + +Session +------- + +.. autoclass:: minehost.Session + :members: + :special-members: + +Account +------- + +.. autoclass:: minehost.Account + :members: + :special-members: + +MCServer +-------- + +.. autoclass:: minehost.MCServer + :members: + :special-members: + +CommandSender +------------- + +.. autoclass:: minehost.server.CommandSender + :members: + :private-members: + +Exceptions +---------- + +.. autoclass:: minehost.server.InvalidDomainException + :members: + +.. autoclass:: minehost.session.IncorrectLoginException + :members: + +.. autoclass:: minehost.session.InvalidSessionException + :members: diff --git a/sphinx/conf.py b/sphinx/conf.py new file mode 100644 index 0000000..08e5a6a --- /dev/null +++ b/sphinx/conf.py @@ -0,0 +1,64 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.abspath('..')) + + +# -- Project information ----------------------------------------------------- + +project = 'MineHost Interface' +copyright = '2020, Rokas Puzonas' +author = 'Rokas Puzonas' + +# The full version, including alpha/beta/rc tags +release = '1.0.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.todo', + 'sphinx.ext.githubpages', + 'sphinx.ext.autodoc', + 'sphinx.ext.viewcode' +] + +source_suffix = '.rst' +master_doc = 'index' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', "_doctrees"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. + + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + diff --git a/sphinx/index.rst b/sphinx/index.rst new file mode 100644 index 0000000..5b2c715 --- /dev/null +++ b/sphinx/index.rst @@ -0,0 +1,15 @@ +Welcome to the MineHost Interface documentation! +================================================ + +This is a small personal project so only the api is documented. +Additional pages will only be added if there is a significant number of people that want it. + +If you want to contribute, just make a push request to the repository on github. + +API +--- + +.. toctree:: + :maxdepth: 2 + + api \ No newline at end of file diff --git a/sphinx/make.bat b/sphinx/make.bat new file mode 100644 index 0000000..922152e --- /dev/null +++ b/sphinx/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd