{"id":16791974,"url":"https://github.com/metonym/svelte-readme","last_synced_at":"2026-07-05T03:01:48.738Z","repository":{"id":48559288,"uuid":"315154791","full_name":"metonym/svelte-readme","owner":"metonym","description":"Develop and demo your Svelte components in your README.md","archived":false,"fork":false,"pushed_at":"2026-07-04T01:07:13.000Z","size":169,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-07-04T01:14:17.418Z","etag":null,"topics":["documentation-driven-development","prismjs","readme-driven-development","rollup","svelte-components","svelte-preprocessor"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/metonym.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}},"created_at":"2020-11-22T23:39:26.000Z","updated_at":"2026-07-04T01:06:31.000Z","dependencies_parsed_at":"2022-09-26T20:01:05.638Z","dependency_job_id":null,"html_url":"https://github.com/metonym/svelte-readme","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/metonym/svelte-readme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-readme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-readme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-readme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-readme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metonym","download_url":"https://codeload.github.com/metonym/svelte-readme/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fsvelte-readme/sbom","scorecard":{"id":638274,"data":{"date":"2025-08-11","repo":{"name":"github.com/metonym/svelte-readme","commit":"6a9c8190b62573196688d2f36b1d1168d2ad37a9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-wv8q-r932-8hc7","Warn: Project is vulnerable to: GHSA-8266-84wp-wv5c","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-x7hr-w5r2-h6wg","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T09:55:14.795Z","repository_id":48559288,"created_at":"2025-08-21T09:55:14.795Z","updated_at":"2025-08-21T09:55:14.795Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35141966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"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":["documentation-driven-development","prismjs","readme-driven-development","rollup","svelte-components","svelte-preprocessor"],"created_at":"2024-10-13T08:43:43.548Z","updated_at":"2026-07-05T03:01:48.699Z","avatar_url":"https://github.com/metonym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-readme\n\n\u003e A Vite plugin and Svelte preprocessor for developing and demoing your Svelte components in your README.md.\n\n## Readme Driven Development\n\nThis project embraces the concept of [Readme Driven Development](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html) (RDD), or more generally, documentation driven development.\n\nThis module enables the `README.md` to be used for:\n\n- developing a Svelte component\n- demoing a Svelte component\n- documentation\n  - installation\n  - usage\n  - API\n  - metadata\n    - links to Changelog, License etc.\n\n## How it works\n\nAt its core, this library is a simple Svelte preprocessor.\n\n1. Use the `svelte` entry defined in your project `package.json`\n2. Use `README.md` as the Svelte source code\n3. Parse Markdown using [Markdown It](https://github.com/markdown-it/markdown-it)\n4. Highlight code with a built-in highlighter (`svelte`, `typescript`/`javascript`, `json`, `yaml`, `bash`) and run `svelte` code fence blocks so that demos are juxtaposed with code\n5. Style the result with a built-in, themeable stylesheet inspired by GitHub's markdown rendering\n\n## Installation\n\n```sh\nnpm install svelte-readme\n```\n\n## Usage\n\nThis library exports two methods:\n\n- `svelteReadme`: creates a Vite plugin for you\n- `preprocessReadme`: standalone Svelte markup preprocessor\n\n`svelteReadme` requires Svelte 5+ as a peer dependency. `preprocessReadme` has no such constraint. At a minimum, `package.json#svelte` and `package.json#name` are required.\n\n**package.json**\n\n```json\n{\n  \"name\": \"my-svelte-component\",\n  \"svelte\": \"./src/index.js\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.js\"\n  },\n  \"scripts\": {\n    \"dev\": \"vite\",\n    \"build\": \"vite build\",\n    \"preview\": \"vite preview\"\n  },\n  \"homepage\": \"https://github.com/metonym/svelte-readme\"\n}\n```\n\n**vite.config.ts**\n\n`svelteReadme` is a standard Vite plugin factory: it returns `Plugin[]`, so it composes with the rest of your Vite config instead of replacing it.\n\n```ts\nimport { svelteReadme } from \"svelte-readme\";\nimport { defineConfig } from \"vite\";\n\nexport default defineConfig({\n  plugins: [svelteReadme()],\n  server: { port: 3000 }, // passes through untouched\n});\n```\n\n## API\n\nAll properties are optional.\n\n\u003e [!NOTE]\n\u003e `svelteReadme` owns `build.outDir` (set via the `outDir` option below, not `build.outDir`) and `build.rollupOptions.input`/`appType`. If you set your own `build.rollupOptions` in `vite.config.ts`, the outcome depends on Vite's plugin `config` hook merge order — this is composable for fields `svelteReadme` doesn't touch, but not fully composable for the fields it does.\n\n```ts\ninterface SvelteReadmeOptions {\n  /**\n   * set the folder to emit the files\n   * @default \"dist\"\n   */\n  outDir?: string;\n\n  /**\n   * custom CSS appended to the \u003cstyle\u003e block\n   * @default \"\"\n   */\n  style?: string;\n\n  /**\n   * set to `true` to omit the default GitHub styles\n   * @default false\n   */\n  disableDefaultCSS?: boolean;\n\n  /**\n   * value to prepend to relative URLs (i.e. GitHub repo URL)\n   * @default undefined\n   */\n  prefixUrl?: string;\n\n  /**\n   * Called with the source of each `svelte` code fence before it's highlighted for display,\n   * so it can be pretty-printed with your own formatter (e.g. Prettier). The code fence is\n   * displayed unformatted if this is omitted or its result rejects/throws.\n   * @default undefined\n   */\n  format?: (source: string) =\u003e string | Promise\u003cstring\u003e;\n\n  /**\n   * `@sveltejs/vite-plugin-svelte` options\n   * @default {}\n   */\n  svelte?: VitePluginSvelteOptions;\n\n  /**\n   * Append content to the `head` element in `index.html`\n   * @default undefined\n   */\n  head?: string;\n}\n```\n\n### Custom fonts\n\nLoad fonts from a CDN via `head`, then point the library's `--sr-font-sans` (body text) and `--sr-font-mono` (code snippets) custom properties (see [style.css](src/styles/style.css)) at them via `style`:\n\n```ts\nimport { svelteReadme } from \"svelte-readme\";\nimport { defineConfig } from \"vite\";\n\nexport default defineConfig({\n  plugins: [\n    svelteReadme({\n      head: `\n        \u003clink rel=\"preconnect\" href=\"https://fonts.googleapis.com\" /\u003e\n        \u003clink rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin /\u003e\n        \u003clink\n          href=\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700\u0026family=Public+Sans:wght@400;500;600;700\u0026display=swap\"\n          rel=\"stylesheet\"\n        /\u003e\n      `,\n      style: `\n        :root {\n          --sr-font-sans: \"Public Sans\", system-ui, sans-serif;\n          --sr-font-mono: \"JetBrains Mono\", ui-monospace, monospace;\n        }\n      `,\n    }),\n  ],\n});\n```\n\n## Changelog\n\n[CHANGELOG.md](CHANGELOG.md)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fsvelte-readme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetonym%2Fsvelte-readme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fsvelte-readme/lists"}