I only ask be cause my SE app on my phone colorizes Twig syntax nicely, and I think that it would probably be a good idea to turn it on the main website if possible.
1 Answer
Done.
For now, I've enabled this for twig, template and php. It can be expanded to more tags if need-be, or even enabled for all tags by default.
Note that you can trigger highlighting for any code block regardless of tag by using the formatting hints.
-
-
3Thanks for turning this on. In case it helps anyone, the snippet to use to trigger Twig syntax highlighting on a code block is
<!-- language: lang-twig -->
Commented Jun 23, 2014 at 13:45 -
1
-
If you think it should be enabled globally, propose a separate feature-request, @Alex - there are some sanity-checks y'all will want to perform first, most notably making sure that this isn't going to screw up existing posts or catch new users unaware.– Shog9Commented Jul 12, 2014 at 3:10
-
Thanks @Shog9. I actually don't anymore having seen the Twig formatting applied to some non-twig code. Probably best to be triggered manually. Commented Jul 14, 2014 at 1:44
-
Hi @Shog9... There has been some confusion regarding the Twig syntax highlighting on the Craft SE site. I've been investigating this thoroughly, and it doesn't look like Google Code Prettify supports Twig... Can you please clarify how (or if) you were able to specify Twig syntax highlighting for "twig" tags?– Lindsey D ModCommented Jul 29, 2014 at 17:06
-
@AlexKendrick, you give an example of specifying Twig for a code block (
lang-twig
)... Did you see that referenced somewhere specifically, or did you infer it from the general markup structure?– Lindsey D ModCommented Jul 29, 2014 at 21:00 -
If memory serves, I inferred it from this post: meta.stackexchange.com/questions/184108/… Commented Jul 29, 2014 at 21:46
-
1