Compare commits

...

4 Commits

Author SHA1 Message Date
Victor Feyens
b0f322ffd6 [FIX] core: import jquery 2024-08-02 16:27:16 +02:00
Victor Feyens
00d78c39e4 [IMP] core: lazy load images (poc) 2024-08-02 15:39:18 +02:00
Victor Feyens
74c00734f0 fixup! [wip] 2024-08-02 15:34:59 +02:00
Xavier-Do
1a4e3d6163 [wip] 2024-07-31 16:42:31 +02:00
6 changed files with 29 additions and 26 deletions

View File

@@ -41,9 +41,8 @@ current_major_version = current_major_branch.replace('.0', '')
# The minimal Sphinx version required to build the documentation.
needs_sphinx = '3.0.0'
# The default language in which the documentation is written. It is set to `None` because Sphinx
# considers that no language means 'en'.
language = None
# The default language in which the documentation is written.
language = 'en'
# The suffix of source filenames.
source_suffix = '.rst'
@@ -65,6 +64,8 @@ exclude_patterns = [
# See https://docutils.sourceforge.io/docs/ref/rst/roles.html#standard-roles for other roles.
default_role = 'literal'
# Global config to lazy load images by default
image_loading = 'lazy'
# Whether scaled down images should be be wrapped in a `<a/>` tag linking to the image file or not.
html_scaled_image_link = False
@@ -498,7 +499,7 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree):
_root = app.config.project_root
else:
# Project root like .../documentation/_build/html/14.0/fr
_root = re.sub(rf'(/{app.config.version})?(/{app.config.language})?$', '', app.outdir)
_root = re.sub(rf'(/{app.config.version})?(/{app.config.language})?$', '', str(app.outdir))
# If the canonical version is not set, assume that the project has a single version
_canonical_version = app.config.canonical_version or app.config.version
_version = _version or app.config.version

View File

@@ -598,8 +598,6 @@ which tends to be a huge amount.
asList(ids)
)
))[0];
// count the number of fields fetched by default
record.size();
.. code-tab:: go

View File

@@ -100,6 +100,7 @@ def resolve(old_resolve, tree, docname, *args, **kwargs):
for _subnode in _reference_node.parent.parent.children
): # The node references a toc
if 'show-content' not in tree.env.metadata[_node_docname]:
import pudb; pudb.set_trace();
_reference_node['refuri'] = '#' # The page must not be accessible
def _set_docname_as_class(_reference_node, _node_docname):

View File

@@ -28,6 +28,8 @@
<script src="{{ pathto(link, 1) }}"></script>
{%- endfor %}
{%- endif %}
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js"
crossorigin="anonymous"></script>
{{ super() }} {# Load the scripts specified in the extensions/themes #}
{%- if plausible_script -%}
<script defer="defer" src="{{ plausible_script }}" data-domain="{{ plausible_domain }}"></script>

View File

@@ -2,7 +2,6 @@ from docutils import nodes
from sphinx.locale import admonitionlabels
from sphinx.writers.html5 import HTML5Translator
# Translators inheritance chain:
# Docutils Base HTML translator: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/_html_base.py
# └── Docutils Polyglot html5 translator: https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/html5_polyglot/__init__.py
@@ -51,8 +50,8 @@ class BootstrapTranslator(HTML5Translator):
# Meta
self.meta = ['', ''] # HTMLWriter strips out the first two items from Translator.meta
self.add_meta('<meta http-equiv="X-UA-Compatible" content="IE=edge">')
self.add_meta('<meta name="viewport" content="width=device-width, initial-scale=1">')
self.meta.append('<meta http-equiv="X-UA-Compatible" content="IE=edge">')
self.meta.append('<meta name="viewport" content="width=device-width, initial-scale=1">')
# Body
self.body = []
@@ -109,7 +108,6 @@ class BootstrapTranslator(HTML5Translator):
# admonition [name] -> alert-[name]
# Enforce presence of [name]-title as class on the <p> containing the title
def visit_admonition(self, node, name=''):
# type: (nodes.Node, unicode) -> None
node_classes = ["alert"]
if name:
node_classes.append(ADMONITION_MAPPING[name])
@@ -121,7 +119,6 @@ class BootstrapTranslator(HTML5Translator):
# overwritten
# Appends alert-title class to <p> if parent is an Admonition.
def visit_title(self, node):
# type: (nodes.Node) -> None
if isinstance(node.parent, nodes.Admonition):
self.body.append(self.starttag(node, 'p', CLASS='alert-title'))
else:
@@ -147,18 +144,18 @@ class BootstrapTranslator(HTML5Translator):
# overwritten
# Ensure table class is present for tables
def visit_table(self, node):
# type: (nodes.Node) -> None
self.generate_targets_for_table(node)
# c/p of https://github.com/pydata/pydata-sphinx-theme/pull/509/files
self._table_row_indices.append(0)
classes = [cls.strip(' \t\n')
for cls in self.settings.table_style.split(',')]
atts = {}
classes = [cls.strip(' \t\n') for cls in self.settings.table_style.split(',')]
classes.insert(0, "docutils") # compat
classes.insert(0, "table") # compat
if 'align' in node:
classes.append('align-%s' % node['align'])
tag = self.starttag(node, 'table', CLASS=' '.join(classes))
# set align-default if align not specified to give a default style
classes.append('align-%s' % node.get('align', 'default'))
if 'width' in node:
atts['style'] = 'width: %s' % node['width']
tag = self.starttag(node, 'table', CLASS=' '.join(classes), **atts)
self.body.append(tag)

View File

@@ -1,11 +1,15 @@
docutils==0.17.0
libsass==0.20.1
pygments~=2.6.1
docutils==0.20.1 # docutils<0.21,>=0.18.1
sphinx==7.2.6
pygments==2.17.2 # Pygments>=2.14
pygments-csv-lexer~=0.1
sphinx==4.3.2
sphinx==4.3.2 ; python_version < '3.12'
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-htmlhelp==2.0.1 # sphinxcontrib-htmlhelp>=2.0.0
sphinxcontrib-serializinghtml==1.1.10 # sphinxcontrib-serializinghtml>=1.1.9
sphinxcontrib-qthelp==1.0.3
sphinx-tabs==3.4.5 # Compatibility with docutils==0.17.0
sphinx-tabs==3.4.5
# C/p from odoo requirements
libsass==0.20.1 ; python_version < '3.11'
libsass==0.22.0 ; python_version >= '3.11' # (Noble) Mostly to have a wheel package