From 79714afe84b27a0661fbc4971a8837921a86e055 Mon Sep 17 00:00:00 2001 From: palewire Date: Tue, 28 Nov 2023 05:42:16 -0500 Subject: [PATCH] Switch to my Sphinx theme --- Pipfile | 1 + Pipfile.lock | 9 +- docs/_static/css/custom.css | 234 ------------------------------ docs/_static/{img => }/detail.png | Bin docs/_static/{img => }/list.png | Bin docs/_templates/nav.html | 49 ------- docs/conf.py | 28 +--- docs/index.md | 35 +---- docs/make.bat | 35 ----- docs/requirements.txt | 1 + 10 files changed, 22 insertions(+), 370 deletions(-) delete mode 100644 docs/_static/css/custom.css rename docs/_static/{img => }/detail.png (100%) rename docs/_static/{img => }/list.png (100%) delete mode 100644 docs/_templates/nav.html delete mode 100644 docs/make.bat diff --git a/Pipfile b/Pipfile index bde1966..0966f65 100644 --- a/Pipfile +++ b/Pipfile @@ -12,6 +12,7 @@ setuptools-scm = "*" pre-commit = "*" sphinx = "*" myst-parser = "*" +sphinx-palewire-theme = "*" [packages] requests = "*" diff --git a/Pipfile.lock b/Pipfile.lock index e45ef35..9326138 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "1c88247bc94fc3c05ec66ebdd7110cb793defeb62e8d6674b45b40ede5e7da1f" + "sha256": "1bb7b7df7530689ba38033f0be25ad41106f75b6beb90199d5fbc0011d523fd6" }, "pipfile-spec": 6, "requires": { @@ -739,6 +739,13 @@ "markers": "python_version >= '3.9'", "version": "==7.2.6" }, + "sphinx-palewire-theme": { + "hashes": [ + "sha256:252f95aa9c6d4feb8237fd0d30d530564c28c149660cea8b6ba3ab86e5273503" + ], + "index": "pypi", + "version": "==0.0.7" + }, "sphinxcontrib-applehelp": { "hashes": [ "sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d", diff --git a/docs/_static/css/custom.css b/docs/_static/css/custom.css deleted file mode 100644 index b6b8bd0..0000000 --- a/docs/_static/css/custom.css +++ /dev/null @@ -1,234 +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 h1.logo, -div.sphinxsidebar h3 { - font-family: 'Libre Franklin', "Helvetica", "Liberation Sans", Arial, sans-serif; -} - -div.sphinxsidebarwrapper h1.logo { - font-size: 1.85em; - font-weight: 800; -} - -@media (min-width: 875px) { - div.sphinxsidebar { - margin-top: 85px; - } -} - -@media screen and (max-width: 875px) { - div.sphinxsidebar { - width: auto; - padding: 10px 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, - 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; -} - -.cell_output { - overflow: auto; -} - -.toctree-wrapper p.caption { - font-weight: 700; -} - -.toggle-details { - display: none; -} - -.row { - width: 100%; - max-width: 660px; - margin: 0 auto; - overflow: hidden; -} -.row .fivecol { - width: 43%; - float: right; - min-height: 1px; -} -.row .sevencol { - width: 37%; - 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; - padding-left: 0; - } -} -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; -} -@media (max-width: 550px) { - nav .links li { - font-size: .825em; - } -} -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; -} - -.contents ul p { - margin-bottom: 0; -} diff --git a/docs/_static/img/detail.png b/docs/_static/detail.png similarity index 100% rename from docs/_static/img/detail.png rename to docs/_static/detail.png diff --git a/docs/_static/img/list.png b/docs/_static/list.png similarity index 100% rename from docs/_static/img/list.png rename to docs/_static/list.png diff --git a/docs/_templates/nav.html b/docs/_templates/nav.html deleted file mode 100644 index cd40a0e..0000000 --- a/docs/_templates/nav.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -
-
-
diff --git a/docs/conf.py b/docs/conf.py index c005f1d..dc31756 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,35 +9,17 @@ extensions = [ "myst_parser", ] -templates_path = ["_templates"] -source_suffix = ".rst" +source_suffix = ".md" master_doc = "index" project = "django-anss-archive" 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 = "palewire" html_theme_options = { "canonical_url": f"https://palewi.re/docs/{project}/", - "show_powered_by": False, - "show_relbar_bottom": True, -} - -html_static_path = ["_static"] -html_css_files = [ - "css/custom.css", -] - -pygments_style = "sphinx" + "nosidebar": True, +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index e0bdb53..619cf5f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,19 +1,11 @@ -```{include} _templates/nav.html -``` - # django-anss-archive A Django application to archive real-time earthquake notifications from the [U.S. Geological Survey's Advanced National Seismic System](https://earthquake.usgs.gov/earthquakes/feed/) -```{contents} Table of contents -:local: -:depth: 2 -``` - ## Requirements -- The Django web framework -- A geospatial database like PostGIS +- The [Django web framework](https://www.djangoproject.com/) +- A geospatial database like [PostGIS](https://postgis.net/) ## Getting started @@ -35,6 +27,8 @@ Run migrations to create database tables. python manage.py migrate ``` +## Usage + Run the archive command to save all earthquakes in the latest hour greater than 1.0 magnitude. ```bash @@ -49,29 +43,14 @@ python manage.py runserver It includes a list of all the earthquakes. -![list](_static/img/list.png) +![list](_static/list.png) And lots of data about each one. -![detail](_static/img/detail.png) - -## Contributing - -Install dependencies for development. - -```bash -pipenv install --dev -``` - -Run tests. - -```bash -pipenv run python setup.py test -``` +![detail](_static/detail.png) -## Links +## Other resources -* Docs: [palewi.re/docs/django-anss-archive/](https://palewi.re/docs/django-anss-archive/) * Code: [github.com/datadesk/django-anss-archive](https://github.com/datadesk/django-anss-archive/) * Issues: [github.com/datadesk/django-anss-archive/issues](https://github.com/datadesk/django-anss-archive/issues) * Packaging: [pypi.python.org/pypi/django-anss-archive](https://pypi.python.org/pypi/django-anss-archive) diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 32bb245..0000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%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.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt index 98a3c62..63ddc06 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ sphinx myst-parser +sphinx-palewire-theme \ No newline at end of file