Repository navigation
Releases
v0.3.0
Plugin functionality
-
The Expand diagram button takes its own line and centres beneath the rendered diagram, including diagrams narrower than their content container. Its position follows diagram and container size changes. Host CSS can override the default layout with
.tdsv-expandwithout!important. -
Standalone setup now finds inline SVGs anywhere in the supplied container by default. The TechDocs addon keeps its documentation selector. Set
window.svgViewerOptionsbefore loadingsvg-viewer.jsto customise the selector, size thresholds and zoom limits. Existing directinstallSvgViewer()calls that need the previous selection must passselector: '.md-content__inner svg, article svg'explicitly. -
The viewer toolbar includes a White theme button for diagrams that are hard to read against the host palette. Page theme restores the host palette. The browser saves the choice for all diagrams on the same website, separately from the page theme. SVG artwork, zoom and pan stay unchanged. If browser storage is unavailable, the choice applies only to the open viewer.
-
The SVG viewer follows the active TechDocs or Material for MkDocs theme.
Other repository changes
-
Added
pnpm screenshotsto rebuild the examples and capture all six README images in light and dark mode with fixed viewports and viewer zoom. -
All examples use a space observatory diagram with 30 nodes for zoom and pan. A second page has a smaller calibration diagram with links in both directions, including page sections, query strings and legacy SVG links. The fictional mission follows NASA and STScI descriptions of spacecraft communications, calibration and archive products, with sources and scope notes in the example. Added
pnpm examples:syncto regenerate the standalone pages from the MkDocs diagrams, andpnpm examples:checkto detect differences during validation. Browser tests cover diagram links across the standalone, MkDocs and Backstage examples (#15). -
The local Backstage app enters as a guest automatically and opens the example documentation without a login screen. The catalogue remains available at
/catalog. The reader waits for the example catalogue entry during startup so the first visit does not need a reload. Automatic guest sign-in also retries temporary connection failures while the backend starts. -
Added a static Backstage demo with the real TechDocs reader, SVG addon and appearance controls. Browser tests cover GitHub Pages paths, bookmarks, refreshes and SVG navigation without a backend. A GitHub Actions workflow builds and tests pull requests and deploys changes from
main. -
Example commands use
example:<name>:<action>, withdevto launch andtestto run tests. Addedexample:standalone:devandexample:standalone:test. Renamed the MkDocs and Backstage commands to follow the same convention. -
Added standalone HTML instructions and a minimal example without MkDocs, Backstage or React.
-
Both standalone demo pages include a light/dark switcher. They start in light mode and save the selected theme in the browser.
-
The standalone MkDocs example keeps the configured Material palette, and includes a light/dark toggle in the header. It uses
mkdocs serveand loadstechdocs-coreonly when Backstage builds the site. -
Added Settings to the Backstage example for switching between Light, Dark and Auto, with browser tests for theme selection and viewer colours.
-
Added a local Backstage 1.56.2 example with the SVG addon, guest sign-in, SQLite and the existing MkDocs site registered as TechDocs. Setup, build and browser test commands support local testing without Docker or external accounts. mise manages the tools for local development and the Backstage CI job.
-
Releases and snapshots now stage on npm for maintainer approval before publication. A manual CI run on
maincan also stage a snapshot (#10). -
GitHub release notes now unwrap changelog paragraphs to avoid unwanted line breaks.
-
Simplified the README and added release, npm and jsDelivr badges, plus guidance on testing approved snapshots.
Dependency updates
-
Updated development tools to TypeScript 6.0.3, Vitest 5.0.5, tsup 9.0.0 and Vite 8.3.5 (#19, #8, #9, #7).
-
Updated
fast-urito 3.1.9,node-forgeto 1.4.2 andfollow-redirectsto 1.16.2 in the root pnpm lockfile (#12, #17, #18). -
Updated GitHub Actions used by CI and the demo deployment, including the pinned actions used for npm publishing (#4, #16).
v0.2.0
- First public release. The project is open source under the Apache License 2.0 and is published to npm. Snapshots of
mainare published with thenexttag. The standalonesvg-viewer.jscan be loaded from jsDelivr. - Renamed the repository to
techdocs-mkdocs-svg-viewerand the package to@mwz/techdocs-mkdocs-svg-viewer, because it supports standalone MkDocs sites as well as Backstage TechDocs. Update the dependency and imports in your Backstage app. The Backstage plugin IDtechdocs-addon-svg-vieweris unchanged. - The package metadata now declares a TechDocs module (
frontend-plugin-module,pluginId: techdocs), like other TechDocs addons. New frontend apps that use feature discovery load the./alphamodule automatically. - All peer dependencies are optional, so the
/viewerentry point can be used without React or Backstage packages. - Links with only
xlink:hrefget a resolvedhref, so TechDocs routes them in-app instead of reloading the page (resolveXlinkHref, on in the addon). - The viewer closes when TechDocs routes a link clicked in it, including same-page
#fragmentlinks, which fire nohashchange. - Mermaid diagrams are skipped.
- Hover and other interactive styles in the TechDocs shadow root, for example from a custom styles addon, now apply in the viewer. The viewer no longer sets every presentation property inline as
!important. It sets inline only the values that changed when the SVG moved into the viewer. Hover styles that are active when you click to open the viewer do not stay on in the viewer. dist/svg-viewer.js: a self-contained drop-in script for MkDocs sites outside Backstage, loaded withextra_javascript.pnpm example:servepreviewsexamples/mkdocswith the drop-in script via Poetry andtechdocs-cli serve:mkdocs.@techdocs/cliis a development dependency, and the example uses Poetry instead ofrequirements.txt.- The demo's
?techdocsmode simulates TechDocs link handling for browser tests.