mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Switch docs theme to Furo, refs #1746
This commit is contained in:
parent
1465fea479
commit
1d33fd03b3
10 changed files with 72 additions and 84 deletions
7
docs/_static/css/custom.css
vendored
7
docs/_static/css/custom.css
vendored
|
|
@ -1,7 +1,8 @@
|
||||||
a.external {
|
a.external {
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
body[data-theme="dark"] .sidebar-logo-container {
|
||||||
div .wy-side-nav-search > div.version {
|
background-color: white;
|
||||||
color: rgba(0,0,0,0.75);
|
padding: 5px;
|
||||||
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,3 @@
|
||||||
{%- extends "!layout.html" %}
|
|
||||||
|
|
||||||
{% block htmltitle %}
|
|
||||||
{{ super() }}
|
|
||||||
<script defer data-domain="docs.datasette.io" src="https://plausible.io/js/plausible.js"></script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block sidebartitle %}
|
|
||||||
|
|
||||||
<a href="https://datasette.io/">
|
|
||||||
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{% if theme_display_version %}
|
|
||||||
{%- set nav_version = version %}
|
|
||||||
{% if READTHEDOCS and current_version %}
|
|
||||||
{%- set nav_version = current_version %}
|
|
||||||
{% endif %}
|
|
||||||
{% if nav_version %}
|
|
||||||
<div class="version">
|
|
||||||
{{ nav_version }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% include "searchbox.html" %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block footer %}
|
|
||||||
{{ super() }}
|
|
||||||
<script>
|
|
||||||
jQuery(function ($) {
|
jQuery(function ($) {
|
||||||
// Show banner linking to /stable/ if this is a /latest/ page
|
// Show banner linking to /stable/ if this is a /latest/ page
|
||||||
if (!/\/latest\//.test(location.pathname)) {
|
if (!/\/latest\//.test(location.pathname)) {
|
||||||
|
|
@ -57,5 +25,3 @@ jQuery(function ($) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
||||||
6
docs/_templates/base.html
vendored
Normal file
6
docs/_templates/base.html
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{%- extends "!base.html" %}
|
||||||
|
|
||||||
|
{% block site_meta %}
|
||||||
|
{{ super() }}
|
||||||
|
<script defer data-domain="docs.datasette.io" src="https://plausible.io/js/plausible.js"></script>
|
||||||
|
{% endblock %}
|
||||||
16
docs/_templates/sidebar/brand.html
vendored
Normal file
16
docs/_templates/sidebar/brand.html
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<div class="sidebar-brand centered">
|
||||||
|
{% block brand_content %}
|
||||||
|
<div class="sidebar-logo-container">
|
||||||
|
<a href="https://datasette.io/"><img class="sidebar-logo" src="{{ logo_url }}" alt="Datasette"></a>
|
||||||
|
</div>
|
||||||
|
{%- set nav_version = version %}
|
||||||
|
{% if READTHEDOCS and current_version %}
|
||||||
|
{%- set nav_version = current_version %}
|
||||||
|
{% endif %}
|
||||||
|
{% if nav_version %}
|
||||||
|
<div class="version">
|
||||||
|
{{ nav_version }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock brand_content %}
|
||||||
|
</div>
|
||||||
11
docs/_templates/sidebar/navigation.html
vendored
Normal file
11
docs/_templates/sidebar/navigation.html
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="sidebar-tree">
|
||||||
|
<ul>
|
||||||
|
<li class="toctree-l1"><a class="reference internal" href="{{ pathto(master_doc) }}">Contents</a></li>
|
||||||
|
</ul>
|
||||||
|
{{ toctree(
|
||||||
|
collapse=True,
|
||||||
|
titles_only=False,
|
||||||
|
maxdepth=3,
|
||||||
|
includehidden=True,
|
||||||
|
) }}
|
||||||
|
</div>
|
||||||
24
docs/conf.py
24
docs/conf.py
|
|
@ -90,18 +90,15 @@ todo_include_todos = False
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
html_theme = "sphinx_rtd_theme"
|
html_theme = "furo"
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
# 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
|
# further. For a list of options available for each theme, see the
|
||||||
# documentation.
|
# documentation.
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
"logo_only": True,
|
"sidebar_hide_name": True,
|
||||||
"style_nav_header_background": "white",
|
|
||||||
"prev_next_buttons_location": "both",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
|
@ -112,20 +109,9 @@ html_logo = "datasette-logo.svg"
|
||||||
html_css_files = [
|
html_css_files = [
|
||||||
"css/custom.css",
|
"css/custom.css",
|
||||||
]
|
]
|
||||||
|
html_js_files = [
|
||||||
|
"js/custom.js"
|
||||||
# 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",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTMLHelp output ------------------------------------------
|
# -- Options for HTMLHelp output ------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ If you want to start making contributions to the Datasette project by installing
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
:local:
|
:local:
|
||||||
|
:class: this-will-duplicate-information-and-it-is-still-useful-here
|
||||||
|
|
||||||
.. _installation_basic:
|
.. _installation_basic:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ For example, you can implement the ``render_cell`` plugin hook like this even th
|
||||||
|
|
||||||
.. contents:: List of plugin hooks
|
.. contents:: List of plugin hooks
|
||||||
:local:
|
:local:
|
||||||
|
:class: this-will-duplicate-information-and-it-is-still-useful-here
|
||||||
|
|
||||||
.. _plugin_hook_prepare_connection:
|
.. _plugin_hook_prepare_connection:
|
||||||
|
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -65,7 +65,7 @@ setup(
|
||||||
setup_requires=["pytest-runner"],
|
setup_requires=["pytest-runner"],
|
||||||
extras_require={
|
extras_require={
|
||||||
"docs": [
|
"docs": [
|
||||||
"sphinx_rtd_theme",
|
"furo==2022.4.7",
|
||||||
"sphinx-autobuild",
|
"sphinx-autobuild",
|
||||||
"codespell",
|
"codespell",
|
||||||
"blacken-docs",
|
"blacken-docs",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue