Gist Filter allows gists from Github to be embedded anywhere in the text using
a token format to embed as either a link, a 'code' block or embedded using one
of a range of themes.
Installation
- Install this module using the official Backdrop CMS instructions at
https://docs.backdropcms.org/documentation/extend-with-modules. - Enable the Gist Filter in each text format where you want to use it.
- In the order of filters (weight) within each text format you use it, Gist
Filter must come BEFORE
Token Filter and AFTER 'Limit
allowed HTML tags'. The module will attempt to set this but double check this
if you run into problems.
Usage
- From the text format configuration page, you can configure the default
display method for each text format. - Within text using a filtered format where the filter is enabled, use the
following patterns:
[gist:123abc456def7890]
- use the default display method.[gistcode:123abc456def7890]
- embed the gist within<code>
blocks.[gistlink:123abc456def7890]
- embed the gist as a link.[gistembed:123abc456def7890]
- embed the gist using a script.
The gist ID is the string after the gist owner. For the examples above the gist
URL might behttps://gist.github.com/yorkshire-pudding/123abc456def7890
.
- To add a specific file use
[gist:123abc456def7890:myfile.sh]
or the
equivalent with agistcode
,gistlink
orgistembed
prefix. - Go to
/admin/config/content/gist-filter
where you can select a theme for
the embed display (you will need to clear the page cache to apply a change
here), and also add a GitHub Personal Access token to give your site a higher
limit for retrieving gists. - The GitHub Personal Access token, if used, is stored in config. Do not use
this if your config is stored in a public repository. - Clearing the 'Page and else' cache may be necessary to see the effects of a
change.
For further information, please visit the Wiki.
Issues
Bugs and Feature Requests should be reported in the Issue Queue:
https://github.com/backdrop-contrib/gist_filter/issues.
Current Maintainers
- Martin Price - System Horizons
- Collaboration and co-maintainers welcome!
Credits
- Ported to Backdrop CMS by - Martin Price - System Horizons.
- Port sponsored by System Horizons.
- Originally written for Drupal by Jake Bell
- Incorporating several patches by various authors from the Drupal issue queue.
- Gist Embed themes by Will Boyd
License
This project is GPL v2 software.
See the LICENSE.txt file in this directory for complete text.