From 397183debd9329a2ddbcabe7a181278f042952ad Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 20 May 2022 14:51:30 -0700 Subject: [PATCH] Switch docs theme to Furo, refs #435 --- .../layout.html => _static/js/custom.js} | 18 +----------------- docs/_templates/base.html | 6 ++++++ docs/cli-reference.rst | 1 + docs/cli.rst | 1 + docs/conf.py | 16 +++------------- docs/python-api.rst | 1 + docs/reference.rst | 1 + setup.py | 2 +- 8 files changed, 15 insertions(+), 31 deletions(-) rename docs/{_templates/layout.html => _static/js/custom.js} (67%) create mode 100644 docs/_templates/base.html diff --git a/docs/_templates/layout.html b/docs/_static/js/custom.js similarity index 67% rename from docs/_templates/layout.html rename to docs/_static/js/custom.js index cecf66e..8786865 100644 --- a/docs/_templates/layout.html +++ b/docs/_static/js/custom.js @@ -1,13 +1,3 @@ -{%- extends "!layout.html" %} - -{% block htmltitle %} -{{ super() }} - -{% endblock %} - -{% block footer %} -{{ super() }} - -{% endblock %} diff --git a/docs/_templates/base.html b/docs/_templates/base.html new file mode 100644 index 0000000..a9e670e --- /dev/null +++ b/docs/_templates/base.html @@ -0,0 +1,6 @@ +{%- extends "!base.html" %} + +{% block site_meta %} +{{ super() }} + +{% endblock %} \ No newline at end of file diff --git a/docs/cli-reference.rst b/docs/cli-reference.rst index c3f7a24..7d73e12 100644 --- a/docs/cli-reference.rst +++ b/docs/cli-reference.rst @@ -7,6 +7,7 @@ This page lists the ``--help`` for every ``sqlite-utils`` CLI sub-command. .. contents:: :local: + :class: this-will-duplicate-information-and-it-is-still-useful-here .. [[[cog from sqlite_utils import cli diff --git a/docs/cli.rst b/docs/cli.rst index 190d285..2d2ea76 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -9,6 +9,7 @@ The ``sqlite-utils`` command-line tool can be used to manipulate SQLite database Once installed, the tool should be available as ``sqlite-utils``. It can also be run using ``python -m sqlite_utils``. .. contents:: :local: + :class: this-will-duplicate-information-and-it-is-still-useful-here .. _cli_query: diff --git a/docs/conf.py b/docs/conf.py index 03c13d6..7244d2d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -94,7 +94,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 = "sphinx_rtd_theme" +html_theme = "furo" +html_title = "sqlite-utils" # 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 @@ -107,18 +108,7 @@ html_theme = "sphinx_rtd_theme" # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - "**": [ - "relations.html", # needs 'show_related': True theme option to display - "searchbox.html", - ] -} - +html_js_files = ["js/custom.js"] # -- Options for HTMLHelp output ------------------------------------------ diff --git a/docs/python-api.rst b/docs/python-api.rst index bd0265b..82ec11c 100644 --- a/docs/python-api.rst +++ b/docs/python-api.rst @@ -5,6 +5,7 @@ ============================= .. contents:: :local: + :class: this-will-duplicate-information-and-it-is-still-useful-here .. _python_api_getting_started: diff --git a/docs/reference.rst b/docs/reference.rst index 5bd609f..2896bbf 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -5,6 +5,7 @@ =============== .. contents:: :local: + :class: this-will-duplicate-information-and-it-is-still-useful-here .. _reference_db_database: diff --git a/setup.py b/setup.py index 8c5ed1b..51830e3 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ setup( ], extras_require={ "test": ["pytest", "black", "hypothesis", "cogapp"], - "docs": ["sphinx_rtd_theme", "sphinx-autobuild", "codespell"], + "docs": ["furo", "sphinx-autobuild", "codespell"], "mypy": [ "mypy", "types-click",