diff -Nru zzzeeksphinx-1.3.5/debian/changelog zzzeeksphinx-1.4.0/debian/changelog --- zzzeeksphinx-1.3.5/debian/changelog 2022-12-22 17:16:48.000000000 +0000 +++ zzzeeksphinx-1.4.0/debian/changelog 2023-06-22 12:39:15.000000000 +0000 @@ -1,3 +1,13 @@ +zzzeeksphinx (1.4.0-1) unstable; urgency=medium + + [ Debian Janitor ] + * Update standards version to 4.6.1, no changes needed. + + [ Piotr Ożarowski ] + * New upstream release + + -- Piotr Ożarowski Thu, 22 Jun 2023 14:39:15 +0200 + zzzeeksphinx (1.3.5-2) unstable; urgency=medium * Add patch from upstream git repo to fix for Sphinx ≥ 5.1 diff -Nru zzzeeksphinx-1.3.5/debian/control zzzeeksphinx-1.4.0/debian/control --- zzzeeksphinx-1.3.5/debian/control 2022-09-15 20:18:52.000000000 +0000 +++ zzzeeksphinx-1.4.0/debian/control 2022-12-22 19:20:49.000000000 +0000 @@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 13), dh-python, python3-all, python3-setuptools -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Homepage: https://github.com/sqlalchemyorg/zzzeeksphinx Vcs-Git: https://salsa.debian.org/python-team/packages/zzzeeksphinx.git Vcs-Browser: https://salsa.debian.org/python-team/packages/zzzeeksphinx diff -Nru zzzeeksphinx-1.3.5/debian/patches/0001-fix-parent_section_ref-for-Sphinx-5.1.patch zzzeeksphinx-1.4.0/debian/patches/0001-fix-parent_section_ref-for-Sphinx-5.1.patch --- zzzeeksphinx-1.3.5/debian/patches/0001-fix-parent_section_ref-for-Sphinx-5.1.patch 2022-12-22 17:16:34.000000000 +0000 +++ zzzeeksphinx-1.4.0/debian/patches/0001-fix-parent_section_ref-for-Sphinx-5.1.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -From: =?utf-8?q?Piotr_O=C5=BCarowski?= -Date: Thu, 22 Dec 2022 18:15:45 +0100 -Subject: =?utf-8?q?fix_parent=5Fsection=5Fref_for_Sphinx_=E2=89=A5_5=2E1?= - ---- - zzzeeksphinx/dialect_info.py | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/zzzeeksphinx/dialect_info.py b/zzzeeksphinx/dialect_info.py -index 8a9520a..769d8a7 100644 ---- a/zzzeeksphinx/dialect_info.py -+++ b/zzzeeksphinx/dialect_info.py -@@ -47,7 +47,18 @@ class DialectDirective(SphinxDirective): - - content = self._parse_content() - -- parent_section_ref = self.state.parent.children[0]["ids"][0] -+ # in sphinx 5.1.1 and earlier, we did this: -+ # old_parent_section_ref = self.state.parent.children[0]["ids"][0] -+ -+ # however in 5.3.0, parent is an empty section. not clear if this is -+ # due to content changes or changes in how automodule works, etc. -+ # so now we manufacture it as follows: -+ parent_section_ref = ( -+ f"module-sqlalchemy.dialects.{dialect_name}.{dbapi_name}" -+ ) -+ # if automodule's naming scheme changes etc., this would silently -+ # break -+ - self._append_dbapi_bullet( - dialect_name, dbapi_name, content["name"], parent_section_ref - ) diff -Nru zzzeeksphinx-1.3.5/debian/patches/series zzzeeksphinx-1.4.0/debian/patches/series --- zzzeeksphinx-1.3.5/debian/patches/series 2022-12-22 17:16:34.000000000 +0000 +++ zzzeeksphinx-1.4.0/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0001-fix-parent_section_ref-for-Sphinx-5.1.patch diff -Nru zzzeeksphinx-1.3.5/PKG-INFO zzzeeksphinx-1.4.0/PKG-INFO --- zzzeeksphinx-1.3.5/PKG-INFO 2022-06-22 17:01:56.102243400 +0000 +++ zzzeeksphinx-1.4.0/PKG-INFO 2023-04-25 23:30:03.421863600 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: zzzeeksphinx -Version: 1.3.5 +Version: 1.4.0 Summary: Zzzeek's Sphinx Layout and Utilities. Home-page: https://github.com/sqlalchemyorg/zzzeeksphinx Author: Mike Bayer diff -Nru zzzeeksphinx-1.3.5/setup.py zzzeeksphinx-1.4.0/setup.py --- zzzeeksphinx-1.3.5/setup.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/setup.py 2023-04-25 23:29:57.000000000 +0000 @@ -35,7 +35,13 @@ url="https://github.com/sqlalchemyorg/zzzeeksphinx", license="MIT", packages=["zzzeeksphinx"], - install_requires=["libsass", "mako", "requests", "sphinx>=4.5.0,<5.1"], + install_requires=[ + "libsass", + "mako", + "requests", + "sphinx>=5.3.0,<6.3", + "sphinxcontrib-jquery", + ], include_package_data=True, zip_safe=False, entry_points={ diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/autodoc_mods.py zzzeeksphinx-1.4.0/zzzeeksphinx/autodoc_mods.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/autodoc_mods.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/autodoc_mods.py 2023-04-25 23:29:57.000000000 +0000 @@ -9,6 +9,15 @@ def autodoc_skip_member(app, what, name, obj, skip, options): + # sphinx is putting blank __init__ methods, not sure why. + # even if I turn off all the extensions here + if ( + what == "class" + and name == "__init__" + and (not inspect.isfunction(obj) or not obj.__doc__) + ): + return True + if ( what == "class" and skip @@ -211,7 +220,7 @@ nodes.Text(param_str, param_str), ) - row.append(nodes.entry("", p, classes=["nowrap"])) + row.append(nodes.entry("", p, classes=["autosummary-name"])) try: para = ad_node[1][0] if isinstance(para, nodes.paragraph): @@ -221,7 +230,70 @@ except IndexError: text = nodes.Text("", "") - row.append(nodes.entry("", text)) + if ad_node.attributes.get("objtype") == "class": + member_nodes = [] + + for attr_desc in ad_node.traverse(addnodes.desc): + objtype = attr_desc.attributes.get("objtype") + if objtype not in ("classmethod", "method", "attribute"): + continue + + attr_sig = attr_desc.children[0] + + attr_ids = attr_sig.attributes.get("ids", [None]) + if not attr_ids: + continue + + attr_ref_id = attr_ids[0] + if not attr_ref_id: + continue + + attr_name_node = list( + attr_desc.traverse(addnodes.desc_name) + )[0] + attr_name_node = attr_name_node.deepcopy() + + if objtype in ("classmethod", "method"): + attr_name_node.append(nodes.Text("()")) + + attr_ref = nodes.reference( + "", + "", + attr_name_node, + refid=attr_ref_id, + classes=["reference", "internal"], + ) + + member_nodes.append(attr_ref) + + if member_nodes: + method_list = nodes.paragraph("", "", member_nodes[0]) + + for ref in member_nodes[1:]: + method_list.append(nodes.Text(", ")) + method_list.append(ref) + + method_box = nodes.container( + "", + nodes.paragraph( + "", "", nodes.strong("", nodes.Text("Members")) + ), + method_list, + classes=["class-members"], + ) + + content = ad_node.traverse(addnodes.desc_content) + if content: + content = list(content)[0] + for i, n in enumerate(content.children): + if isinstance(n, (addnodes.index, addnodes.desc)): + content.insert(i - 1, method_box) + break + + entry = nodes.entry("", text) + + row.append(entry) + body.append(row) if where > 0: @@ -304,7 +376,7 @@ # skipping superclass classlevel docs for now, as these # get in the way of using autosummary. - if what == "class": + if what in ("class", "exception"): _track_autodoced[name] = obj # need to translate module names for bases, others @@ -360,7 +432,7 @@ if attrname in supercls.__dict__: found = True break - if found and supercls is not cls: + if found and supercls is not cls and supercls is not object: adjusted_mod = _adjust_rendered_mod_name( app.env.config, supercls.__module__, supercls.__name__ ) diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/dialect_info.py zzzeeksphinx-1.4.0/zzzeeksphinx/dialect_info.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/dialect_info.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/dialect_info.py 2023-04-25 23:29:57.000000000 +0000 @@ -47,7 +47,18 @@ content = self._parse_content() - parent_section_ref = self.state.parent.children[0]["ids"][0] + # in sphinx 5.1.1 and earlier, we did this: + # old_parent_section_ref = self.state.parent.children[0]["ids"][0] + + # however in 5.3.0, parent is an empty section. not clear if this is + # due to content changes or changes in how automodule works, etc. + # so now we manufacture it as follows: + parent_section_ref = ( + f"module-sqlalchemy.dialects.{dialect_name}.{dbapi_name}" + ) + # if automodule's naming scheme changes etc., this would silently + # break + self._append_dbapi_bullet( dialect_name, dbapi_name, content["name"], parent_section_ref ) diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/extras.py zzzeeksphinx-1.4.0/zzzeeksphinx/extras.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/extras.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/extras.py 2023-04-25 23:29:57.000000000 +0000 @@ -22,6 +22,16 @@ node_class = deepalchemy +class legacy(Admonition, Element): + pass + + +class Legacy(BaseAdmonition): + + required_arguments = 0 + node_class = legacy + + class FooterTopic(Topic): node_class = footer_topic @@ -39,11 +49,17 @@ self.visit_admonition(node, "deepalchemy") -def depart_deepalchemy(self, node): +def visit_legacy(self, node): + self.visit_admonition(node, "legacy") + + +def depart_admonition(self, node): self.depart_admonition(node) -deepalchemy_visit = (visit_deepalchemy, depart_deepalchemy) +deepalchemy_visit = (visit_deepalchemy, depart_admonition) + +legacy_visit = (visit_legacy, depart_admonition) footer_topic_visit = (visit_footer_topic, depart_footer_topic) @@ -58,29 +74,28 @@ f1.parent.remove(f1) -def setup(app): +visit_keys = [ + "html", + "html5", + "latex", + "text", + "xml", + "texinfo", + "manpage", +] - admonitionlabels["deepalchemy"] = _("Deep Alchemy") - app.add_directive("deepalchemy", DeepAlchemy) +def setup(app): app.add_directive("footer_topic", FooterTopic) - app.add_node( - deepalchemy, - **{ - key: deepalchemy_visit - for key in [ - "html", - "html5", - "latex", - "text", - "xml", - "texinfo", - "manpage", - ] - } - ) + admonitionlabels["deepalchemy"] = _("Deep Alchemy") + app.add_directive("deepalchemy", DeepAlchemy) + app.add_node(deepalchemy, **{key: deepalchemy_visit for key in visit_keys}) + + admonitionlabels["legacy"] = _("Legacy Feature") + app.add_directive("legacy", Legacy) + app.add_node(legacy, **{key: legacy_visit for key in visit_keys}) app.add_node( footer_topic, **{key: footer_topic_visit for key in ["html", "html5"]} diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/__init__.py zzzeeksphinx-1.4.0/zzzeeksphinx/__init__.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/__init__.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/__init__.py 2023-04-25 23:29:57.000000000 +0000 @@ -1,4 +1,4 @@ -__version__ = "1.3.5" +__version__ = "1.4.0" def setup(app): @@ -13,6 +13,10 @@ extras, ) + # we use jquery. See + # https://www.sphinx-doc.org/en/master/changes.html#id65 + app.setup_extension("sphinxcontrib.jquery") + autodoc_mods.setup(app) dialect_info.setup(app) mako.setup(app) diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/sqlformatter.py zzzeeksphinx-1.4.0/zzzeeksphinx/sqlformatter.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/sqlformatter.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/sqlformatter.py 2023-04-25 23:29:57.000000000 +0000 @@ -10,10 +10,13 @@ from pygments.lexer import bygroups from pygments.lexer import RegexLexer from pygments.lexer import using +from pygments.lexer import words from pygments.lexers import PythonConsoleLexer from pygments.lexers import PythonLexer from pygments.lexers import SqlLexer +from pygments.token import Keyword from pygments.token import Token +from sphinx import highlighting from sphinx.highlighting import PygmentsBridge @@ -25,6 +28,12 @@ yield t, v +class RealWorldSQLLexer(SqlLexer): + tokens = {k: l[:] for (k, l) in SqlLexer.tokens.items()} + + tokens["root"].insert(0, (words(("RETURNING",), suffix=r"\b"), Keyword)) + + class StripDocTestFilter(Filter): def filter(self, lexer, stream): for ttype, value in stream: @@ -35,6 +44,65 @@ yield ttype, value +class DetectAnnotationsFilter(Filter): + def filter(self, lexer, stream): + first, second = None, None + found_colon = False + should_report = False + annotated = None + found_sql = False + + for ttype, value in stream: + + # any encounting of SQL blocks, stop immediately. This is + # likely not a class def example and we don't want the + # "anno/non-anno" label to appear under SQL boxes at all + if ttype is Token.Name and value in ( + "execsql", + "printsql", + "opensql", + "sqlpopup", + ): + found_sql = True + should_report = False + + if found_sql: + yield ttype, value + continue + + if ttype is Token.Name.Builtin: + ttype = Token.Name + + if ttype is Token.Keyword and value == "class": + should_report = True + + first = second + second = ttype, value + + yield ttype, value + + if annotated: + continue + elif annotated is None and ttype is not Token.Text: + annotated = False + + if (first, second) == ARROW_ANNOTATION: + annotated = True + elif found_colon: + if (ttype, value) == NEWLINE: + found_colon = False + elif ttype == Token.Name: + found_colon = False + annotated = True + elif first and ((first[0:1], second) == COLON_ANNOTATION): + found_colon = True + # should_report = True + + # report only on examples that have class defs + if annotated is not None and should_report: + yield Token.Other, f"pep484 annotations detected: {annotated}" + + class PyConWithSQLLexer(RegexLexer): name = "PyCon+SQL" aliases = ["pycon+sql"] @@ -44,7 +112,9 @@ tokens = { "root": [ (r"{sql}", Token.Sql.Link, "sqlpopup"), - (r"{opensql}", Token.Sql.Open, "opensqlpopup"), + (r"{execsql}", Token.Sql.Exec, "execsql"), + (r"{opensql}", Token.Sql.Exec, "opensql"), # alias of execsql + (r"{printsql}", Token.Sql.Print, "printsql"), (r".*?\n", using(PythonConsoleLexer)), ], "sqlpopup": [ @@ -57,7 +127,9 @@ "#pop", ) ], - "opensqlpopup": [(r".*?(?:{stop}\n*|$)", Token.Sql, "#pop")], + "execsql": [(r".*?(?:{stop}\n*|$)", Token.Sql.ExecState, "#pop")], + "opensql": [(r".*?(?:{stop}\n*|$)", Token.Sql.ExecState, "#pop")], + "printsql": [(r".*?(?:{stop}\n*|$)", Token.Sql.PrintState, "#pop")], } @@ -70,7 +142,9 @@ tokens = { "root": [ (r"{sql}", Token.Sql.Link, "sqlpopup"), - (r"{opensql}", Token.Sql.Open, "opensqlpopup"), + (r"{execsql}", Token.Sql.Exec, "execsql"), + (r"{opensql}", Token.Sql.Exec, "opensql"), # alias of execsql + (r"{printsql}", Token.Sql.Print, "printsql"), (r".*?\n", using(PythonLexer)), ], "sqlpopup": [ @@ -82,13 +156,15 @@ "#pop", ) ], - "opensqlpopup": [(r".*?(?:{stop}\n*|$)", Token.Sql, "#pop")], + "execsql": [(r".*?(?:{stop}\n*|$)", Token.Sql.ExecState, "#pop")], + "opensql": [(r".*?(?:{stop}\n*|$)", Token.Sql.ExecState, "#pop")], + "printsql": [(r".*?(?:{stop}\n*|$)", Token.Sql.PrintState, "#pop")], } class PopupSQLFormatter(HtmlFormatter): def _format_lines(self, tokensource): - sql_lexer = SqlLexer() + sql_lexer = RealWorldSQLLexer() formatter = HtmlFormatter(nowrap=True) buf = [] @@ -99,10 +175,15 @@ yield t, v buf = [] - if ttype is Token.Sql: + if ttype in (Token.Sql.ExecState, Token.Sql.PrintState): + class_ = ( + "show_sql" + if ttype is Token.Sql.ExecState + else "show_sql_print" + ) yield ( 1, - "
%s
" + f"
%s
" % pygments.highlight( re.sub(r"(?:{stop}|\n+)\s*$", "", value), sql_lexer, @@ -134,7 +215,11 @@ def _filter_tokens(self, tokensource): for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]): if ttype in Token.Sql: - if ttype is not Token.Sql.Link and ttype is not Token.Sql.Open: + if ttype not in ( + Token.Sql.Link, + Token.Sql.Exec, + Token.Sql.Print, + ): yield Token.Literal, re.sub(r"{stop}", "", value) else: continue @@ -145,10 +230,100 @@ LatexFormatter.format(self, self._filter_tokens(tokensource), outfile) +ARROW_ANNOTATION = ( + (Token.Operator, "-"), + (Token.Operator, ">"), +) +COLON_ANNOTATION = ( + (Token.Name,), + (Token.Punctuation, ":"), +) + +NEWLINE = (Token.Text, "\n") + + +class DetectAnnotationsFormatterMixin: + annotated = None + + def _format_lines(self, tokensource): + + self.annotated = None + + def go(tokensource): + for ttype, value in tokensource: + if ttype is Token.Other and value.startswith( + "pep484 annotations detected:" + ): + self.annotated = ( + value == "pep484 annotations detected: True" + ) + continue + + yield ttype, value + + for level, tag in super()._format_lines(go(tokensource)): + yield level, tag + + def _wrap_pre(self, inner): + for level, tag in super()._wrap_pre(inner): + yield level, tag + + if level == 0 and self.annotated is not None and tag == "": + yield ( + 1, + '
' + if self.annotated + else '
', + ) + + def _wrap_code(self, inner): + + for level, tag in super()._wrap_code(inner): + yield level, tag + + if level == 0 and self.annotated is not None and tag == "": + yield ( + 1, + '
' + if self.annotated + else '
', + ) + + +class AnnoPopupSQLFormatter( + DetectAnnotationsFormatterMixin, PopupSQLFormatter +): + pass + + +def setup_formatters(app, config): + if config.zzzeeksphinx_annotation_key: + PygmentsBridge.html_formatter = AnnoPopupSQLFormatter + filters = [DetectAnnotationsFilter()] + else: + PygmentsBridge.html_formatter = PopupSQLFormatter + filters = [] + + highlighting.lexers["sql"] = RealWorldSQLLexer() + + highlighting.lexers["python"] = highlighting.lexers[ + "python3" + ] = PythonLexer(filters=filters) + highlighting.lexers["pycon"] = highlighting.lexers[ + "pycon3" + ] = PythonConsoleLexer(filters=filters) + highlighting.lexers["python+sql"] = PythonWithSQLLexer(filters=filters) + highlighting.lexers["pycon+sql"] = PyConWithSQLLexer(filters=filters) + + PygmentsBridge.latex_formatter = PopupLatexFormatter + + def setup(app): + # pass lexer class instead of lexer instance app.add_lexer("pycon+sql", PyConWithSQLLexer) app.add_lexer("python+sql", PythonWithSQLLexer) - PygmentsBridge.html_formatter = PopupSQLFormatter - PygmentsBridge.latex_formatter = PopupLatexFormatter + app.add_config_value("zzzeeksphinx_annotation_key", None, "env") + + app.connect("config-inited", setup_formatters) diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsbase/layout.mako zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsbase/layout.mako --- zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsbase/layout.mako 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsbase/layout.mako 2023-04-25 23:29:57.000000000 +0000 @@ -1,6 +1,8 @@ ## coding: utf-8 <%! + import datetime + local_script_files = [] default_css_files = [ @@ -304,6 +306,9 @@ % if show_sphinx: Created using Sphinx ${sphinx_version|h}. % endif + + Documentation last generated: ${datetime.datetime.now().strftime("%c")} + diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsmako/layout.mako zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsmako/layout.mako --- zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsmako/layout.mako 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsmako/layout.mako 2023-04-25 23:29:57.000000000 +0000 @@ -139,7 +139,7 @@

