Skip to content

Transfer the Sphinx extension from pyTooling - #2

Merged
Paebbels merged 3 commits into
devfrom
claude/transfer-from-pyTooling
Oct 3, 2026
Merged

Paebbels merged 3 commits into
devfrom
claude/transfer-from-pyTooling

Conversation

@pytooling-claude

@pytooling-claude pytooling-claude Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Moves pyTooling's Sphinx extension here, from pyTooling dev 47a7877b. pyTooling keeps its copy until the move is released.

Changes

  • pyTooling.Documentation.Sphinx → pyTooling.Sphinx: CondensedClass, DependencyTable, Directives, Roles, SchemaGraph, Shields, XSDSchemaGraph and the extension's setup(). The stylesheet pyTooling.Resources.Sphinx becomes pyTooling.Sphinx.Resources (package data since 7fe00fc). The domain gha goes to pyTooling.GitHub.
  • Code unchanged apart from import paths, the version (the package's own __version__) and the extras:
    • Sphinx, xmlschema and pyTooling's pypi extra are requirements now, so DependencyTable imports Sphinx without a guard and xsd-graph names no extra when xmlschema is missing.
    • pyTooling 10 isn't on PyPI yet, so requirements.txt installs it from GitHub: pyTooling[pypi] @ git+https://github.com/pyTooling/pyTooling.git@dev. PyPI rejects such a requirement - it becomes pyTooling[pypi] ~= 10.0 before the first upload.
  • Import blocks the shorter module paths misaligned are padded to their block's column.

Documentation

  • doc/Documentation/Sphinx.rst → doc/Extension.rst. The documentation uses the extension itself (conf.py), and prolog.inc is pyTooling's, as the extension registers the roles. References to pyTooling's pages and to the gha domain are links to their documentation.

Unit Tests

  • pyTooling has no tests for this part - correction: it has, in tests/unit/Documentation.py; they move in a pull-request of their own. tests/unit/Extension.py adds smoke tests: the metadata, the roles and directives setup() registers, the substitutions, rendering of the style roles and the stylesheet. 5 passed.

Related Issues and Pull-Requests

  • The pipeline: Add the pipeline #3 (stacked on this one).
  • pyTooling.GitHub needs this merged into dev first - it installs pyTooling.Sphinx from dev.

claude-code and others added 2 commits October 3, 2026 11:08
pyTooling.Documentation.Sphinx (pyTooling dev 47a7877b) becomes pyTooling.Sphinx, its stylesheet
pyTooling.Resources.Sphinx becomes pyTooling.Sphinx.Resources; the domain 'gha' goes to pyTooling.GitHub. Code
unchanged apart from the import paths, the version and the extras: Sphinx, xmlschema and pyTooling's 'pypi' extra
are requirements now. pyTooling 10 isn't on PyPI yet, so it is installed from its 'dev' branch.

doc/Documentation/Sphinx.rst becomes doc/Extension.rst; the documentation uses the extension itself. New smoke
tests: registration, roles, substitutions, stylesheet.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
pyTooling.Sphinx.Resources' 'pyTooling.css' wasn't package data, so a build with the installed extension failed in
'installStylesheet'.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Comment thread pyTooling/Sphinx/Resources/__init__.py Resolved
Comment thread pyTooling/Sphinx/__init__.py Resolved
Comment thread pyTooling/Sphinx/Directives.py Resolved
Comment thread pyTooling/Sphinx/Directives.py Resolved
* SphinxExtensionError, strip, stripAndNormalize and BaseDirective move from pyTooling.Sphinx.Directives into the
  package; setup() imports the directive modules, so they can import their base-class from the package.
* Every file's banner spells pyTooling.Sphinx.
* Imports aligned to the column the shorter module paths need.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@Paebbels
Paebbels merged commit 5365cec into dev Oct 3, 2026
@Paebbels
Paebbels deleted the claude/transfer-from-pyTooling branch October 3, 2026 16:38
pytooling-claude Bot pushed a commit that referenced this pull request Oct 16, 2026
The documentation is built with LuaLaTeX and the MiKTeX image's pytooling.sty, which
defines \emoji{<characters>} (Noto Color Emoji). The Emoji node's LaTeX visitor writes
\pyToolingEmoji{<characters>}{<shortcode>}; the preamble defines it as
\ifdefined\emoji\emoji{#1}\else:#2:\fi, so pdfLaTeX and a project without pytooling.sty
get the shortcode (the unused characters aren't expanded, so pdfLaTeX doesn't stop).

Non-ASCII runs are wrapped in \detokenize: pytooling.sty maps some characters to
\emoji via \newunicodechar, which nested \emoji calls and left U+FE0F in nullfont;
ASCII characters (a keycap's '#') are escaped instead, as \detokenize doubles '#'.
Checked with LuaLaTeX and Noto Color Emoji: single characters, U+FE0F, ZWJ
sequences, flags and keycaps render in color.

LineBreak's doc-string no longer claims '\\' ends a table row: Sphinx 9 wraps every
cell in varwidth. \newline{} stays, as it breaks the line in any environment.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
This was referenced Oct 17, 2026
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants