Skip to content

Instantly share code, notes, and snippets.

@retronym
Last active October 8, 2021 01:35
Show Gist options
  • Save retronym/7f4d10decf099535f8997c0f748dda28 to your computer and use it in GitHub Desktop.
Save retronym/7f4d10decf099535f8997c0f748dda28 to your computer and use it in GitHub Desktop.
Render the body of a GitHub issue in a local HTML file
curl --silent --fail https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css > /tmp/gh.css && (
echo '<html><head><link rel="stylesheet" href="/tmp/gh.css"/><style>@page { size: A4 landscape; }</style>
</head><body><div class="markdown-body">' && \
gh api repos/lightbend/scala-team/issues/188 -t '{{.body}}' |
gh api --field text=@- /markdown && \
echo '</div></body></html>' \
) > /tmp/out.html
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-gpu --headless --print-to-pdf-no-header --print-to-pdf=/tmp/out.pdf /tmp/out.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment