Added <!-- %revision% --> place-holder - #492
Open
ishaid wants to merge 4 commits into
Open
Conversation
SomethingNew71
added a commit
to ClassicMiniDIY/WireViz
that referenced
this pull request
May 5, 2026
…wireviz#492) Resolves to the key of the most recently added entry in ``metadata.revisions``. Useful in branded HTML chrome to surface a "current revision" badge without expanding to the full ``<!-- %revisions_N_key% -->`` indexed form. Example template fragment: <span class="rev">Rev <!-- %revision% --></span> Adapted from wireviz#492 (originally by @ishaid, targeting upstream ``dev``). The upstream patch was against ``wv_output.py`` (a ``dev``-only renaming of ``wv_html.py``); this port lives in master's ``wv_html.py``. Helper renamed from ``_get_latest_revision`` to ``_latest_revision`` and tightened to return ``""`` for missing/None/empty revisions instead of raising. Documents the new placeholder in templates/README.md. Verified: * Direct unit test: ``_latest_revision({"revisions": {"A": ..., "B": ..., "C": ...}})`` returns ``"C"``. * Empty/missing/None ``revisions`` returns ``""``. * build_examples.py: deterministic outputs (.gv, .bom.tsv) byte- identical to baseline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SomethingNew71
added a commit
to ClassicMiniDIY/WireViz
that referenced
this pull request
May 5, 2026
Add <!-- %revision% --> HTML placeholder (port of upstream PR wireviz#492)
This was referenced May 5, 2026
Replace setup.py / requirements.txt / devtools.txt with a PEP 621 pyproject.toml using the hatchling build backend, and commit a uv.lock for reproducible installs. Drop EOL Python 3.7/3.8 (new floor is 3.9, matching ubuntu-latest in CI). Migrate the GitHub workflow and cleanup.sh to invoke tools via 'uv sync' / 'uv run' instead of pip and a manually activated venv.
Relocate the example gallery and demo files so they can be included in the zensical/mkdocs documentation site. Update build_examples.py group paths, the CI workflow artifact path, and relative links in docs/README.md, docs/syntax.md, and docs/buildscript.md to match the new location.
Collaborator
|
@ishaid - Thank you for your contributions! With your latest commits, it seems you have now added 3 independent suggestions (revision placeholder, pyprojects.toml and new docs) in this PR. I therefore suggest you split out the latest commits into two new PRs to enable independent reviews and discussions. If this is hard because one PR then will depend fully on the other, it is possible to include all the dependent commits in both, and make a note (in the PR description) of which (probably leading) commits are cherry-picked from another PR (which one) due to dependencies, and therefore not directly part of the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
This addresses issue #491 (which I created per the contribution guidelines).
I've added a
<!-- %revision% -->place holder which gets populated by the latest revision using the following logic:def _get_latest_revision(metadata: Dict) -> str: if not "revisions" in metadata: return "" revision = list(metadata.get("revisions"))[-1] return revisionIn addition to what I mentioned in the issue this also allows adding a revision indicator of the current revision without needing the entire table.
I've added the place holder to the relevant README.md.