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.
rP4d12d014fd9d: Add PhutilRemarkupHexColorCodeRule, a new remarkup rule to format color codes
At the moment this feature is indicated as experimental and not working in the related changelog in 2024 week 19. See D25540.
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.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?
✅ 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?
✅ 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 🤔
- Answering Q1 about "are backticks possible"?
- Answering Q2 about "anyway, do we like backticks"?
- 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