Switch docs theme to Furo, refs #435

This commit is contained in:
Simon Willison 2022-05-20 14:51:30 -07:00
commit 397183debd
8 changed files with 15 additions and 31 deletions

View file

@ -1,13 +1,3 @@
{%- extends "!layout.html" %}
{% block htmltitle %}
{{ super() }}
<script defer data-domain="sqlite-utils.datasette.io" src="https://plausible.io/js/plausible.js"></script>
{% endblock %}
{% block footer %}
{{ super() }}
<script>
jQuery(function ($) {
// Show banner linking to /stable/ if this is a /latest/ page
if (!/\/latest\//.test(location.pathname)) {
@ -27,13 +17,7 @@ jQuery(function ($) {
</div>`
);
warning.find("a").attr("href", stableUrl);
var body = $("div.body");
if (!body.length) {
body = $("div.document");
}
body.prepend(warning);
$("article[role=main]").prepend(warning);
}
});
});
</script>
{% endblock %}

6
docs/_templates/base.html vendored Normal file
View file

@ -0,0 +1,6 @@
{%- extends "!base.html" %}
{% block site_meta %}
{{ super() }}
<script defer data-domain="sqlite-utils.datasette.io" src="https://plausible.io/js/plausible.js"></script>
{% endblock %}

View file

@ -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

View file

@ -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:

View file

@ -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 ------------------------------------------

View file

@ -5,6 +5,7 @@
=============================
.. contents:: :local:
:class: this-will-duplicate-information-and-it-is-still-useful-here
.. _python_api_getting_started:

View file

@ -5,6 +5,7 @@
===============
.. contents:: :local:
:class: this-will-duplicate-information-and-it-is-still-useful-here
.. _reference_db_database:

View file

@ -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",