A small library to embed files from public GitHub repos. This library is ideal for people looking to embed files from GitHub into their website.
To start using the library, first include the script and style in your webpage (preferably in the <head>
tag). Note: make sure you change the path to point to the resources from your folder.
<link rel="stylesheet" href="src/PyroGist.css">
<script src="src/PyroGist.js"></script>
Once you have the above tags, you can start by calling PyroGist()
method, passing in the selector of the container you would like to use, as well as the options:
PyroGist("#preview",{
url: "https://github.com/daryl-cecile/Slosh/blob/master/library/defaultStyle.css",
theme: "normal",
autoFit: true,
highlight: true
});
In the example above, theme
, autoFit
and highlight
options are used. However, these are optional.
-
theme
: string [optional]- accepts dark, ultraDark, match, and normal.
Match
will try to match the rest of your page.
-
autoFit
: boolean [optional]- accepts
true
orfalse
. true
will cause the container to resize reasonably if content is too long
- accepts
-
highlight
:boolean [optional]- accepts
true
orfalse
- Uses highlight.js to perform syntax highlighting.
- Will only work if highlight.js has been included into the webpage
- accepts
You can try this out for yourself by cloning this repo and opening the index.html
file in a web browser.
This project makes use of JetBrainsMono, an open source font by JetBrains.