Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddyfile syntax highlighting #338

Closed
francislavoie opened this issue Feb 26, 2020 · 4 comments · Fixed by #363
Closed

Caddyfile syntax highlighting #338

francislavoie opened this issue Feb 26, 2020 · 4 comments · Fixed by #363

Comments

@francislavoie
Copy link
Contributor

francislavoie commented Feb 26, 2020

Caddy supports markdown rendering via Blackfriday, which uses Chroma for syntax highlighting.

I think it would be awesome if Chroma would support a caddyfile lexer so that we can syntax highlight all the examples in the Caddy documentation! It would also mean that the Caddy could syntax highlight its own configuration!

See here for information on the syntax. It's quite simple.

Caddy v1 and Caddy v2 have slightly different syntax, but @mohammed90 found this VS Code syntax for v1 which could be useful as a base reference?

Thanks!

@alecthomas
Copy link
Owner

The linked syntax is a Textmate grammar, so I think a more flexible solution is to add an importer for those.

@alecthomas
Copy link
Owner

I actually played around with this a bit today and had some success, but unfortunately that Textmate syntax is really quite bad. I think Textmate support in general is a good idea, but for this particular syntax it's probably better just to write one from scratch.

@francislavoie
Copy link
Contributor Author

Thanks for looking into it! Let me know if you have any questions regarding the syntax.

@mholt
Copy link

mholt commented Apr 5, 2020

It shouldn't be too hard to write a new one from scratch; the Caddyfile is relatively simple, but there might be a few edge cases that take some time to work out (and that's OK for later too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants