The patch D25540 tried to implement a nice a "Remarkup" rule (that is, "our Markdown") to create a small code block to show a color code, and render it with its color.
Unfortunately, this patch worked only in unit tests, and not in Remarkup.
{rP4d12d014fd9ddc423ecbc6a61a92217d5aff19a4}
At the moment this feature is indicated as experimental and not working in the related changelog in [[ changelog/2024.19/ ]].
What to do?
We have maybe some minutes to think about next steps.
== Color Syntax from GitLab, GitHub, ... ==
Premising that Phorge does not necessarily want to give support to features from other platforms (because we think that Remarkup is superior bla bla)... it's wise to at least have awareness of other similar platforms.
In **GitHub** and **GitLab** this feature is provided using just simple backticks:
`#0969DA`
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#supported-color-models
https://docs.gitlab.com/ee/user/markdown.html#colors
So, in GitHub and GitLab this create a colorized code-block. This syntax would make sense also for Phorge and we should consider it.
== Proposed Color Syntax in Phorge ==
At the moment this was the proposed syntax in Phorge (so, with brackets, not backticks):
{#0969DA}
Note again that the above syntax does not work at the moment. Don't try it :)
Questions:
=== Q1: Whenever desired or not, is Phorge technically able to implement this feature __with backticks__ just like other major platforms? ===
NOTE: Nobody tried this ๐ Stub patch welcome to show a proof of concept! If you would like to, set your name here: ....
โ
Probably implementing this feature with just backticks is possible, to enable an easy transition with GitLab and GitHub (also, just mental transition). Maybe we can "just" try to expand `PhutilRemarkupMonospaceRule` that implements the backtick things.
โ
Or, probably, somebody may try to implement this without ever changing the backend, and just adding a new JavaScript rule.
...
=== Q2: Anyway, would we like to consider the backtick syntax, if ever technically possible? ===
NOTE: The question is NOT about Mermaid.js or other Markdown estensions that may be nonsense. This question is only about this colorized inline syntax, that may have sense.
โ
since this syntax is proposed to just introduce a colorized inline code, yes, it MAY semantically make sense to just adopt the backtick syntax.
๐ถ we may want to consider the syntax `color { #f00 }` (just like we have `cowsay { bla bla }` or `figlet { bla bla }`) since this syntax will very-probably be super-stable and will work immediately without surprises. But, Valerio proposed this as "last desperate plan" if we are not able to implement backticks :D
๐ถ worst case: if we adopt this backtick syntax, some things may become colorized. Anyway, if an use will see `#f00` in red instead of gray is perhaps not such an interesting "breaking change" :D so, "coloring backticks" may be still super OK.
...
== Until it does not work ๐ค ==
1. Answering Q1 about "are backticks possible"?
2. Answering Q2 about "anyway, do we like backticks"?
3. if answers are "yes", re-adapt 4d12d014fd9ddc423ecbc6a61a92217d5aff19a4 if answers are "no", fix that
- anyway, let's ship this with some nice lovely documentation like in D25607