lektor / lektor-website

The main lektor website.
https://www.getlektor.com/
Other
160 stars 134 forks source link

Add example for event `markdown-lexer-config` #245

Open nixjdm opened 6 years ago

nixjdm commented 6 years ago

From @paternal in https://github.com/lektor/lektor/issues/587

According to the documentation event markdown-lexer-config "is where lexer configuration can be set".

However, there is no example, and I could not find anybody using it (see for instance this github search).

I would like to implement a plugin adding a new lexer, but I do not understand how to use this event.

(Note that I could use lektor-shortcodes as a starting point, which I did, but the commit introducing markdown-lexer-config explicitly says that "he new hook is of use to plugins like lektor-shortcodes, which seek to add new lexing rules to the Markdown syntax". So I think there might be a simpler way to do this than to follow lektor-shortcodes way?)

Thanks