Callat
Callat

Reputation: 3044

Atom Snippet for HTML doesn't run

I have an html snippet in my snippets.cson file in my atom text editor for windows, it doesn't give me any errors but when I open my index.html file and begin to type the prefix nothing appears.

My expectation is that I should type <!DOC and then see the start page snippet pop up, hitting tab will auto generate my page template.

What am I doing wrong, right now nothing happens.

# Snippet for opening a new html page
 'text.html.basic':
    'start page':
        'prefix': '<!DOC'
        'body': """
            <!DOCTYPE html>
            <html>
                <head>
                    <title></title>
                    <link rel='stylesheet' type = 'text/css' href='css/' />
                </head>
                <body>
                    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
                               integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
                               crossorigin="anonymous"></script>
                    <script src = 'javascript/'></script>
                </body>
             </html>
                """

Upvotes: 1

Views: 333

Answers (1)

Dekel
Dekel

Reputation: 62676

If you want the snippet to be relevant for .html files you should use

.text.html.basic

In the first line (and not .html).

Update from the comments:

Note that you can't use <! in the prefix. You can change the prefix to DOC and it will work.

Upvotes: 1

Related Questions