A library to parse shortcodes as used in Hugo and Nikola
Go to file
2023-07-11 22:25:57 -03:00
.vscode tweaks 2023-07-10 21:55:45 -03:00
.gitignore gitignore 2023-07-10 22:25:54 -03:00
Makefile Ported to bglibs 2023-07-11 09:58:58 -03:00
README.md README.md 2023-07-11 22:25:57 -03:00
shortcodes.h Initial skeleton of code 2023-07-10 12:51:21 -03:00
shortcodes.rl minor refactor 2023-07-11 22:20:26 -03:00
tests.c Initial skeleton of code 2023-07-10 12:51:21 -03:00
TODO.md todo 2023-07-11 22:22:45 -03:00

Shortcodes

This is a parser for the shortcode spec as explained in the Hugo docs and used in Hugo and Nikola. Approximately.

I am implementing this for Nicolino.

It probably won't be 100% identical, but I'll try to make it as close as practical.

  • Implemented in Ragel + C for performance
  • Allocates no memory, because all strings are references to pieces of input.

What works:

  • Detect shortcodes with names
  • Standalone and matched shortcodes
  • Capture data between tags in matched shortcodes
  • Capture arguments with and without names
  • Capture values with and without quotes (with details, see TODO above)