{"id":29538424,"url":"https://github.com/bottd/vite-plugin-norg","last_synced_at":"2026-04-19T08:01:24.769Z","repository":{"id":300794840,"uuid":"1006714004","full_name":"bottd/vite-plugin-norg","owner":"bottd","description":"A Vite plugin to enable processing of .norg files with support for Svelte, React, and HTML ","archived":false,"fork":false,"pushed_at":"2026-04-18T05:38:01.000Z","size":1052,"stargazers_count":11,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T07:28:00.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bottd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-22T21:11:12.000Z","updated_at":"2026-04-17T20:23:44.000Z","dependencies_parsed_at":"2025-06-23T17:27:00.015Z","dependency_job_id":null,"html_url":"https://github.com/bottd/vite-plugin-norg","commit_stats":null,"previous_names":["bottd/vite-plugin-norg"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/bottd/vite-plugin-norg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottd%2Fvite-plugin-norg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottd%2Fvite-plugin-norg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottd%2Fvite-plugin-norg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottd%2Fvite-plugin-norg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bottd","download_url":"https://codeload.github.com/bottd/vite-plugin-norg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bottd%2Fvite-plugin-norg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31999173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-17T05:01:48.411Z","updated_at":"2026-04-19T08:01:24.713Z","avatar_url":"https://github.com/bottd.png","language":"Rust","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# vite-plugin-norg\n\n[![npm version](https://img.shields.io/npm/v/vite-plugin-norg.svg)](https://www.npmjs.com/package/vite-plugin-norg)\n[![build status](https://img.shields.io/github/actions/workflow/status/bottd/vite-plugin-norg/release.yml)](https://github.com/bottd/vite-plugin-norg/actions)\n[![license](https://img.shields.io/npm/l/vite-plugin-norg.svg)](LICENSE)\n\n**Neorg processor for Vite** - Transform `.norg` files into HTML, React, Svelte, or Vue with full TypeScript support.\n\n## Installation\n\n```bash\nnpm install -D vite-plugin-norg\n```\n\n## Setup\n\n### Configuration\n\n```typescript\nimport type { FilterPattern } from 'vite';\n\ninterface NorgPluginOptions {\n  mode: 'html' | 'react' | 'svelte' | 'vue' | 'metadata';\n  include?: FilterPattern;\n  exclude?: FilterPattern;\n\n  arboriumConfig?: {\n    // Single theme\n    theme?: string;\n    // Or light/dark (uses prefers-color-scheme)\n    themes?: {\n      light: string;\n      dark: string;\n    };\n  };\n\n  // Directory to scan for framework components\n  componentDir?: string;\n\n  // (takes precedence over componentDir)\n  // { Component: \"import-path\" }\n  components?: Record\u003cstring, string\u003e;\n}\n\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { norgPlugin } from 'vite-plugin-norg';\n\nexport default defineConfig({\n  plugins: [\n    norgPlugin({\n      mode: 'svelte',\n    }),\n  ],\n});\n```\n\n### TypeScript\n\nAdd a type reference to `app.d.ts` based on your output target:\n\n```typescript\n// For Svelte\n/// \u003creference types=\"vite-plugin-norg/svelte\" /\u003e\n\n// For React\n/// \u003creference types=\"vite-plugin-norg/react\" /\u003e\n\n// For Vue\n/// \u003creference types=\"vite-plugin-norg/vue\" /\u003e\n\n// For HTML\n/// \u003creference types=\"vite-plugin-norg/html\" /\u003e\n\n// For Metadata\n/// \u003creference types=\"vite-plugin-norg/metadata\" /\u003e\n```\n\nThis provides type checking for `.norg` modules\n\n### HTML Usage\n\n```javascript\nimport { metadata, html } from './document.norg';\nconsole.log(metadata.title); // \"My Document\"\ndocument.body.innerHTML = html;\n```\n\n### React Usage\n\n```jsx\nimport { metadata, Component } from './document.norg';\n\nexport default function App() {\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003e{metadata.title}\u003c/h1\u003e\n      \u003cComponent /\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### Svelte Usage\n\n```svelte\n\u003cscript\u003e\n  import Document, { metadata } from './document.norg';\n\u003c/script\u003e\n\n\u003ch1\u003e{metadata.title}\u003c/h1\u003e\n\u003cDocument /\u003e\n```\n\n### Vue Usage\n\n```vue\n\u003cscript setup\u003e\nimport Document, { metadata } from './document.norg';\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003ch1\u003e{{ metadata.title }}\u003c/h1\u003e\n  \u003cDocument /\u003e\n\u003c/template\u003e\n```\n\n### Metadata Usage\n\n```javascript\nimport { metadata, toc } from './document.norg';\nconsole.log(metadata.title); // \"My Document\"\nconsole.log(toc); // [{ title: \"Section 1\", level: 1 }, ...]\n```\n\nYou can also append `?metadata` to any import to get metadata-only output regardless of mode:\n\n```javascript\nimport { metadata, toc } from './document.norg?metadata';\n```\n\n## Code Syntax Highlighting\n\nCode blocks are highlighted using [arborium](https://arborium.bearcove.eu/), which generates highlights via tree-sitter. Set a theme to include highlights:\n\n```typescript\nnorgPlugin({\n  mode: 'html',\n  arboriumConfig: { theme: 'github-dark' },\n});\n```\n\nSee the [arborium themes](https://github.com/bearcove/arborium?tab=readme-ov-file#themes) for available options.\n\n## Embed Components\n\nEmbed components can be referenced within `.norg` documents using `@embed`:\n\n```norg\n* Example document\nWith some regular text\n\n@embed svelte\n\u003cChart variant=\"bar\" /\u003e\n@end\n```\n\nTo configure components for usage with embeds, set either `componentDir` or map imports directly with `components`.\n\n```typescript\nnorgPlugin({\n  mode: 'svelte',\n  componentDir: './src/components',\n  components: {\n    Chart: './src/lib/Chart.svelte',\n  },\n});\n```\n\n## Embed Styles\n\nDocument styles can be embedded as well using `@embed css`. All frameworks will import embedded styles when rendering the document.\n\n```norg\n* Example document\nWith some regular text\n\n@embed css\n  h2 {\n    color: red;\n  }\n@end\n```\n\n**Requirements:**\n\n- Vite 7.0+\n- React 19+ (if using `mode: 'react'`)\n- Svelte 5+ (if using `mode: 'svelte'`)\n- Vue 3+ (if using `mode: 'vue'`)\n\n## Development\n\nThis project uses Nix flakes and direnv for reproducible development environments.\n\n### Setup\n\n```bash\n# Enable direnv\ndirenv allow\n\nbun install\n```\n\n### Development Commands\n\n```bash\n# Run tests\nnpm test\ncargo test\n\n# Lint and format\nnix fmt\n```\n\n## License\n\nMIT © [Drake Bott](https://github.com/bottd)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbottd%2Fvite-plugin-norg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbottd%2Fvite-plugin-norg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbottd%2Fvite-plugin-norg/lists"}