NurdTurd
(Nurd Turd)
May 27, 2016, 3:18pm
1
I’m fairly sure that Discourse has a syntax highlighter. Now I’ve been thinking for the short time this forum has been up, someone should totally make a syntax definition for Caddy, for Discourse!
I think this would definitely help out on being able to read a Caddyfile.
What do you guys think ?
matt
(Matt Holt)
May 27, 2016, 4:40pm
2
Yes, I think that’d be great. Someone should do it…
If someone can point me towards the docs for whatever Discourse’s syntax highlighter is, I’ll throw something together after dinner.
NurdTurd
(Nurd Turd)
May 28, 2016, 5:11pm
4
I couldn’t find any documentation or forum posts on the Meta forum about syntax highlighting plugins. You would have to go here: https://github.com/discourse/discourse/tree/master/lib/highlight_js/assets/lang
That’s the folder with all the languages it accepts via HighlightJS.
matt
(Matt Holt)
May 28, 2016, 5:46pm
5
If someone implemented Caddyfile syntax for highlight.js, then I’d also be able to use it on the Caddy website (which uses highlight.js).
@matt Got a beer, got the highlight.js and Caddyfile docs, let’s see what I can hack together.
NurdTurd
(Nurd Turd)
May 28, 2016, 6:14pm
7
Awesome! That would be wicked.
DenBeke
(DenBeke)
May 29, 2016, 9:06am
8
Is there somewhere a grammar available for Caddy?
Because what’s a DSL without a grammar?
NurdTurd
(Nurd Turd)
May 29, 2016, 11:57am
9
Not sure. I guess you could take a look at the Caddy documentation and whip up a diagram.
matt
(Matt Holt)
May 29, 2016, 12:17pm
10
Eventually. One thing at a time…
DenBeke
(DenBeke)
May 29, 2016, 12:18pm
11
Maybe I can work a bit on it, that way people writing new middlewares or making configurations can follow the grammar?
DenBeke
(DenBeke)
May 29, 2016, 1:54pm
13
Haha, haven’t done a thing yet… Very busy here right now.
Eeh, bits and bobs. Highlight.js docs aren’t what I’d like them to be, and yesterday I was tearing up carpet all day!