ERB vs EMBEDDED_TEMPLATE heredocs #1875
Unanswered
powersurge360
asked this question in
General
Replies: 1 comment
-
Hey @powersurge360, thanks for asking about this and for your willingness to dig in. The docsite is generated by Jekyll, which uses the rouge gem by default. I just had a look at rouge's Ruby lexer and I don't see anything in there for syntax highlighting heredocs. It looks like it's possible to compose lexers together though. Check out how the ERB lexer does it here. Good luck! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all! I noticed in the docs the use of
<<-ERB
heredocs, which don't seem to support syntax highlighting within the heredoc. I know that in VSCode you can get syntax highlighting in a heredoc but I'm not 100% sure if it works for ERB. What I do know is that in neovim if you use<<-EMBEDDED_TEMPLATE
instead, it gives ERB syntax highlighting. Does that work in VSCode? Any other editors? If the functionality is widespread it might be worth suggesting that rather than ERB for convenience.I did some looking and I can't figure out which plugin is managing the syntax highlighting (I use the lunar vim distribution) but I suspect it's probably tree sitter. I wonder if it would be possible to get ERB aliased somehow in those plugins for a tidier experience.
Beta Was this translation helpful? Give feedback.
All reactions