Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Emmet for ST2: html:5 abbreviation head

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41938
    markthema3
    Participant

    Is there a way to put things in the head element when using the
    html:5
    abbreviation? putting things into the body is as easy as html:5>(insert body markup), how do I put stuff into the head, like links to stylesheets and scripts within that same expression?

    #120703
    Andy Howells
    Participant

    Hmm. I tried a few variations but couldn’t come up with one myself.

    What you could do is create your own snippet within Sublime’s standard snippets functionality. So you could do your own custom shortcut, like html5x for example.

    #120704
    markthema3
    Participant

    I think I’ll going to set it to html:5(head elements)>(body elements), if I can figure out how.

    #120723
    markthema3
    Participant

    I edited Emmet.sublime-settings snippets as shown here.

    So now I can add a document title, stylesheet, and script within the expression as follows:


    html:5[title="My Webpage"][style=mystylesheet.css][script=myscript.js]

    While adding this functionality, I discovered that I can use “!” instead of “html:5”, so it also works like this:


    ![title="My Webpage"][style=mystylesheet.css][script=myscript.js]

    Hopefully this will be of use to others.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.