Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
14c9724
Switch to modern responsive 3-column layout theme `sphinx-basic-ng`
amotl Jul 22, 2023
2d9e094
NG: Migrate header, and make it `sticky`
amotl Jul 22, 2023
8b6301b
NG: Migrate footer
amotl Jul 22, 2023
1438c5f
NG: Migrate content
amotl Jul 22, 2023
9b8b3ae
NG: Use vanilla templates from sphinx-basic-ng
amotl Jul 22, 2023
fbd9846
Chore: Trim page titles
amotl Jul 22, 2023
c686684
NG: Add Furo styles and scripts
amotl Jul 22, 2023
3c833af
NG: Enable Furo styles and scripts
amotl Jul 22, 2023
d914f75
NG: Enable primary sidebar
amotl Jul 22, 2023
31dc770
NG: Enable secondary sidebar, displaying the page toc
amotl Jul 23, 2023
4e07cb9
NG: Fix sidebar stickyness
amotl Jul 23, 2023
d571eec
NG: Prevent page tools and version chooser push down other content
amotl Jul 23, 2023
75a0cb8
NG: Refactor styles
amotl Jul 23, 2023
157990f
NG: Fix header and sidebar stickyness
amotl Jul 23, 2023
a11432c
NG: Refactor and document styles
amotl Jul 23, 2023
a1039a7
NG: Translate styles to SCSS
amotl Jul 27, 2023
50e6799
NG: Migrate element examples
msbt Jun 3, 2024
b5dde82
NG: More canonical changes
msbt Jun 3, 2024
1a0d7f8
NG: Fix jumping border on "page-tools" elements
msbt Jun 3, 2024
073d407
NG: Update footer and other URLs
msbt Jun 3, 2024
ddb32c1
NG: Fix toctree in index.rst, coming from previous merge faults
amotl Jul 1, 2024
6b1245e
NG: Fix compatibility with setuptools 70 re. PEP 420 (namespace packa…
msbt Jun 3, 2024
7dcc8c2
NG: Use legacy navigation until the new linktree element will be ready
amotl Jul 1, 2024
8d5c5f3
NG: Enable Furo styles and scripts
amotl Jul 22, 2023
989a4ff
NG: Refactor styles
amotl Jul 23, 2023
2f0e9cf
NG: use latest furo
msbt Jul 8, 2024
8932c48
NG: add related pages
msbt Jul 8, 2024
726b6d8
NG: fix fontawesome icon position and hide feedback title on closed i…
msbt Jul 8, 2024
9e09f61
NG: hide main navigation on non-deesktop devices
msbt Jul 8, 2024
dd21dc4
NG: make containers fluid for better experience
msbt Jul 8, 2024
867fe43
NG: group components together so they hide when toggled
msbt Jul 8, 2024
7e4b640
NG: style and search updates
msbt Jul 8, 2024
a26396c
NG: remove border-radius from sd-card-header and algolia search
msbt Jul 8, 2024
a5c7c7a
NG: hide feedback title on mobile
msbt Jul 8, 2024
bac4cf0
NG: mobile font size
msbt Jul 8, 2024
c2a3597
NG: moved related pages to the correct file (`footer-article.html`)
msbt Jul 8, 2024
92b06d6
NG: fix vertical alignment of fontawesome once and for all
msbt Jul 8, 2024
6d5c250
NG: fix instantsearch for `search.html`
msbt Jul 8, 2024
959a980
NG: add container block to `page.html`
msbt Jul 8, 2024
556b4d2
NG: fix fluid layout
msbt Jul 9, 2024
b4ebca0
NG: empty `footer_content` & update `header` block, rearrange header…
msbt Jul 9, 2024
7312a84
NG: css-cleanup
msbt Jul 9, 2024
7fab4af
NG: Use vendorized `footer.sass` from Furo
amotl Jul 8, 2024
3a6aeba
NG: Update Furo styles and scripts to version 2024.05.06
amotl Jul 8, 2024
ef2f76e
NG: disable `debug.css` stylesheet
msbt Jul 9, 2024
82667be
NG: move parts of footer around to make it full width
msbt Jul 9, 2024
37932b5
NG: finetune related links in article footer
msbt Jul 9, 2024
1ad5ade
NG: remove larger blockquote font-size
msbt Jul 9, 2024
5ed4325
NG: refactor css and add more footer margin
msbt Jul 9, 2024
ff7fb52
NG: add noindex to `search.html`
msbt Jul 9, 2024
c7618ac
NG: more css cleanup
msbt Jul 9, 2024
c9aa4f0
NG: mistakes were made, reverting
msbt Jul 9, 2024
819b780
NG: update search page title
msbt Jul 15, 2024
cf096be
NG: another fluid layout fix
msbt Jul 15, 2024
f7811b7
NG: change tags from aside/nav to div to avoid duplicate child-elemen…
msbt Jul 15, 2024
02188ee
NG: use padding instead of margin to have a bit more space when scrol…
msbt Jul 15, 2024
0ecc5a0
NG: add colors, fix mediaquery-size, finetuning spacing
msbt Jul 15, 2024
9a0b45b
NG: override ToC error message
msbt Jul 15, 2024
8e341a7
NG: no more fluid for content
msbt Jul 15, 2024
6140c9f
NG: header finetuning
msbt Jul 15, 2024
1dcd8a6
NG: nav style improvements
msbt Jul 15, 2024
c04ba32
NG: add hubspot tracking
msbt Jul 18, 2024
b26b929
NG: fix search path
msbt Jul 18, 2024
e5998ac
NG: remove main nav and excess js
msbt Jul 18, 2024
a878e0d
NG: reposition search and page-tools
msbt Jul 18, 2024
fff18bd
NG: scrollbar fix
msbt Jul 18, 2024
8ee47ed
NG: bring headerlink logic back
msbt Jul 18, 2024
a30f16c
NG: use `components.css` as override for `stylesheet` variable in `th…
msbt Jul 18, 2024
6a77e90
NG: readd GTM
msbt Jul 18, 2024
6fd6995
NG: fix footer width
msbt Jul 18, 2024
d630170
Chore: Update changelog
amotl Jul 18, 2024
c42542f
NG: Remove margin from paragraphs in ul/ol lists
msbt Jul 19, 2024
c5e85b7
NG: Adjust headline spacing and remove h5 duplicate
msbt Jul 19, 2024
fe4b017
NG: Adjust admonitions
msbt Jul 19, 2024
f51fb59
NG: Readjust ul/ol spacing
msbt Jul 22, 2024
4e92c41
NG: Fix headline margins
msbt Jul 22, 2024
3910f24
NG: Style field-lists that got lost due to `basic.css` removal
msbt Jul 22, 2024
8e4d3fc
NG: Adjust `line-height` in toctree
msbt Jul 24, 2024
f317b9b
NG: Remove unneeded js/css styling for mobile nav and abandoned elements
msbt Jul 24, 2024
6c36d55
NG: Harmonize ul li margin/padding with code from furos `_lists.sass`
msbt Jul 24, 2024
252202a
NG: Make header and promobar non-sticky
msbt Jul 24, 2024
0e0b12b
NG: Add styles for tables
msbt Aug 5, 2024
1eb09b2
NG: Add styles for tables and finetune ul/ol/p margins
msbt Aug 5, 2024
ebd2865
Link Checker: Ignore unsplash.com. It has been blocked by GitHub.
amotl Aug 2, 2024
658ce5a
Primary Navigation: Increase toctree.maxdepth to 4 for Cloud and Guides
amotl Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ CHANGES

Unreleased
----------
- Switch to modern responsive 3-column layout theme ``sphinx-basic-ng``.
Thanks, @pradyunsg.

2024/07/25 0.33.2
-----------------
Expand Down
2 changes: 1 addition & 1 deletion docs/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schemaVersion": 1,
"label": "docs build",
"message": "2.1.1"
"message": "2.1.2"
}
Empty file modified docs/codesnippets.rst
100644 → 100755
Empty file.
Empty file modified docs/diagrams.rst
100644 → 100755
Empty file.
Empty file modified docs/headings.rst
100644 → 100755
Empty file.
Empty file modified docs/images.rst
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions docs/index.rst
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ The legacy feature gallery exclusively uses reStructuredText.
.. toctree::
:maxdepth: 1

headings
admonitions
lists
tables
images
diagrams
codesnippets
typography
subpage
diagrams
glossary
headings
images
lists
projects
subpage
tables
typography



Expand Down
Empty file modified docs/lists.rst
100644 → 100755
Empty file.
Empty file modified docs/subpage.rst
100644 → 100755
Empty file.
Empty file modified docs/tables.rst
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"jquery": "^3.7.1",
"js-cookie": "^3.0.5",
"normalize.css": "^8.0.1",
"postcss-loader": "^7.3",
"sass": "^1.60.0",
"sass-loader": "^13.2",
"sticky-sidebar": "^3.3.1",
"style-loader": "^4.0",
"webpack": "^5.92",
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@
keywords="crate docs sphinx readthedocs",
license="Apache License 2.0",
packages=find_namespace_packages(where="src"),
namespace_packages=["crate"],
package_dir={"": "src"},
include_package_data=True,
zip_safe=False,
install_requires=[
"Jinja2>=3,<3.2",
"docutils==0.16",
"docutils",
"docutils-stubs==0.0.22",
"furo==2024.05.06",
"jinja2>=3,<4",
"myst-parser[linkify]<4",
"sphinx>=4.6,<7",
"sphinx-basic-ng==1.0.0b2",
"sphinx-copybutton>=0.3.1,<1",
"sphinx-design-elements==0.4.0",
"sphinx-inline-tabs",
Expand Down
3 changes: 3 additions & 0 deletions src/crate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pkg_resources import declare_namespace

declare_namespace("crate")
19 changes: 18 additions & 1 deletion src/crate/theme/rtd/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# software solely pursuant to the terms of the relevant commercial agreement.

from crate.theme import rtd as theme
from crate.theme.rtd import __version__
from crate.theme.rtd.conf.furo import _html_page_context
from os import environ

source_suffix = ".rst"
Expand Down Expand Up @@ -161,9 +163,12 @@

# Configure linkchecker
linkcheck_ignore = [
# Well.
"https://example.org/.*",
# Breaks accessibility via JS ¯\_(ツ)_/¯
"https://www.iso.org/obp/ui/.*",
"https://example.org/.*",
# 403 Client Error: Forbidden for url
"https://unsplash.com/.*",
]
linkcheck_retries = 3
linkcheck_timeout = 15
Expand Down Expand Up @@ -281,7 +286,19 @@ def apply_html_context_custom(app_inited):
except Exception as ex:
print(f"ERROR: Unable to adjust `html_context`. Reason: {ex}")

# Modern / NG / Furo.
app.require_sphinx("3.0")
app.connect("html-page-context", _html_page_context)

# Customizations.
app.connect("builder-inited", configure_self_hosted_on_path)
app.connect("builder-inited", set_proxied_api_host)
app.connect("builder-inited", set_proxied_static_path)
app.connect("builder-inited", apply_html_context_custom)

return {
"parallel_read_safe": True,
"parallel_write_safe": True,
"version": __version__,
}

54 changes: 54 additions & 0 deletions src/crate/theme/rtd/conf/furo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
Vendored version of Furo's navigation tree component.

https://github.com/pradyunsg/furo/blob/main/src/furo/navigation.py
"""
import sphinx
import typing as t

from furo import get_navigation_tree

from crate.theme.rtd import __version__
from sphinx.builders.html import StandaloneHTMLBuilder


def furo_compute_navigation_tree(context: t.Dict[str, t.Any]) -> str:
"""
The navigation tree, generated from the sphinx-provided ToC tree.
"""
if "toctree" in context:
toctree = context["toctree"]
toctree_html = toctree(
collapse=False,
titles_only=True,
maxdepth=-1,
includehidden=True,
)
else:
toctree_html = ""

return get_navigation_tree(toctree_html)


def _html_page_context(
app: sphinx.application.Sphinx,
pagename: str,
templatename: str,
context: t.Dict[str, t.Any],
doctree: t.Any,
) -> None:
"""
HTML page context provider.
"""
if not isinstance(app.builder, StandaloneHTMLBuilder):
raise Exception(
"Theme is being used with a non-HTML builder. "
"If you're seeing this error, it is a symptom of a mistake in your "
"configuration."
)

# Basic constants
context["theme_version"] = __version__

# Values computed from page-level context.
context["ng_navigation_tree"] = furo_compute_navigation_tree(context)
12 changes: 0 additions & 12 deletions src/crate/theme/rtd/crate/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,5 @@ <h3>{{ _('Navigation') }}</h3>
</div>
{%- endblock %}

{%- if project != 'SQL 99' %}
<!-- Algolia DocSearch -->
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script type="text/javascript">
docsearch({
container: '#docsearch',
appId: 'AZ1NEV7CG0',
apiKey: '84b128d95218b1eddb2d4b82d25291fe',
indexName: 'cratedb',
});
</script>
{%- endif %}
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!-- GitHub feedback component: Links to report issue, and source/edit links -->

{%
set source_path = conf_py_path + pagename + suffix
%}

{% import "settings.html" as settings with context %}

{% set suffix = settings.suffix %}
{% set source_path = conf_py_path + pagename + suffix %}

<div class="feedback-compact-container">
<details class="sd-sphinx-override sd-dropdown sd-card sd-mb-0 sd-fade-in feedback-compact-content"> <!-- open="" -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* Keyboard navigation for GitHub. CTRL+G will navigate to
* the edit page on GitHub for the corresponding document.
**/

{% import "settings.html" as settings with context %}

{% set suffix = settings.suffix %}

document.addEventListener('keydown', (event) => {
if (event.key === 'g' && event.ctrlKey) {
{% if check_meta and 'github_url' in meta %}
Expand Down
28 changes: 28 additions & 0 deletions src/crate/theme/rtd/crate/components/related-pages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="related-pages">
{% if next -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
</div>
<div class="title">{{ next.title }}</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
</a>
{%- endif %}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<label for="sb-sidebar-toggle--primary" class="hide-when-primary-sidebar-shown" role="button">
{% block content %}
<i class="icon" title="Toggle site navigation sidebar"><svg><use href="#svg-menu"></use></svg></i>
{% endblock content %}
</label>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<label for="sb-sidebar-toggle--secondary" class="hide-when-secondary-sidebar-shown" role="button">
{% block content %}
<i class="icon" title="Toggle table of contents sidebar"><svg><use href="#svg-toc"></use></svg></i>
{% endblock content %}
</label>
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
{% block sidebarsourcelink %}{% endblock %}

{%- block content %}
{% include "navbar.html" %}
{# include "navbar.html" #}

<div class="w-canvas">
{% if project == 'SQL 99' %}
Expand Down Expand Up @@ -126,11 +126,6 @@
</div>
</div>
</div>
{% if project == 'SQL 99' %}
{%- include "footer_sql99.html" %}
{% else %}
{%- include "footer.html" %}
{% endif %}

{%- endblock %}

Expand Down
117 changes: 0 additions & 117 deletions src/crate/theme/rtd/crate/navbar.html

This file was deleted.

Loading