{
  "schema": 1,
  "id": "addon.nvh-markdown",
  "name": "nvh-markdown",
  "version": "1.0.0",
  "category": "language",
  "description": "Novus nvh-markdown: .nvmd highlighting (Markdown, frontmatter, <?nv ?> header, {expr}, template blocks, components, containers), snippets, a project template and commands for the .nvmd to .nvh generator.",
  "author": "Lumen",
  "icon": "Nm",
  "color": "#7c5cff",
  "license": "MIT",
  "minAppVersion": "0.7.0",
  "keywords": [
    "novus",
    "nvh",
    "markdown",
    "nvmd"
  ],
  "readme": "# nvh-markdown\n\nSupport for [nvh-markdown](https://github.com/ezTxmMC/nvh-markdown), the Markdown library of\n[Novus](https://github.com/ezTxmMC/novus): the `.nvmd` language (Markdown with Novus in it, like\n`.mdx` with JSX) and the generator that turns `Page.nvmd` into `Page.nvh`.\n\n## What it does\n\n- **Language `.nvmd`** with its own highlighting: Markdown (headings, emphasis, code spans,\n  fences coloured per language, links, lists, tables, task lists, block quotes), `:::note|tip|warning|danger`\n  containers, the `---` frontmatter, the `<?nv ... ?>` header as Novus, `{expr}`,\n  `{#if}` / `{:else}` / `{/if}`, `{#for}` / `{/for}`, `{@html}` and `<Component>` tags. Braces in code\n  spans and fences stay plain, as in the generator.\n- **Commands** (command palette, category *nvh-markdown*): generate the `.nvh` of the open file,\n  generate all `.nvmd` of the project, show the generated `.nvh`, generate and check the program,\n  watch in a terminal, remove the generated files. They run `novusc run nvmd.nv ...`.\n- **Settings**: path of `novusc`, the generator's `nvmd.nv` (found automatically in `nvh-markdown/` in or\n  next to the project, in the `replace` target of `project.nv`, or in the copy `novusc deps` fetched into\n  `~/.novus/deps`), content folders, main file for *check*, `--force`, *generate on save* and\n  *check while typing*.\n- **Problems**: generator errors (`error: file:line: message`) show up as problems of the `.nvmd` file —\n  after a generate/check run, and live with *Check while typing*.\n- **Snippets**: containers, `<Callout>`, `<CodeBlock>`, `<Toc>`, `<Markdown>`, frontmatter, `<?nv ?>` header with\n  `prop` and import, `{#if}`, `{#for}`, `{@html}`, table, task list and code fences per language.\n- **Project template** *nvh-markdown page* (`project.nv` with the `require`, `main.nv`, `Page.nvmd`,\n  a `Callout` component) and a project kind that recognises a `project.nv` requiring nvh-markdown.\n- **A docs page** with the dialect, the `markdown.*` API and the `.nvmd` syntax.\n\n## What it does not do\n\n- No language server: `novus-lsp` serves `.nv` and `.nvh`, not `.nvmd`.\n- No output folder setting: the generator writes each `.nvh` next to its `.nvmd`.\n- The highlighting is a tokenizer built into Lumen (`nvmd`), not shipped by this add-on.\n- The project kind's tasks are `novusc run`, `check` and `deps`; generating goes through the commands,\n  because where `nvmd.nv` lives depends on the project.\n\nNeeds `novusc` and, for the commands, a Lumen that supports add-on code (it asks before running it).\n\n## Building\n\n```sh\nnode addons/build.mjs nvh-markdown\n```\n",
  "settings": [
    {
      "key": "novusc",
      "label": "novusc path",
      "type": "text",
      "default": "novusc",
      "placeholder": "novusc",
      "section": "Generator",
      "hint": "The Novus compiler that runs the generator."
    },
    {
      "key": "generator",
      "label": "Generator (nvmd.nv)",
      "type": "path",
      "pathKind": "file",
      "default": "",
      "section": "Generator",
      "hint": "Empty: nvh-markdown/nvmd.nv in or next to the project, the target of its replace line, or the copy fetched by novusc deps (~/.novus/deps)."
    },
    {
      "key": "folders",
      "label": "Content folders",
      "type": "text",
      "default": ".",
      "placeholder": "content, docs",
      "section": "Generator",
      "hint": "Comma-separated folders or files that Generate all, Clean, Watch and Check work on, relative to the project."
    },
    {
      "key": "main",
      "label": "Main file for Check",
      "type": "text",
      "default": "main.nv",
      "section": "Generator",
      "hint": "The program that Check hands to novusc check after generating."
    },
    {
      "key": "force",
      "label": "Regenerate everything",
      "type": "toggle",
      "default": "false",
      "section": "Generator",
      "hint": "Passes --force: write every .nvh, not only what changed."
    },
    {
      "key": "generateOnSave",
      "label": "Generate on save",
      "type": "toggle",
      "default": "false",
      "section": "Automation",
      "hint": "Writes the .nvh next to a .nvmd file each time it is saved."
    },
    {
      "key": "liveCheck",
      "label": "Check while typing",
      "type": "toggle",
      "default": "false",
      "section": "Automation",
      "hint": "Translates the text of the open .nvmd file after each pause and shows generator errors as problems. Starts novusc each time."
    }
  ],
  "pages": [
    {
      "id": "nvh-markdown",
      "title": "nvh-markdown",
      "icon": "book-open",
      "location": "editor",
      "format": "markdown",
      "content": "# nvh-markdown\n\n[nvh-markdown](https://github.com/ezTxmMC/nvh-markdown) is Markdown for\n[Novus](https://github.com/ezTxmMC/novus) and nvh: a Markdown renderer written in\nNovus, a few nvh components and the generator for `.nvmd` files — Markdown with\nNovus in it, the way `.mdx` is Markdown with JSX.\n\n## Setup\n\nIn the `project.nv` of the project:\n\n```\nrequire \"github.com/ezTxmMC/nvh-markdown\" \"latest\"\nreplace \"github.com/ezTxmMC/nvh-markdown\" \"../nvh-markdown\"     // a local checkout, optional\n```\n\n```nv\nimport \"github.com/ezTxmMC/nvh-markdown/markdown\"       // markdown.render(...)\nimport \"github.com/ezTxmMC/nvh-markdown/components\"     // Callout, CodeBlock, Toc, Markdown\n```\n\nA project with `.nvmd` files needs the `require` and the generator. The compiler\nitself knows nothing about `.nvmd`: `novusc` reads `.nv` and `.nvh` only, so the\ngenerator writes `Page.nvh` next to every `Page.nvmd` before the compiler runs.\n\n## The `.nvmd` format\n\nA `.nvmd` file is a component like a `.nvh` file.\n\n1. **Frontmatter** (optional, first line): `---`, `key: value` lines, `---`. Every key\n   made of `[A-Za-z0-9_]` becomes `prop string key = \"value\"`, so `{key}` works and a\n   parent can override it.\n2. **Header** `<?nv ... ?>` (optional, right after the frontmatter): imports,\n   `prop`/`ref`, methods, defines — exactly the header of a `.nvh` file. The closing\n   `?>` stands on a line of its own.\n3. **Body**: Markdown with these Novus constructs:\n   - `{expr}` anywhere in Markdown text: the HTML-escaped value. `\\{` and `\\}` are\n     literal braces; braces in fenced code and code spans are always literal.\n   - alone on their line: `{#if c}`, `{:else if c}`, `{:else}`, `{/if}`,\n     `{#for x in xs}`, `{#for x, i in xs}`, `{/for}`, `{@html expr}`, `<?nv ... ?>`.\n   - components: a tag starting with an upper-case letter, with nvh attributes\n     (`prop={x}`, `@event=\"handler\"`), either `<Name>` ... `</Name>` on lines of\n     their own (children are Markdown) or self closing `<Name ... />`.\n   - lower-case HTML tags are raw HTML. A block with a handler (`@click=`, `bind=`,\n     `class:x={...}`) is nvh, not Markdown, and runs to the next blank line.\n\nThe generated file has the same lines as the source, so an error of the compiler\npoints at the right line of the `.nvmd`. A generated file starts with\n`<?nv /* nvmd-generated */`; the generator never overwrites or removes a `.nvh`\nwithout that mark. Put the generated `*.nvh` into `.gitignore`.\n\n## The generator\n\n```sh\nnovusc run nvh-markdown/nvmd.nv build content        # only what changed (--force: all)\nnovusc run nvh-markdown/nvmd.nv watch content        # rebuild while you write\nnovusc run nvh-markdown/nvmd.nv translate Page.nvmd  # print the .nvh of one file\nnovusc run nvh-markdown/nvmd.nv clean content        # remove the generated files\nnovusc run nvh-markdown/nvmd.nv check content --main main.nv\n```\n\n`check` builds, runs `novusc check` and names the `.nvmd` lines of its errors. Translation\nerrors are printed as `error: file:line: message` and end the program with exit code 1.\nFrom a program: `nvmd.translate(source, \"Page.nvmd\")`, `nvmd.build([\"content\"], false)`,\n`nvmd.watch([\"content\"])`, `nvmd.clean([\"content\"])` after\n`import \"github.com/ezTxmMC/nvh-markdown/nvmd\"`.\n\n## The `markdown` package\n\n```\nmarkdown.render(string source): string                     Markdown -> HTML\nmarkdown.fill(string html, array values): string           markers of .nvmd -> escaped values\nmarkdown.frontmatter(string source): map<string, string>   the key: value pairs between the --- lines\nmarkdown.body(string source): string                       the source without its frontmatter\nmarkdown.headings(string source): array<Heading>           level, id, text of every heading\nmarkdown.slug(string text): string                         \"Hello, World!\" -> \"hello-world\"\nmarkdown.highlight(string language, string code): string   HTML with <span class=\"tok-...\">\nmarkdown.text(string source): string                       plain text, for a search index\n```\n\n`Heading` has the fields `level` (1-6), `id` and `text`. A heading that is only `{expr}`\nhas no text to take the id from: name it with a trailing `{#id}` (`# {title} {#intro}`).\n\n## Dialect\n\nCommonMark core (ATX and setext headings, paragraphs, emphasis, code spans, fenced and\nindented code, block quotes, nested lists, links, images, reference links, autolinks, hard\nbreaks, HTML blocks and inline HTML) plus GFM tables with alignment, task lists,\n`~~strikethrough~~` and bare `http(s)://` links, plus containers:\n\n```\n:::note Optional title\ntext, **Markdown**\n:::\n```\n\n(`note`, `tip`, `warning`, `danger`). Raw HTML is passed through for the usual tags;\n`<script>`, `<style>` and unknown tags are shown as text, and `javascript:` links become `#`.\n\nThe output is plain semantic HTML with stable class names, so any CSS — Tailwind included —\ncan style it: `heading-anchor`, `code-block` (with `data-language`), `callout callout-<kind>`,\n`callout-title`, `table-wrapper`, `task-list-item`, and for highlighted code `tok-kw`, `tok-str`,\n`tok-num`, `tok-com`, `tok-fn`, `tok-type`, `tok-op`, `tok-punct`. Highlighted languages: `nv`,\n`nvh`/`html`, `sh`, `json`, `c`, `js`/`ts`, `toml`, `yaml`; any other language is only escaped.\n\n## Components\n\n| Component | Props | Output |\n| --- | --- | --- |\n| `Callout` | `type` (`note`), `title` | `<aside class=\"callout callout-{type}\">` around its slot |\n| `CodeBlock` | `code`, `language` | a highlighted `<pre class=\"code-block\">` |\n| `Toc` | `headings`, `minLevel` (2), `maxLevel` (3) | a `<nav class=\"toc\">` list of anchors |\n| `Markdown` | `source` | renders Markdown at run time |\n\nThey carry no styling of their own.\n\n## In Lumen\n\n| Command | What it runs |\n| --- | --- |\n| nvmd: Generate .nvh for this file | `build <file>` |\n| nvmd: Generate all .nvmd in the project | `build <content folders>` |\n| nvmd: Show the generated .nvh of this file | `translate <file>`, opened as a read-only tab |\n| nvmd: Generate and check the program | `check <content folders> --main <main>` |\n| nvmd: Watch and regenerate in a terminal | `watch <content folders>` |\n| nvmd: Remove generated .nvh files | `clean <content folders>` |\n\nThe settings under *Extensions → nvh-markdown* name the `novusc` program, the generator's\n`nvmd.nv`, the content folders and the main file, and switch *Generate on save* and\n*Check while typing* on."
    }
  ],
  "agents": [],
  "views": [],
  "commands": [
    {
      "id": "generate-file",
      "title": "nvmd: Generate .nvh for this file",
      "category": "nvh-markdown"
    },
    {
      "id": "generate-all",
      "title": "nvmd: Generate all .nvmd in the project",
      "category": "nvh-markdown"
    },
    {
      "id": "translate",
      "title": "nvmd: Show the generated .nvh of this file",
      "category": "nvh-markdown"
    },
    {
      "id": "check",
      "title": "nvmd: Generate and check the program",
      "category": "nvh-markdown"
    },
    {
      "id": "watch",
      "title": "nvmd: Watch and regenerate in a terminal",
      "category": "nvh-markdown"
    },
    {
      "id": "clean",
      "title": "nvmd: Remove generated .nvh files",
      "category": "nvh-markdown"
    }
  ],
  "code": {
    "main": "import { createRequire as __lumenRequire } from 'node:module'; const require = __lumenRequire(import.meta.url);\nimport h from\"node:fs/promises\";import T from\"node:os\";import c from\"node:path\";var C=\"nvmd.nv\",$=/^error: (.+?):(\\d+): (.*)$/,P=c.join(\"github.com\",\"ezTxmMC\");async function S(n){return h.access(n).then(()=>!0,()=>!1)}async function _(n){let u=await h.readFile(c.join(n,\"project.nv\"),\"utf8\").catch(()=>\"\"),s=[];for(let f of u.matchAll(/^replace\\s+\"github\\.com\\/ezTxmMC\\/nvh-markdown\"\\s+\"([^\"]+)\"/gm))s.push(c.resolve(n,f[1]));return s}async function G(){let n=c.join(process.env.NOVUS_DEPS||c.join(T.homedir(),\".novus\",\"deps\"),P),s=(await h.readdir(n).catch(()=>[])).filter(i=>i.startsWith(\"nvh-markdown@\"));return(await Promise.all(s.map(async i=>{let l=await h.stat(c.join(n,i)).catch(()=>null);return{dir:c.join(n,i),time:l?l.mtimeMs:0}}))).sort((i,l)=>l.time-i.time).map(i=>i.dir)}async function g(n,u){let s=(u??\"\").trim();if(s)return c.resolve(n??process.cwd(),s);let f=[...n?[c.join(n,\"nvh-markdown\"),c.join(n,\"..\",\"nvh-markdown\")]:[],...n?await _(n):[],...await G()];for(let i of f){let l=c.join(i,C);if(await S(l))return l}return null}function b(n,u){let s=new Map;for(let f of n.split(/\\r?\\n/)){let i=$.exec(f.trim());if(!i)continue;let l=c.resolve(u,i[1]),d=s.get(l)??[];d.push({line:Math.max(0,Number(i[2])-1),column:0,severity:\"error\",message:i[3],source:\"nvh-markdown\"}),s.set(l,d)}return s}function L(n){let u=new Map,s=t=>n.settings.get(t)??\"\",f=()=>s(\"novusc\").trim()||\"novusc\",i=()=>n.workspace.root(),l=()=>{let t=n.events.last(\"activeFile\")?.path;return t&&t.endsWith(\".nvmd\")?t:null},d=()=>s(\"folders\").split(\",\").map(t=>t.trim()).filter(Boolean);async function p(t,e={}){let r=i();if(!r)return n.ui.notify(\"Open a project folder first.\",\"warning\"),null;let a=await g(r,s(\"generator\"));if(!a)return n.ui.notify('nvh-markdown was not found. Run \"novusc deps\" in the project or set its nvmd.nv in the settings.',\"warning\"),null;try{let o=await n.exec(f(),[\"run\",a,...t],{cwd:r,timeoutMs:e.timeoutMs});return{cwd:r,script:a,result:o,output:`${o.stdout}\n${o.stderr}`}}catch(o){return n.ui.notify(`${f()} could not be started: ${o.message}`,\"error\"),null}}function w(t,e){let r=b(t.output,t.cwd);for(let a of e)u.delete(a);for(let[a,o]of r)u.set(a,o);return[...r.values()].reduce((a,o)=>a+o.length,0)}async function y(t,e,r){let a=[\"build\",...t];s(\"force\")===\"true\"&&a.push(\"--force\");let o=await p(a);if(!o)return;let m=w(o,e);if(o.result.code===0){n.ui.notify(`${r}: ${o.stdout.trim().split(/\\r?\\n/).pop()||\"done\"}`,\"success\"),n.ui.refreshProject();return}let k=(o.output.split(/\\r?\\n/).find(v=>$.test(v.trim()))??o.output.trim()).slice(0,300);n.ui.notify(`${r} failed (${m||\"no\"} problems): ${k}`,\"error\")}async function j(t){let e=t??l();if(!e){n.ui.notify(\"The active file is not a .nvmd file.\",\"warning\");return}await y([e],[e],\"Generate .nvh\")}async function M(){if(!i()){n.ui.notify(\"Open a project folder first.\",\"warning\");return}let e=d();await y(e.length?e:[\".\"],[...u.keys()],\"Generate all .nvmd\")}async function R(){let t=l();if(!t){n.ui.notify(\"The active file is not a .nvmd file.\",\"warning\");return}let e=await p([\"translate\",t]);if(e){if(w(e,[t]),e.result.code!==0){n.ui.notify(`Translation failed: ${e.output.trim().slice(0,300)}`,\"error\");return}n.ui.openDocument(`${c.basename(t,\".nvmd\")}.nvh`,e.result.stdout,\"nvh\")}}async function E(){let t=d();if(!await n.ui.confirm(\"Remove generated files\",`Remove the .nvh files generated from .nvmd in ${(t.length?t:[\".\"]).join(\", \")}?`,{danger:!0,confirmLabel:\"Remove\"}))return;let r=await p([\"clean\",...t.length?t:[\".\"]]);r&&(n.ui.notify(r.result.code===0?r.stdout.trim():r.output.trim().slice(0,300),r.result.code===0?\"success\":\"error\"),n.ui.refreshProject())}async function F(){let t=d(),e=[\"check\",...t.length?t:[\".\"],\"--main\",s(\"main\").trim()||\"main.nv\",\"--novusc\",f()],r=await p(e,{timeoutMs:3e5});if(!r)return;let a=w(r,[...u.keys()]);n.ui.notify(r.result.code===0?\"No problems found.\":`${a} problems found.`,r.result.code===0?\"success\":\"error\")}async function N(){let t=i(),e=t?await g(t,s(\"generator\")):null;if(!e){n.ui.notify('nvh-markdown was not found. Run \"novusc deps\" in the project or set its nvmd.nv in the settings.',\"warning\");return}let r=d(),a=[f(),\"run\",e,\"watch\",...r.length?r:[\".\"]].map(o=>JSON.stringify(o));n.ui.runInTerminal(a.join(\" \"),{cwd:t,title:\"nvmd watch\"})}n.commands.register(\"generate-file\",t=>j(typeof t==\"string\"?t:void 0)),n.commands.register(\"generate-all\",M),n.commands.register(\"translate\",R),n.commands.register(\"clean\",E),n.commands.register(\"check\",F),n.commands.register(\"watch\",N),n.events.on(\"fileSaved\",t=>{s(\"generateOnSave\")!==\"true\"||!t.path.endsWith(\".nvmd\")||j(t.path)});async function O(t){let e=i(),r=e?await g(e,s(\"generator\")):null;if(!r)return null;let a=await n.storage.dir(),o=c.join(a,\"check.nvmd\");await h.writeFile(o,t,\"utf8\");let m=await n.exec(f(),[\"run\",r,\"translate\",o],{cwd:e,timeoutMs:6e4}).catch(()=>null);if(!m)return null;let v=b(`${m.stdout}\n${m.stderr}`,e).get(o);return v||(m.code===0?[]:null)}return n.diagnostics.register(\"nvmd\",{supports:({languageId:t})=>t===\"nvmd\",async check({path:t,text:e}){if(s(\"liveCheck\")===\"true\"){let r=await O(e);if(r)return r}return t?u.get(t)??[]:[]}}),()=>{u=new Map}}export{L as activate,g as findGenerator,b as parseErrors};\n"
  },
  "addon": {
    "schema": 1,
    "languages": [
      {
        "id": "nvmd",
        "name": "Novus Markdown",
        "extensions": [
          ".nvmd"
        ],
        "icon": "Nm",
        "color": "#7c5cff",
        "priority": 10,
        "comments": {
          "block": [
            "<!--",
            "-->"
          ]
        },
        "completions": [
          "prop",
          "ref",
          "import",
          "{#if}",
          "{:else}",
          "{/if}",
          "{#for}",
          "{/for}",
          "{@html }",
          "Callout",
          "CodeBlock",
          "Toc",
          "Markdown",
          ":::note",
          ":::tip",
          ":::warning",
          ":::danger",
          "markdown.render",
          "markdown.headings",
          "markdown.frontmatter",
          "markdown.slug",
          "markdown.highlight",
          "markdown.text",
          "markdown.body",
          "markdown.fill"
        ],
        "snippets": [
          {
            "label": "note",
            "detail": "Container: note",
            "body": ":::note ${Title}\n$0\n:::"
          },
          {
            "label": "tip",
            "detail": "Container: tip",
            "body": ":::tip ${Title}\n$0\n:::"
          },
          {
            "label": "warning",
            "detail": "Container: warning",
            "body": ":::warning ${Title}\n$0\n:::"
          },
          {
            "label": "danger",
            "detail": "Container: danger",
            "body": ":::danger ${Title}\n$0\n:::"
          },
          {
            "label": "callout",
            "detail": "<Callout> component",
            "body": "<Callout type=\"${note}\" title=\"${Title}\">\n$0\n</Callout>"
          },
          {
            "label": "codeblock",
            "detail": "<CodeBlock> component",
            "body": "<CodeBlock language=\"${nv}\" code={${code}} />$0"
          },
          {
            "label": "toc",
            "detail": "<Toc> component",
            "body": "<Toc headings={markdown.headings(${source})} minLevel={2} maxLevel={3} />$0"
          },
          {
            "label": "markdown",
            "detail": "<Markdown> component",
            "body": "<Markdown source={${source}} />$0"
          },
          {
            "label": "comp",
            "detail": "Component tag",
            "body": "<${Component} ${prop}={${value}} />$0"
          },
          {
            "label": "fm",
            "detail": "Frontmatter",
            "body": "---\ntitle: ${Title}\ndescription: ${Description}\n---\n$0"
          },
          {
            "label": "nv",
            "detail": "<?nv ?> header",
            "body": "<?nv\n$0\n?>"
          },
          {
            "label": "header",
            "detail": "Header with import and prop",
            "body": "<?nv\nimport ${strings}\nprop ${string} ${name} = \"${value}\"\n?>\n\n$0"
          },
          {
            "label": "import",
            "detail": "Import of the components",
            "body": "import \"github.com/ezTxmMC/nvh-markdown/components\""
          },
          {
            "label": "prop",
            "detail": "prop",
            "body": "prop ${string} ${name} = ${\"\"}"
          },
          {
            "label": "ref",
            "detail": "ref",
            "body": "ref ${integer} ${count} = ${0}"
          },
          {
            "label": "expr",
            "detail": "{expr}",
            "body": "{${expression}}$0"
          },
          {
            "label": "if",
            "detail": "{#if}",
            "body": "{#if ${condition}}\n$0\n{:else}\n\n{/if}"
          },
          {
            "label": "for",
            "detail": "{#for}",
            "body": "{#for ${item}, ${i} in ${list}}\n- {${item}}\n{/for}"
          },
          {
            "label": "html",
            "detail": "{@html}",
            "body": "{@html ${expression}}$0"
          },
          {
            "label": "table",
            "detail": "Table",
            "body": "| ${Column} | ${Column} |\n| --- | --- |\n| $0 | |"
          },
          {
            "label": "task",
            "detail": "Task list",
            "body": "- [ ] ${Task}\n- [x] ${Done}"
          },
          {
            "label": "code-nv",
            "detail": "Code fence: Novus",
            "body": "```nv\n$0\n```"
          },
          {
            "label": "code-nvh",
            "detail": "Code fence: nvh",
            "body": "```nvh\n$0\n```"
          },
          {
            "label": "code-html",
            "detail": "Code fence: HTML",
            "body": "```html\n$0\n```"
          },
          {
            "label": "code-sh",
            "detail": "Code fence: Shell",
            "body": "```sh\n$0\n```"
          },
          {
            "label": "code-json",
            "detail": "Code fence: JSON",
            "body": "```json\n$0\n```"
          },
          {
            "label": "code-c",
            "detail": "Code fence: C",
            "body": "```c\n$0\n```"
          },
          {
            "label": "code-js",
            "detail": "Code fence: JavaScript",
            "body": "```js\n$0\n```"
          },
          {
            "label": "code-ts",
            "detail": "Code fence: TypeScript",
            "body": "```ts\n$0\n```"
          },
          {
            "label": "code-toml",
            "detail": "Code fence: TOML",
            "body": "```toml\n$0\n```"
          },
          {
            "label": "code-yaml",
            "detail": "Code fence: YAML",
            "body": "```yaml\n$0\n```"
          },
          {
            "label": "code",
            "detail": "Code fence",
            "body": "```${nv}\n$0\n```"
          }
        ],
        "indentUnit": 2,
        "tokenizer": "nvmd"
      }
    ],
    "themes": [],
    "commands": [],
    "events": [],
    "templates": [
      {
        "id": "nvh-markdown-site",
        "name": "nvh-markdown page",
        "description": "A Novus project with a .nvmd page, rendered to HTML with nvh-markdown.",
        "languageId": "nvmd",
        "kindId": "nvh-markdown",
        "icon": "Nm",
        "color": "#7c5cff",
        "fields": [
          {
            "id": "module",
            "label": "Module path",
            "default": "github.com/user/site",
            "pattern": "[\\w.\\-/]+",
            "mono": true,
            "section": "Project"
          },
          {
            "id": "version",
            "label": "Version",
            "default": "0.1.0",
            "pattern": "\\d+\\.\\d+\\.\\d+(?:[-+][0-9A-Za-z.-]+)?",
            "mono": true,
            "section": "Project"
          }
        ],
        "open": "Page.nvmd",
        "setup": [
          {
            "label": "Fetch the dependencies",
            "command": "novusc",
            "args": [
              "deps"
            ]
          }
        ],
        "files": [
          {
            "path": "project.nv",
            "content": "project \"{{module}}\"\nversion \"{{version}}\"\nmain \"main.nv\"\noutput \"{{slug}}\"\n\nrequire \"github.com/ezTxmMC/nvh-markdown\" \"latest\"\n// replace \"github.com/ezTxmMC/nvh-markdown\" \"../nvh-markdown\"     // a local checkout\n"
          },
          {
            "path": "main.nv",
            "content": "package main\n\nimport web\nimport @Page\n\n// Page.nvmd becomes Page.nvh (nvmd: Generate .nvh for this file), then:\n//   novusc run main.nv\nmethod main {\n    println web.renderHtml(Page())\n}\n"
          },
          {
            "path": "Page.nvmd",
            "content": "---\ntitle: {{name}}\n---\n<?nv\nimport strings\n?>\n\n# {title}\n\nPlain **Markdown** with Novus in it: {strings.upper(title)}.\n\n{#for item in [\"one\", \"two\"]}\n- {item}\n{/for}\n\n<Callout type=\"tip\" title=\"Components\">\nChildren are **Markdown** as well.\n</Callout>\n\n```nv\nprintln \"braces { } in code stay literal\"\n```\n"
          },
          {
            "path": "components/Callout.nvh",
            "content": "<?nv\nimport strings\n\nprop string type = \"note\"\nprop string title = \"\"\n\nmethod heading(): string {\n    if (title != \"\") {\n        return title\n    }\n    return strings.capitalize(type)\n}\n?>\n<aside class=\"callout callout-{type}\" role=\"note\">\n    <p class=\"callout-title\">{heading()}</p>\n    <div class=\"callout-body\"><slot /></div>\n</aside>\n"
          },
          {
            "path": ".gitignore",
            "content": "# generated from Page.nvmd\nPage.nvh\n"
          },
          {
            "path": "README.md",
            "content": "# {{name}}\n\nA Novus project that uses [nvh-markdown](https://github.com/ezTxmMC/nvh-markdown).\n\n```sh\nnovusc deps\n# in Lumen: command \"nvmd: Generate .nvh for this file\" (Page.nvmd -> Page.nvh)\nnovusc run main.nv\n```\n"
          }
        ]
      }
    ],
    "projectKinds": [
      {
        "id": "nvh-markdown",
        "name": "Novus + nvh-markdown",
        "icon": "Nm",
        "color": "#7c5cff",
        "markers": [
          "project.nv"
        ],
        "rules": [
          {
            "file": "project.nv",
            "pattern": "github\\.com/ezTxmMC/nvh-markdown"
          }
        ],
        "priority": 20,
        "languageIds": [
          "nvmd",
          "novus"
        ],
        "tasks": [
          {
            "id": "run",
            "label": "novusc run",
            "command": "novusc",
            "args": [
              "run"
            ],
            "group": "run"
          },
          {
            "id": "check",
            "label": "novusc check",
            "command": "novusc",
            "args": [
              "check"
            ],
            "group": "test"
          },
          {
            "id": "deps",
            "label": "novusc deps",
            "command": "novusc",
            "args": [
              "deps"
            ],
            "group": "build"
          }
        ],
        "facts": [
          {
            "label": "Module",
            "file": "project.nv",
            "pattern": "^project\\s+\"([^\"]+)\"",
            "role": "name"
          },
          {
            "label": "Version",
            "file": "project.nv",
            "pattern": "^version\\s+\"([^\"]+)\"",
            "role": "version"
          },
          {
            "label": "nvh-markdown",
            "file": "project.nv",
            "pattern": "^require\\s+\"github\\.com/ezTxmMC/nvh-markdown\"(?:\\s+\"([^\"]+)\")?"
          }
        ],
        "buildFile": "project.nv",
        "dependencyScan": {
          "file": "project.nv",
          "pattern": "^require\\s+\"([^\"]+)\"(?:\\s+\"([^\"]+)\")?"
        },
        "sourceRoots": [
          "."
        ]
      }
    ],
    "snippets": [],
    "id": "addon.nvh-markdown",
    "name": "nvh-markdown",
    "version": "1.0.0",
    "description": "Novus nvh-markdown: .nvmd highlighting (Markdown, frontmatter, <?nv ?> header, {expr}, template blocks, components, containers), snippets, a project template and commands for the .nvmd to .nvh generator.",
    "author": "Lumen",
    "icon": "Nm",
    "color": "#7c5cff",
    "category": "language"
  }
}
