github-code

github-code.js

Embed a small, unhighlighted slice of a GitHub file from a regular github.com URL with a line fragment. The demo URL is saved in this page’s fragment, so bookmarked examples reopen the same code.

<script type="module" src="./github-code.js"></script>
<github-code href="https://github.com/simonw/tools/blob/c0f6ad090bce269251e21d98457cfe1a32fc0a19/build_index.py#L33-L54"></github-code>