Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
c375fb1
Switch to modern responsive 3-column layout theme `sphinx-basic-ng`
amotl Jul 22, 2023
eade6b0
NG: Migrate header, and make it `sticky`
amotl Jul 22, 2023
9d7625b
NG: Migrate footer
amotl Jul 22, 2023
dc51c24
NG: Migrate content
amotl Jul 22, 2023
08891ed
NG: Use vanilla templates from sphinx-basic-ng
amotl Jul 22, 2023
1233714
Chore: Trim page titles
amotl Jul 22, 2023
12ca8c8
NG: Add Furo styles and scripts
amotl Jul 22, 2023
2060dd7
NG: Enable Furo styles and scripts
amotl Jul 22, 2023
e2fde67
NG: Enable primary sidebar
amotl Jul 22, 2023
40dc4a5
NG: Enable secondary sidebar, displaying the page toc
amotl Jul 23, 2023
e8bf563
NG: Fix sidebar stickyness
amotl Jul 23, 2023
8178dfc
NG: Prevent page tools and version chooser push down other content
amotl Jul 23, 2023
6b48db1
NG: Refactor styles
amotl Jul 23, 2023
7ecf337
NG: Fix header and sidebar stickyness
amotl Jul 23, 2023
a109b6a
NG: Refactor and document styles
amotl Jul 23, 2023
7db7ed6
NG: Translate styles to SCSS
amotl Jul 27, 2023
989e536
NG: Migrate element examples
msbt Jun 3, 2024
d7ef44c
NG: More canonical changes
msbt Jun 3, 2024
420918d
NG: Fix jumping border on "page-tools" elements
msbt Jun 3, 2024
1395d80
NG: Update footer and other URLs
msbt Jun 3, 2024
8a15e8f
NG: Fix toctree in index.rst, coming from previous merge faults
amotl Jul 1, 2024
f13a59e
NG: Fix compatibility with setuptools 70 re. PEP 420 (namespace packa…
msbt Jun 3, 2024
55fcdc8
NG: Use legacy navigation until the new linktree element will be ready
amotl Jul 1, 2024
de6db03
NG: Enable Furo styles and scripts
amotl Jul 22, 2023
f7d67b0
NG: Refactor styles
amotl Jul 23, 2023
16a966b
NG: use latest furo
msbt Jul 8, 2024
a2b3c2c
NG: add related pages
msbt Jul 8, 2024
67caa2a
NG: fix fontawesome icon position and hide feedback title on closed i…
msbt Jul 8, 2024
da6fb5d
NG: hide main navigation on non-deesktop devices
msbt Jul 8, 2024
daf4059
NG: make containers fluid for better experience
msbt Jul 8, 2024
18ab0f0
NG: group components together so they hide when toggled
msbt Jul 8, 2024
6a9756e
NG: style and search updates
msbt Jul 8, 2024
9f0d415
NG: remove border-radius from sd-card-header and algolia search
msbt Jul 8, 2024
4c134ec
NG: hide feedback title on mobile
msbt Jul 8, 2024
53f6c3d
NG: mobile font size
msbt Jul 8, 2024
b70d8dc
NG: moved related pages to the correct file (`footer-article.html`)
msbt Jul 8, 2024
868f19a
NG: fix vertical alignment of fontawesome once and for all
msbt Jul 8, 2024
d909722
NG: fix instantsearch for `search.html`
msbt Jul 8, 2024
0760941
NG: add container block to `page.html`
msbt Jul 8, 2024
f9ee712
NG: fix fluid layout
msbt Jul 9, 2024
812d799
NG: empty `footer_content` & update `header` block, rearrange header…
msbt Jul 9, 2024
feebef6
NG: css-cleanup
msbt Jul 9, 2024
d526360
NG: Use vendorized `footer.sass` from Furo
amotl Jul 8, 2024
aa02368
NG: Update Furo styles and scripts to version 2024.05.06
amotl Jul 8, 2024
bb926fe
NG: disable `debug.css` stylesheet
msbt Jul 9, 2024
ef85600
NG: move parts of footer around to make it full width
msbt Jul 9, 2024
1dc405e
NG: finetune related links in article footer
msbt Jul 9, 2024
797c337
NG: remove larger blockquote font-size
msbt Jul 9, 2024
1d54085
NG: refactor css and add more footer margin
msbt Jul 9, 2024
5557176
NG: add noindex to `search.html`
msbt Jul 9, 2024
3f406f2
NG: more css cleanup
msbt Jul 9, 2024
9a22d9a
NG: mistakes were made, reverting
msbt Jul 9, 2024
68853ec
NG: update search page title
msbt Jul 15, 2024
ac3e214
NG: another fluid layout fix
msbt Jul 15, 2024
152734a
NG: change tags from aside/nav to div to avoid duplicate child-elemen…
msbt Jul 15, 2024
379b843
NG: use padding instead of margin to have a bit more space when scrol…
msbt Jul 15, 2024
ad0357e
NG: add colors, fix mediaquery-size, finetuning spacing
msbt Jul 15, 2024
8281bd7
NG: override ToC error message
msbt Jul 15, 2024
03c2111
NG: no more fluid for content
msbt Jul 15, 2024
9b550d9
NG: header finetuning
msbt Jul 15, 2024
a6e866b
NG: nav style improvements
msbt Jul 15, 2024
cbd69b3
NG: add hubspot tracking
msbt Jul 18, 2024
390fddb
NG: fix search path
msbt Jul 18, 2024
c055a05
NG: remove main nav and excess js
msbt Jul 18, 2024
d1b5402
NG: reposition search and page-tools
msbt Jul 18, 2024
e674aee
NG: scrollbar fix
msbt Jul 18, 2024
d809ec1
NG: bring headerlink logic back
msbt Jul 18, 2024
c41c1f7
NG: use `components.css` as override for `stylesheet` variable in `th…
msbt Jul 18, 2024
5c742e9
NG: readd GTM
msbt Jul 18, 2024
35e7965
NG: fix footer width
msbt Jul 18, 2024
4dd61ae
remove margin from paragraphs in ul/ol lists
msbt Jul 19, 2024
dc331f5
adjust headline spacing and remove h5 duplicate
msbt Jul 19, 2024
e55089e
adjust admonitions
msbt Jul 19, 2024
41f3b8c
readjust ul/ol spacing
msbt Jul 22, 2024
c0c9e7d
fix headline margins
msbt Jul 22, 2024
1bebd4f
style field-lists that got lost due to `basic.css` removal
msbt Jul 22, 2024
590baf9
adjust `line-height` in toctree
msbt Jul 24, 2024
e1a8446
remove unneeded js/css styling for mobile nav and abandoned elements
msbt Jul 24, 2024
df63854
harmonize ul li margin/padding with code from furos `_lists.sass`
msbt Jul 24, 2024
0343a0f
make header and promobar non-sticky
msbt Jul 24, 2024
1bb2f8e
Link Checker: Ignore unsplash.com. It has been blocked by GitHub.
amotl Aug 2, 2024
b159169
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 @@ -202,6 +202,8 @@ Unreleased
- Remove external links indicator
- Improve visual appearance of admonition components
- Add new ``cloud-docs`` documentation project
- Switch to modern responsive 3-column layout theme ``sphinx-basic-ng``.
Thanks, @pradyunsg.


2023/05/15 0.27.1
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