Skip to content

Grow-extension allowing markdown documents to have BBCode styled shortcodes with transforms instead of {% callouts %}

License

Notifications You must be signed in to change notification settings

jungvonmatt/grow-ext-shortcodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grow-ext-shortcodes

Extension for Grow allowing markdown documents to have BBCode styled shortcodes to be a bit more flexible and consistent with the default markdown syntax rather than having to fallback to {% callouts %}.

Concept

The extension works by looking for a shortcodes Python package inside your Grow pod. All contained modules get automatically imported and are searched for a module-level variable shortcode which should hold a class that is inheriting from shortcodes.Shortcode just like this:

from shortcodes import Shortcode

class StageShortcode(Shortcode):
    name = 'stage'
    prerender_markdown = True
    template = 'partials/stage.j2'

shortcode = StageShortcode

Please see shortcodes.Shortcode or one of the examples for all the available hooks and functions.

Usage

Initial setup

  1. Create an extensions.txt file within your pod.
  2. Add to the file: git+git://github.com/jungvonmatt/grow-ext-shortcodes
  3. Run grow install.
  4. Add the following section to podspec.yaml:
ext:
- extensions.shortcodes.ShortcodesExtension

About

Grow-extension allowing markdown documents to have BBCode styled shortcodes with transforms instead of {% callouts %}

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published