CI & automation
Commit a metro-map .mmd to your pipeline repo and let automation keep the
rendered SVG in sync. nf-metro ships two integrations:
- A composite GitHub Action that installs nf-metro and renders the map, leaving you to decide what to do with the result.
- A pre-commit hook that re-renders the SVG locally on every commit.
GitHub Action
Section titled “GitHub Action”The composite action renders the map and reports whether the SVG changed.
- uses: actions/checkout@v4- uses: seqeralabs/nf-metro@2.0.0 id: metro with: input: assets/metro_map.mmd theme: nfcore embed-font: "true"# steps.metro.outputs.output-path — where the SVG was written# steps.metro.outputs.changed — 'true' when it differs from the committed SVGEvery input is optional: input (default assets/metro_map.mmd), output
(default: the sibling .svg of the input), theme (default nfcore), mode,
embed-font (default true), version (the nf-metro version to install), and
extra-args for any other nf-metro render flag, such as
extra-args: "--fold-threshold 20".
Pre-commit hook
Section titled “Pre-commit hook”Re-render the SVG locally on every commit so it cannot drift from the source.
repos: - repo: https://github.com/seqeralabs/nf-metro rev: 2.0.0 hooks: - id: nf-metroThe hook matches *.mmd and writes the sibling .svg, so
assets/metro_map.mmd becomes assets/metro_map.svg. It runs with
--theme nfcore --embed-font by default. Setting args replaces that whole
list, so repeat the flags you want to keep alongside the new one:
- id: nf-metro args: [--theme, nfcore, --embed-font, --mode, light]Drop --theme nfcore if the map picks its own brand with a
%%metro style: directive, which the flag would otherwise override.