Reputation: 127
How can I display raw code like this in GitBook?
https://raw.githubusercontent.com/luyongxu/SignalPlot/master/Code/1.016%20Asset%20Bubbles.R
I believe this is related to: Reading code from GitHub as text (raw) in a web page But I don't know how to call the JavaScript function in the main document.
Upvotes: 4
Views: 1461
Reputation: 3711
Just add a book.json
file to your GitBook. Paste this into it:
{
"plugins": ["github-embed"]
}
Now just put something like this in your page:
{% github_embed "https://github.com/v5analytics/gitbook-plugin-github-embed/blob/1cd16ac/index.js#L3-L8" %}{% endgithub_embed %}
It's that simple!
Note: I've got it working locally (using gitbook install
and gitbook serve
), but it's not working for me on GitBooks, so I've filed an issue here and here.
Apologies on behalf of gitbook-plugin-github-embed for their deprecated code!
Upvotes: 1