From 7573f29950631a04aacc17186c3ddef618302fca Mon Sep 17 00:00:00 2001 From: Eriks Karls Date: Wed, 28 Aug 2019 17:16:46 +0300 Subject: [PATCH] Freshening up documentation --- README.rst | 4 +-- docs/conf.py | 9 +++--- docs/installation.rst | 8 ++--- docs/make.bat | 72 +++++++++++++++++++++---------------------- docs/usage.rst | 5 ++- requirements_dev.txt | 1 + tox.ini | 2 +- 7 files changed, 52 insertions(+), 49 deletions(-) diff --git a/README.rst b/README.rst index c280be2..040b593 100644 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ eRepublik script :target: https://pypi.python.org/pypi/erepublik .. image:: https://readthedocs.org/projects/erepublik_script/badge/?version=latest - :target: https://erepublik_script.readthedocs.io/en/latest/?badge=latest + :target: https://erepublik.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status @@ -15,7 +15,7 @@ Python package for automated eRepublik playing * Free software: MIT license -* Documentation: https://erepublik.readthedocs.io. +* Documentation: https://erepublik.readthedocs.io/en/latest/ Features diff --git a/docs/conf.py b/docs/conf.py index 5873dcb..40ebcc0 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,6 +23,7 @@ import sys sys.path.insert(0, os.path.abspath('..')) import erepublik +import edx_theme # -- General configuration --------------------------------------------- @@ -32,7 +33,7 @@ import erepublik # 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.autodoc', 'sphinx.ext.viewcode'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'edx_theme'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -84,7 +85,8 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'edx_theme' +html_theme_path = [edx_theme.get_html_theme_path()] # 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 @@ -158,6 +160,3 @@ texinfo_documents = [ 'One line description of project.', 'Miscellaneous'), ] - - - diff --git a/docs/installation.rst b/docs/installation.rst index e9751ac..d3b9dbc 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -32,13 +32,13 @@ You can either clone the public repository: .. code-block:: console - $ git clone git://github.com/eeriks/erepublik_script + $ git clone git://github.com/eeriks/erepublik Or download the `tarball`_: .. code-block:: console - $ curl -OL https://github.com/eeriks/erepublik_script/tarball/master + $ curl -OL https://github.com/eeriks/erepublik/tarball/master Once you have a copy of the source, you can install it with: @@ -47,5 +47,5 @@ Once you have a copy of the source, you can install it with: $ python setup.py install -.. _Github repo: https://github.com/eeriks/erepublik_script -.. _tarball: https://github.com/eeriks/erepublik_script/tarball/master +.. _Github repo: https://github.com/eeriks/erepublik +.. _tarball: https://github.com/eeriks/erepublik/tarball/master diff --git a/docs/make.bat b/docs/make.bat index a11302f..97cad33 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -1,36 +1,36 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=python -msphinx -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=erepublik_script - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The Sphinx module was not found. Make sure you have Sphinx installed, - echo.then set the SPHINXBUILD environment variable to point to the full - echo.path of the 'sphinx-build' executable. Alternatively you may add the - echo.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% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=python -msphinx +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=erepublik + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The Sphinx module was not found. Make sure you have Sphinx installed, + echo.then set the SPHINXBUILD environment variable to point to the full + echo.path of the 'sphinx-build' executable. Alternatively you may add the + echo.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% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/docs/usage.rst b/docs/usage.rst index ad4642f..027cd12 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -4,4 +4,7 @@ Usage To use eRepublik script in a project:: - import erepublik + from erepublik import Citizen + player = Citizen('email@domain.com', 'password') + player.update_all() + diff --git a/requirements_dev.txt b/requirements_dev.txt index c242dcf..6fdbc4d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -13,3 +13,4 @@ pytz==2019.1 requests==2.22.0 pycryptodome==3.8.2 python-slugify==2.0.1 +edx-sphinx-theme diff --git a/tox.ini b/tox.ini index 916f9ed..ab36d1d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36, py37, flake8 +envlist = py37, flake8 [travis] python =