davidrios / pug-tmbundle

A comprehensive textmate / sublime text bundle for the Pug (formerly Jade) template language.
https://github.com/davidrios/pug-tmbundle
MIT License
48 stars 20 forks source link

Highlight in context #14

Closed undercloud closed 7 years ago

undercloud commented 7 years ago

Please add feature use syntax highlight outside of *.pug files?

I wish:

<?php

class Page
{
    public function render()
    {
        return (
            // @pug-annotation
            '!!!
                html
                    div.class Hello
                    span#id(attr="value") Pug'
        );
    }
}
luxlogica commented 7 years ago

@undercloud the problem in your example may be with the PHP syntax highlighter, not Pug's - that is, the highlighter that is 'in charge' of the file overall is the PHP highlighter, as this is a .php file, not a .pug. If you want the PHP highlighter to "see" embedded snippets of other languages, then it needs to know to "look for" them. This may be a feature that needs to be asked of the guys developing the PHP syntax highlighter.

Also, I believe that !!! is probably HAML syntax, not Pug. To add a doctype declaration in Pug you'd use doctype html, like this:

doctype html
html
    head
        title Hello Pug
    body
        div.my-class
            span#my-id(data-attr="somevalue") Hello Pug
undercloud commented 7 years ago

ok) thx!