Roberto Alsina c0f4da86fe return errors from parse()
* Create a sc_result struct that can contain errors as well as the parse results.
* Use sccount to report the found shortcodes instead of checking values
* Various Makefile and test-running fixes

Reviewed-on: #1
Co-authored-by: Roberto Alsina <roberto.alsina@gmail.com>
Co-committed-by: Roberto Alsina <roberto.alsina@gmail.com>
2023-07-13 22:05:11 -03:00
meh
2023-07-12 17:30:41 -03:00
2023-07-13 22:05:11 -03:00
2023-07-13 22:05:11 -03:00
2023-07-11 22:25:57 -03:00
2023-07-13 22:05:11 -03:00
2023-07-13 22:05:11 -03:00
2023-07-13 22:05:11 -03:00
2023-07-13 22:05:11 -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)
Description
A library to parse shortcodes as used in Hugo and Nikola
Readme 235 KiB
Languages
C 88.1%
Crystal 8.2%
Ragel 3.6%
Makefile 0.1%