lektor / lektor-website

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

Hidden icon options for Models and Flows #295

Open fmerges opened 4 years ago

fmerges commented 4 years ago

An undocumented but nice feature for addon labels on Models and button labels of Flows.

xlotlu commented 4 years ago

@fmerges I haven't tested this, bot looking at the code

    const iconData = label.match(/^\[\[\s*(.*?)\s*(;\s*(.*?))?\s*\]\]$/)

to be considered an icon that has to be enclosed in [[ double square brackets ]]. There is also another optional parameter separated by a semicolon, that provides for rotation.

Given the amount of text needed, I'd leave the original paragraph in docs/models/contents.lr as is, and start after it with something like, "If this string is enclosed in double square brackets, it is considered to be the name for a fa-icon ... etc.". An example would be nice too.