diff --git a/Pipfile b/Pipfile index 62eff03..1305771 100644 --- a/Pipfile +++ b/Pipfile @@ -17,6 +17,8 @@ mock = "*" setuptools-scm = "*" wheel = "*" pre-commit = "*" +sphinx-palewire-theme = "*" +myst-parser = "*" [requires] python_version = "3.11" diff --git a/Pipfile.lock b/Pipfile.lock index 4724325..8bb294b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0a033fefdd646d8d2412c8223482876fe4a3180eb9fb4ae899cf3f0be269e411" + "sha256": "48e591910129e4ea9aadc3798f39fdcbc6ecf63bbe80f5ede24741c1a58dc5ae" }, "pipfile-spec": 6, "requires": { @@ -530,6 +530,14 @@ "markers": "python_version >= '3.6'", "version": "==0.7.0" }, + "mdit-py-plugins": { + "hashes": [ + "sha256:b51b3bb70691f57f974e257e367107857a93b36f322a9e6d44ca5bf28ec2def9", + "sha256:d8ab27e9aed6c38aa716819fedfde15ca275715955f8a185a8e1cf90fb1d2c1b" + ], + "markers": "python_version >= '3.8'", + "version": "==0.4.0" + }, "mdurl": { "hashes": [ "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", @@ -555,6 +563,15 @@ "markers": "python_version >= '3.8'", "version": "==10.1.0" }, + "myst-parser": { + "hashes": [ + "sha256:7c36344ae39c8e740dad7fdabf5aa6fc4897a813083c6cc9990044eb93656b14", + "sha256:ea929a67a6a0b1683cdbe19b8d2e724cd7643f8aa3e7bb18dd65beac3483bead" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==2.0.0" + }, "nh3": { "hashes": [ "sha256:0d02d0ff79dfd8208ed25a39c12cbda092388fff7f1662466e27d97ad011b770", @@ -801,6 +818,13 @@ "markers": "python_version >= '3.6'", "version": "==2021.3.14" }, + "sphinx-palewire-theme": { + "hashes": [ + "sha256:2d13da512684e54d8654f79d0a9d63b58aabf2e7b8ca5f16bfeb946b77ce4956" + ], + "index": "pypi", + "version": "==0.0.10" + }, "sphinxcontrib-applehelp": { "hashes": [ "sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d", diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css deleted file mode 100644 index 0de00e4..0000000 --- a/docs/_static/css/custom.css +++ /dev/null @@ -1,205 +0,0 @@ -@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,400;0,700;0,800;1,400;1,800&display=swap'); - -div.document { - margin-top: 0; -} - -div.body { - min-width: 0 !important; -} - -div.body p, div.body li { - line-height: 1.45; -} - -div.body li { - margin-bottom: 4px; -} - -div.topic { - margin: 0; - padding: 8px 12px; -} - -p.topic-title { - margin: 0; -} - -div.topic ul { - margin-top: 6px; -} -@media screen and (max-width: 870px) { - ul { - margin: 10px 0 10px 20px; - } -} - -div.sphinxsidebar h3 { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; -} - -@media (min-width: 875px) { - div.sphinxsidebar { - margin-top: 85px; - } -} - -@media screen and (max-width: 875px) { - div.sphinxsidebar { - width: auto; - padding: 0px 20px; - margin: 50px 0 0 0; - } -} - -div.admonition { - padding: 15px; -} - -div.warning { - background-color: #EEE; - border: 1px solid #CCC; -} - -div.admonition p.admonition-title { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - margin: 0; -} - -div.related nav { - padding-right: 10px; -} - -body { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - font-size: 20px; - line-height: 1.45; - text-align: left; -} -@media screen and (max-width: 875px) { - body { - margin: 0; - padding: 0; - } - div.body > .section { - padding: 0 20px; - } -} - -@media (max-width: 550px) { - body { - font-size: 0.85em; - } -} - -div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; - font-weight: 700; -} - -div.body h1 { - font-weight: 800; - font-size: 220%; -} - -pre { - padding: 7px; -} - -.row { - width: 100%; - max-width: 660px; - margin: 0 auto; - overflow: hidden; -} -.row .fivecol { - width: 40%; - float: right; - min-height: 1px; -} -.row .sevencol { - width: 40%; - float: left; - min-height: 1px; -} -@media (max-width: 550px) { - .row .fivecol, .row .sevencol { - padding: 0 20px; - } -} - -/* The header */ -nav { - display: block; - margin-top: 0.75em; - margin-bottom: 0.5em; - font-size: 1em; - line-height: 1.7em; -} -nav .shingle { - font-size: 1.7em; - font-weight: bold; - text-align: left; - padding-left: 0.15em; -} -nav .shingle a { - text-decoration: none; - font-weight: bold; - color: #000; -} -nav .shingle a:hover { - color: #686868; -} -@media (max-width: 550px) { - nav .shingle { - float: left; - margin-bottom: 5px; - } -} -nav .links { - text-align: right; -} -nav .links ul { - float: right; - list-style-type: none; - margin: 4px 0 0 0; -} -nav .links li { - float: left; - list-style-position: inside; - margin-left: 0.5em; - font-size: 0.9em; - font-weight: 300; - margin-bottom: 0; -} -nav .links li a { - text-decoration: none; -} -nav .links li a:hover { - text-decoration: underline; -} -.last { - margin-right: 0; -} - -.topbar { - border-bottom: solid 10px #e5e5e5; - margin-bottom: 20px; - width: 100%; -} - -a:link { - text-decoration: none; - color: #686868; -} -a:visited { - text-decoration: none; - color: #686868; -} -a:hover { - text-decoration: underline; -} -a:active { - text-decoration: underline; - color: #000; -} diff --git a/docs/conf.py b/docs/conf.py index 7447121..423d247 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,38 +1,32 @@ -import typing +"""Configure Sphinx configuration.""" +from __future__ import annotations + +import os +import sys +from typing import Any from datetime import datetime -extensions: typing.List[typing.Any] = [] -templates_path = ["_templates"] -source_suffix = ".rst" +sys.path.insert(0, os.path.abspath("..")) + +source_suffix = ".md" master_doc = "index" project = "django-postgres-copy" year = datetime.now().year -copyright = f"{year} Ben Welsh" +copyright = f"{year} palewire" exclude_patterns = ["_build"] -html_theme = "alabaster" -html_sidebars = { - "**": [ - # 'about.html', - # 'navigation.html', - "relations.html", - "searchbox.html", - "donate.html", - ] -} -html_theme_options = { +html_theme = "palewire" +html_sidebars: dict[Any, Any] = {} +html_theme_options: dict[Any, Any] = { "canonical_url": f"https://palewi.re/docs/{project}/", - "github_user": "palewire", - "github_repo": project, - "donate_url": "https://github.com/sponsors/palewire", - "show_powered_by": False, + "nosidebar": True, } -html_static_path = ["_static"] -html_css_files = [ - "css/custom.css", -] - pygments_style = "sphinx" + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", +] \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 125b24b..4bafa9d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,48 +1,3 @@ -.. raw:: html - - -
-
-
- ==================== django-postgres-copy ==================== diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 036a002..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,263 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-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% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ 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 ( - 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 -) - -:sphinx_ok - - -if "%1" == "html" ( - %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\django-postgres-copy.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django-postgres-copy.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