Skip to content

Choose a tag to compare

@kzu kzu released this 12 Nov 22:01
· 4 commits to main since this release

The first release of the plotdown action on the GitHub Marketplace.

plotdown renders the ```plot blocks of Markdown files (Observable Plot specs in JSON) as SVG images, and puts each image right after its block, so the charts show on GitHub, npm and any other place that renders Markdown but no scripts.

Usage

# .github/workflows/plots.yml
on:
  push:
    branches: [main]
permissions:
  contents: write
jobs:
  plots:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: devlooped/plotdown@v1
        with:
          files: "**/*.md"
          commit: true

For pull requests, check: true changes nothing and fails when an image is missing or out of date.

Inputs

Input Default
files **/*.md Files or globs, separated by spaces or new lines
out docs/plots Where the SVG files go
theme auto auto (the reader's color scheme), light or dark
check false Change nothing, and fail when an image is missing or out of date
commit false Commit and push the changes (needs contents: write)
commit-message Render plot blocks The message of that commit
version A version of @devlooped/plotdown on npm; empty builds plotdown from the action's own source

Outputs

Output
changed Whether the run changed files (with check, whether it would)

See the readme and plotdown.cc for more.