Skip to content

Added <!-- %revision% --> place-holder - #492

Open
ishaid wants to merge 4 commits into
wireviz:devfrom
ishaid:dev
Open

Added <!-- %revision% --> place-holder#492
ishaid wants to merge 4 commits into
wireviz:devfrom
ishaid:dev

Conversation

@ishaid

@ishaid ishaid commented Jan 4, 2026

Copy link
Copy Markdown

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 revision

In 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.

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)
ishaid added 3 commits May 16, 2026 11:15
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.
@kvid

kvid commented May 16, 2026

Copy link
Copy Markdown
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.

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