Table of Contents

- ${toc} + % if prevtopic:

Previous Topic

diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsmako/static/docs.css zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsmako/static/docs.css --- zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zsmako/static/docs.css 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zsmako/static/docs.css 2023-04-25 23:29:57.000000000 +0000 @@ -170,11 +170,15 @@ #docs-sidebar { float:left; - width:212px; + width:237px; padding: 10px 0 0 15px; /*font-size:.85em;*/ } +#docs-sidebar #sidebar-toc { + overflow:auto; +} + #docs-sidebar h3, #docs-sidebar h4 { background-color: #DDDDDD; color: #222222; @@ -184,7 +188,7 @@ margin: 10px 0 0 -15px; padding: 5px 10px 5px 10px; text-shadow: 1px 1px 0 white; - width:210px; + width:235px; } #docs-sidebar h3 a, #docs-sidebar h4 a { @@ -210,7 +214,7 @@ } #docs-body.withsidebar { - margin: 0 0 0 230px; + margin: 0 0 0 255px; border-left:3px solid #DFDFDF; } @@ -263,14 +267,18 @@ border-bottom: 1px solid; } -.popup_sql, .show_sql +.popup_sql, .show_sql, .show_sql_print { - background-color: #FBFBEE; padding:5px 10px; margin:10px -5px; border:1px dashed; } +.popup_sql, .show_sql +{ + background-color: #FBFBEE; +} + /* the [SQL] links used to display SQL */ #docs-container .sql_link { Binary files /tmp/tmpw1dy_mh7/E_cmqnOkkh/zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zzzeeksphinx/static/annotated.png and /tmp/tmpw1dy_mh7/20RtqTH59t/zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zzzeeksphinx/static/annotated.png differ diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zzzeeksphinx/static/docs.scss zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zzzeeksphinx/static/docs.scss --- zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zzzeeksphinx/static/docs.scss 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zzzeeksphinx/static/docs.scss 2023-04-25 23:29:57.000000000 +0000 @@ -36,30 +36,49 @@ $narrow-max-screen-width: 980px; -$primary-background-color: #fdfbfc; $topmost-header-color: #ebebee; $popout-color: #fbfbee; $sidebar-color: #efefef; -$sidebar-header-background-color: #dddddd; +$sidebar-header-background-color: inherit; $sidebar-header-color: #222222; $notebox-background-color: #eeffef; $code-sig-background-color: #efefef; $deprecated-background-color: #fcf0f6; +$legacy-background-color: #fcffc0; $warning-background-color: #fcf0f6; $deepalchemy-background-color: #f6e8fd; $versionchanged-background-color: #f9f9d9; +$outer-border-style: none; $border-style: 1px solid #ccc; -$divider-line-style: 1px solid #ccc; +$index-divider-line-style: 1px solid #ccc; -$box-shadow-style: 2px 2px 3px #dfdfdf; $box-top-margin: 10px; $box-margin: $box-top-margin 10px 20px 0px; + +// this is optimized for the site. with the vanilla docs, the +// vertical padding is too much. not sure how to fix $box-padding: 1rem 1em 2px 1rem; + +// looks better with vanilla docs but not w/ the site +// $box-padding: 0 1em 0 1rem; + $box-title-padding: 0 2em 0 1.5em; $box-header-color: #c5cec2; $box-background-color: #f8f9f0; -$hyperlink-color: #990000; +// note main text is on top of docs-body-background +$primary-background-color: #ffffff; + +// passes: +// https://webaim.org/resources/linkcontrastchecker/?fcolor=110000&bcolor=FFFFFF&lcolor=BB0000 +$docs-body-background: #ffffff; +$text-color: #110000; +$hyperlink-color: #BB0000; +$hyperlink-hover-color: #FF0000; + +//$spacing-between-outer-boxes: 10px; +$spacing-between-outer-boxes: 0; + $keyword-color: #480717; $keyword-background-color: #f2f2f2; @@ -67,11 +86,14 @@ $orm-background-color: #e2f3f4; $core-background-color: #aecaf7; -$sidebar-popout-height: 160px; +$sidebar-popout-height: 171px; $max-container-width: 100em; // 100 * 16 == 1600px; -$fixed-sidebar-width: 328px; -$docs-body-sidebar-left: 338px; +$fixed-sidebar-width: 360px; +$inner-fixed-sidebar-width: $fixed-sidebar-width - 40px; + +$docs-body-sidebar-left: 360px; +$docs-body-sidebar-horiz-padding: 45px; /* global */ @@ -82,7 +104,7 @@ body { background-color: $primary-background-color; margin: 0 38px; - color: #333333; + color: $text-color; } blockquote { @@ -110,7 +132,7 @@ color: $hyperlink-color; } a:hover { - color: #ff0000; + color: $hyperlink-hover-color; text-decoration: underline; } @@ -142,7 +164,7 @@ #docs-container { max-width: $max-container-width; - margin: 10px auto; + margin: $spacing-between-outer-boxes auto; position: relative; font-size: 120%; line-height: 1.4em; @@ -157,7 +179,7 @@ position: relative; background-color: $topmost-header-color; - border: $border-style; + border: $outer-border-style; height: 75px; display: flex; @@ -176,7 +198,7 @@ #narrow-index-nav { font-family: $sidebar-font-family; background-color: $popout-color; - border: $border-style; + border: $outer-border-style; font-size: 0.8em; } @@ -196,11 +218,11 @@ } #docs-bottom-navigation { - margin: 1em 0 1em 0; + margin: $spacing-between-outer-boxes 0 $spacing-between-outer-boxes 0; } #docs-bottom-navigation.withsidebar { - margin-left: $docs-body-sidebar-left; + margin-left: $fixed-sidebar-width; } #docs-copyright { @@ -257,7 +279,7 @@ #index-nav { position: relative; - margin-top: 10px; + margin-top: $spacing-between-outer-boxes; padding: 10px 10px 25px 10px; } @@ -282,6 +304,7 @@ #docs-sidebar { top: $sidebar-popout-height + 18px; width: $fixed-sidebar-width; + margin-right: $fixed-sidebar-width - $inner-fixed-sidebar-width; bottom: 0; min-height: 0; overflow-y: auto; @@ -335,13 +358,14 @@ #docs-sidebar-inner { padding-left: 10px; + margin-right:40px; /*width:212px;*/ font-family: $sidebar-font-family; font-size: 0.85em; - border: $border-style; + border: $outer-border-style; background-color: $sidebar-color; > ul { @@ -361,14 +385,15 @@ } h3, - h4 { + h4, + h5 { background-color: $sidebar-header-background-color; color: $sidebar-header-color; font-family: $sidebar-font-family; font-size: 1.1em; font-weight: normal; margin: 10px 0 0 -15px; - padding: 5px 10px 5px 15px; + padding: 15px 10px 5px 15px; text-shadow: 1px 1px 0 white; a { @@ -427,6 +452,8 @@ width: $fixed-sidebar-width; top: 0; bottom: 0; + background-color: $sidebar-color; + } #fixed-sidebar #docs-sidebar { @@ -444,16 +471,18 @@ } #docs-body { - background-color: #ffffff; - padding: 1px 10px 10px 10px; + background-color: $docs-body-background; + padding: 10px 10px 10px 10px; - border: $border-style; - margin-top: 10px; + border: $outer-border-style; + margin-top: $spacing-between-outer-boxes; } #docs-body.withsidebar { margin-left: $docs-body-sidebar-left; + padding: 10px $docs-body-sidebar-horiz-padding 0 $docs-body-sidebar-horiz-padding; + div.section, section { /* to limit text width inside the container */ @@ -469,7 +498,7 @@ display: none; } -/* disable sidebar on narrow screens */ +/* disable sidebar on mobile / narrow screens */ @media only screen and (max-width: $narrow-max-screen-width) { #fixed-sidebar { display: none; @@ -477,7 +506,7 @@ #narrow-index-nav { display: block; padding: 1rem; - margin: 10px 0 10px 0; + margin: $spacing-between-outer-boxes 0 $spacing-between-outer-boxes 0; } #docs-body.withsidebar { @@ -510,7 +539,7 @@ } #docs-narrow-top-navigation { - border: $border-style; + border: $outer-border-style; background-color: $sidebar-color; font-family: $sidebar-font-family; font-size: 0.85rem; @@ -528,6 +557,7 @@ #docs-body h2, #docs-body h3, #docs-body h4, +#docs-body h5, #docs-body .h2 { font-family: $header-font-family; font-weight: bold; @@ -547,7 +577,7 @@ h2 { font-size: 1.6rem; - border-top: $divider-line-style; + border-top: $index-divider-line-style; padding-top: 20px; } @@ -562,6 +592,10 @@ h4 { font-size: 1.2rem; } + + h5 { + font-size: 1.05rem; + } } /* SQL popup, code styles */ @@ -575,7 +609,6 @@ font-size: .85rem; background-color: #f0f0f0; border: $border-style; - box-shadow: $box-shadow-style; padding: 10px; margin: $box-margin; overflow: auto; @@ -583,6 +616,29 @@ clear: both; } + @media only screen and (max-width: ($narrow-max-screen-width + 300)) { + pre { + padding: 10px 10px 30px 10px; + } + } + + /* python annotation key */ + div.code-annotations-key, div.code-non-annotations-key { + position:absolute; + right:1.2em; + bottom:.05em; + width: 180px; + background-size: 180px; + height: 30px; + } + div.code-annotations-key { + background-image: url("annotated.png"); + } + div.code-non-annotations-key { + background-image: url("nonannotated.png"); + } + + /* the [SQL] links used to display SQL */ .sql_link { font-weight: normal; @@ -618,12 +674,16 @@ } .popup_sql, -.show_sql { - background-color: $popout-color; +.show_sql, +.show_sql_print { padding: 5px 10px; - margin: 10px -5px; + margin: 10px -5px 10px -5px; border: 1px dashed; } +.popup_sql, +.show_sql { + background-color: $popout-color; +} /* SQL popups are always on at the moment, disable the button */ .sql_link { display: none; @@ -657,6 +717,11 @@ overflow: visible; padding: 8px 16px; } + + td.autosummary-name { + vertical-align: top; + } + } tr.row-even { @@ -675,12 +740,14 @@ margin: 0px; } + td.field-body { padding-top: 1em; ul.first { padding-left: 17px; padding-top: 1em; } + } div.faq { @@ -762,12 +829,12 @@ padding: 0 20px 0 20px; background-color: $box-background-color; border: $border-style; - box-shadow: $box-shadow-style; margin: $box-margin; } } + div.sidebar { background-color: #ffffee; float: right; @@ -817,14 +884,19 @@ margin-left: -140px; } background-image: url("deepalchemy.png"); - background-position: left top; + background-size: auto 100px; + background-position: 6px 9px; background-repeat: no-repeat; background-color: $deepalchemy-background-color; clear: right; - min-height: 180px; + min-height: 120px; padding-left: 140px; } +div.legacy { + background-color: $legacy-background-color; +} + @media only screen and (max-width: $narrow-max-screen-width) { div.note, div.warning { @@ -857,21 +929,24 @@ font-weight: bold; } -div.class-bases { +div.class-bases, div.class-members { border: $border-style; - box-shadow: $box-shadow-style; padding: 5px 5px; padding: $box-padding; font-size: 0.9em; margin: $box-margin; +} +div.class-bases { background-color: #eefbfb; } +div.class-members { + background-color: #ebedfa; +} div.inherited-member { border: $border-style; - box-shadow: $box-shadow-style; padding: 5px 5px; font-size: 0.9em; background-color: #eefbfb; @@ -893,7 +968,6 @@ dl.class > dt, dl.exception > dt { border: $border-style; - box-shadow: $box-shadow-style; background-color: $code-sig-background-color; margin: 25px -10px 10px 10px; padding: 8px 10px; @@ -904,7 +978,6 @@ border-left: $border-style; border-right: $border-style; border-bottom: $border-style; - box-shadow: $box-shadow-style; margin: $box-top-margin 10px 0 0; li > p { @@ -1033,11 +1106,11 @@ } div#getting-started { - border-bottom: $divider-line-style; + border-bottom: $index-divider-line-style; } div#tutorials { - border-bottom: $divider-line-style; + border-bottom: $index-divider-line-style; } /* new index layout thing */ @@ -1048,20 +1121,32 @@ div.left-right-container { display: flex; - border-bottom: $divider-line-style; + p.h2 { + display: block; + font-weight: bold; + font-size: 1.4em; + } + + .container { + border-bottom: $index-divider-line-style; + //margin: 0 20px 0 20px; + padding-right:10px; + + } + + &:last-of-type { + .container { + border-bottom: none; + } + } .orm { background-color: $orm-background-color; + margin-right: 0; } - .core { background-color: $core-background-color; - } - - p.h2 { - display: block; - font-weight: bold; - font-size: 1.4em; + margin-left: 0; } .leftmost { @@ -1069,6 +1154,8 @@ max-width: 15em; background-color: #e4e4e8; padding-left: 10px; + border-bottom: none; + margin: 0; } div { @@ -1094,6 +1181,7 @@ div.container { padding-bottom: 1rem; max-width: none; + margin: 0; } .orm, .core { @@ -1122,7 +1210,7 @@ width: 48%; min-height: 400px; padding-left: 10px; - border-right: $divider-line-style; + border-right: $index-divider-line-style; h2 { margin: 0; } @@ -1140,7 +1228,7 @@ } div#dialect-documentation { - border-top: $divider-line-style; + border-top: $index-divider-line-style; clear: both; } @@ -1161,7 +1249,8 @@ div.orm-core, section.orm-core { h2, h3, - h4 { + h4, + h5 { border: none; } } Binary files /tmp/tmpw1dy_mh7/E_cmqnOkkh/zzzeeksphinx-1.3.5/zzzeeksphinx/themes/zzzeeksphinx/static/nonannotated.png and /tmp/tmpw1dy_mh7/20RtqTH59t/zzzeeksphinx-1.4.0/zzzeeksphinx/themes/zzzeeksphinx/static/nonannotated.png differ diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx/toc.py zzzeeksphinx-1.4.0/zzzeeksphinx/toc.py --- zzzeeksphinx-1.3.5/zzzeeksphinx/toc.py 2022-06-22 17:01:49.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx/toc.py 2023-04-25 23:29:57.000000000 +0000 @@ -1,4 +1,5 @@ #!coding: utf-8 +import re from typing import cast from docutils import nodes as docutils_nodes @@ -7,6 +8,9 @@ from sphinx.environment.adapters.toctree import TocTree +UNDERSCORE_RE = re.compile(r"_\w+\.(.+)$") + + class TOCMixin: app: Sphinx @@ -254,6 +258,7 @@ )["fragment"] def _link_node(self, refuri, text_nodes): + text_nodes = list(self._sub_out_underscores(text_nodes)) link = docutils_nodes.reference("", "", text_nodes[0], refuri=refuri) link.extend(text_nodes[1:]) cp = docutils_nodes.inline(classes=["link-container"]) @@ -263,7 +268,7 @@ def _strong_node(self, refuri, text_nodes): cp = docutils_nodes.inline(classes=["link-container"]) n1 = docutils_nodes.strong() - n1.extend(text_nodes) + n1.extend(self._sub_out_underscores(text_nodes)) cp.append(n1) paramlink = docutils_nodes.reference( "", @@ -278,3 +283,12 @@ cp.append(paramlink) return cp + + def _sub_out_underscores(self, nodes): + for node in nodes: + for lt in node.traverse(docutils_nodes.Text): + m = UNDERSCORE_RE.match(str(lt)) + if m: + lt.parent.replace(lt, docutils_nodes.Text(m.group(1))) + + yield node diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/PKG-INFO zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/PKG-INFO --- zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/PKG-INFO 2022-06-22 17:01:56.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/PKG-INFO 2023-04-25 23:30:03.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: zzzeeksphinx -Version: 1.3.5 +Version: 1.4.0 Summary: Zzzeek's Sphinx Layout and Utilities. Home-page: https://github.com/sqlalchemyorg/zzzeeksphinx Author: Mike Bayer diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/requires.txt zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/requires.txt --- zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/requires.txt 2022-06-22 17:01:56.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/requires.txt 2023-04-25 23:30:03.000000000 +0000 @@ -1,4 +1,5 @@ libsass mako requests -sphinx<5.1,>=4.5.0 +sphinx<6.3,>=5.3.0 +sphinxcontrib-jquery diff -Nru zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/SOURCES.txt zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/SOURCES.txt --- zzzeeksphinx-1.3.5/zzzeeksphinx.egg-info/SOURCES.txt 2022-06-22 17:01:56.000000000 +0000 +++ zzzeeksphinx-1.4.0/zzzeeksphinx.egg-info/SOURCES.txt 2023-04-25 23:30:03.000000000 +0000 @@ -33,9 +33,11 @@ zzzeeksphinx/themes/zsmako/theme.conf zzzeeksphinx/themes/zsmako/static/docs.css zzzeeksphinx/themes/zzzeeksphinx/theme.conf +zzzeeksphinx/themes/zzzeeksphinx/static/annotated.png zzzeeksphinx/themes/zzzeeksphinx/static/deepalchemy.png zzzeeksphinx/themes/zzzeeksphinx/static/deepalchemy_original.png zzzeeksphinx/themes/zzzeeksphinx/static/docs.scss zzzeeksphinx/themes/zzzeeksphinx/static/dragons.png zzzeeksphinx/themes/zzzeeksphinx/static/dragons_original.png -zzzeeksphinx/themes/zzzeeksphinx/static/init.js \ No newline at end of file +zzzeeksphinx/themes/zzzeeksphinx/static/init.js +zzzeeksphinx/themes/zzzeeksphinx/static/nonannotated.png \ No newline at end of file