Special inline commands

AI-generated summary

The discussion on Special inline commands began with hellekin suggesting the addition of custom markup extensions to Discourse, similar to those found on Gitlab, such as /shrug that turns into ¯\_(ツ)_/¯. They proposed examples of custom commands like RFC:2324 and ISBN:9780141036144 that could auto-link to specific websites.

Stephen clarified that these would be more like shortcuts than commands, being parsed when the post is produced. hellekin envisioned the preview including the rich version of the parsed text.

sam pointed out that these custom commands are already possible using the Linkify words in post plugin, which danekhollas enhanced with regex support. danekhollas shared their experience using this feature to autolinkify JIRA tickets and suggested autolinkifying DOIs as another example.

Continuing the discussion from "Looks like you’re enjoying the discussion":

I was just visiting Quick actions · Project · User · Help · GitLab and thought it would be a nice feature to have such markup extensions to Discourse. There’s a /shrug command on Gitlab that turns into ¯\_(ツ)_/¯

Custom commands could be set for inline interpretation, e.g.:

These sound more like shortcuts than commands. They’re not executing code directly, just being parsed when the baked post is produced. Or are you suggesting that the preview includes the rich version of the parsed text?

Both of these are 100% doable today with

@danekhollas added regex support

6 Likes

Yep. We’re using the theme to autolinkify JIRA tickets. Another fun example would be to autolinkify DOIs.

3 Likes

Great! I love it when the job is already done. :smile:

2 Likes