Skip to content

Adds a filter to embed Gists from GitHub anywhere in the text on your Backdrop CMS site.

License

Notifications You must be signed in to change notification settings

backdrop-contrib/gist_filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gist Filter

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

  1. From the text format configuration page, you can configure the default display method for each text format.
  2. 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 be https://gist.github.com/yorkshire-pudding/123abc456def7890.
  1. To add a specific file use [gist:123abc456def7890:myfile.sh] or the equivalent with a gistcode, gistlink or gistembed prefix.
  2. 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.
  3. The GitHub Personal Access token, if used, is stored in config. Do not use this if your config is stored in a public repository.
  4. 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

Credits

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.