Oembed Proxy for GitHub makes it possible to embed source files from GithHub in services that support Oembed standard.
I made it so that I can include source files from GitHub in Notion pages. It should work for other services that support Oembed.
To embed https://github.com/kjk/blog/blob/master/util.go
source file pass it as url
query argument to
https://blog.kowalczyk.info/gitoembed/widget/
,
creating oembed URL https://blog.kowalczyk.info/gitoembed/widget?url=https%3A%2F%2Fgithub.com%2Fkjk%2Fblog%2Fblob%2Fmaster%2Futil.go.
To modify how code is rendered you can append URL query parameters:
?nolines
: disable line numbers?theme=${theme}
: select a code highlighting themeAvailable themes: abap, algol, algol_nu, arduino, autumn, borland, bw, colorful, dracula, emacs, friendly, fruity, github, igor, lovelace, manni, monokai, monokailight, murphy, native, paraiso-dark, paraiso-light, pastie, perldoc, pygments, rainbow_dash, rrt, solarized-dark, solarized-dark256, solarized-light, swapoff, tango, trac vim, vs, xcode
Example: ?nolines&theme=github
Put GitHub URL of the file (try:
https://github.com/kjk/blog/blob/master/util.go
)
You can test oembed url at oEmbed Tester