2
{
    "html":{
        "prefix": "html",
        "body": [
          "<!DOCTYPE html>",
          "<html lang='en'>",
          "<head>",
          "<meta charset='UTF-8'>",
          "<link rel='stylesheet' type='text/css' href=' '>",
          "<title>",

          "</title>",       
          "</head>",
          "<body>",

          "</body>",
          "</html>",
        ],
        "description": "html"
   }
}

{
  "css-doodle": {
      "prefix": "css-doodle",
      "body":[ 
          "<script src='https://unpkg.com/[email protected]/css-doodle.min.js'></script>", 
          "<css-doodle>",
          "content" ,
          "</css-doodle>",   
      ],
      "description": "doodle",
  }
}   

so above are the two snippets of html. But the latter one of css-doodle isnt working. Is there some mistake in the code or a specific way separate the two?

1 Answer 1

2

I see it has been 8 months, so putting the answer here for others to come across. Your problem is that you have an end of file bracket after your description, and you are missing a comma. You also have a start of file bracket at the start of your second snippet.

Your code should look as follows:

{
    "html":{
        "prefix": "html",
        "body": [
          "<!DOCTYPE html>",
          "<html lang='en'>",
          "<head>",
          "<meta charset='UTF-8'>",
          "<link rel='stylesheet' type='text/css' href=' '>",
          "<title>",

          "</title>",       
          "</head>",
          "<body>",

          "</body>",
          "</html>",
    ],
    "description": "html"
   },



  "css-doodle": {
      "prefix": "css-doodle",
      "body":[ 
          "<script src='https://unpkg.com/[email protected]/css-doodle.min.js'></script>", 
          "<css-doodle>",
          "content" ,
          "</css-doodle>",   
      ],
      "description": "doodle",
  }
}   

Basically, for each code snipped you want to add, just place a comma after the snippet, and place the end of file bracket just once, at the end of the json. As you can see, subsequent snippets do not have a bracket before their name.

Hope this helps. I know I about tore my hair out trying to figure this out the first time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.