local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local fmt = require("luasnip.extras.fmt").fmt

return {
  s("!", {
    t("<!DOCTYPE html>"),
    t({"", "<html lang=\""}), i(1, "en"), t({"\" >", ""}),
    t({"<head>", ""}),
    t({"  <meta charset=\"UTF-8\">", ""}),
    t({"  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">", ""}),
    t({"  <title>"}), i(2, "Document"), t({"</title>", ""}),
    t({"</head>", ""}),
    t({"<body>", ""}),
    i(0),
    t({"", "</body>", ""}),
    t({"</html>"})
  }),

  -- Alternative version using fmt for cleaner formatting
  s("!html", fmt([[
<!DOCTYPE html>
<html lang="{}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{}</title>
</head>
<body>
    {}
</body>
</html>
  ]], {
    i(1, "en"),
    i(2, "Document"),
    i(0)
  }))
}
