{"id":13417801,"url":"https://github.com/astro-community/md","last_synced_at":"2025-10-27T13:45:02.696Z","repository":{"id":65562021,"uuid":"528675369","full_name":"astro-community/md","owner":"astro-community","description":"Render any Markdown content in Astro, optionally integrating with any existing configuration.","archived":false,"fork":false,"pushed_at":"2024-07-29T02:34:44.000Z","size":26,"stargazers_count":86,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-18T02:15:00.695Z","etag":null,"topics":["astro","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://stackblitz.com/github/astro-community/md","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astro-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-08-25T03:07:13.000Z","updated_at":"2025-10-17T06:08:06.000Z","dependencies_parsed_at":"2023-01-29T17:25:11.012Z","dependency_job_id":"bf9c46ae-b681-48e6-810b-d1bba7600439","html_url":"https://github.com/astro-community/md","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"ff65f0fd979effff3650e92ce0ca3574913f8ac5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/astro-community/md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-community%2Fmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-community%2Fmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-community%2Fmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-community%2Fmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro-community","download_url":"https://codeload.github.com/astro-community/md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro-community%2Fmd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281279067,"owners_count":26473855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"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":["astro","javascript","typescript"],"created_at":"2024-07-30T22:00:52.911Z","updated_at":"2025-10-27T13:45:02.659Z","avatar_url":"https://github.com/astro-community.png","language":"JavaScript","funding_links":[],"categories":["What Do I Use..."],"sub_categories":["If I want to render a string of markdown?"],"readme":"# Astro Markdown \u003cimg src=\"https://jonneal.dev/astro-logo.svg\" alt=\"\" width=\"90\" height=\"90\" align=\"right\"\u003e\n\n**Astro Markdown** lets you render any Markdown content in **[Astro](https://astro.build)**, optionally integrating with any existing configuration.\n\n[![NPM Version][npm-img]][npm-url]\n[![NPM Downloads][download-img]][download-url]\n[![Open in StackBlitz][stackblitz-img]][stackblitz-url]\n\n```astro\n---\nimport { Markdown } from '@astropub/md'\n---\n\u003cMarkdown of={`# Hi, there!` /* Renders `\u003ch1\u003eHi, there!\u003c/h1\u003e` */} /\u003e\n```\n\n```astro\n---\nimport { markdown } from '@astropub/md'\n---\n{\n  /* Renders `\u003ch1\u003eHi, there!\u003c/h1\u003e` */\n  await markdown(`# Hi, there!`)\n}\n```\n\n## Usage\n\nAdd **Astro Markdown** to your project.\n\n```shell\nnpm install @astropub/md\n```\n\nUse **Astro Markdown** in your project.\n\n```astro\n---\nimport { markdown } from '@astropub/md'\n---\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width\" /\u003e\n    \u003ctitle\u003eAstro\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    {await markdown(\n`# Hi, there!\n\nWelcome to my _website_.`\n    )}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nOptionally, integrate **Astro Markdown** with your existing Astro configuration.\n\n```js\n// astro.config.js\nimport { defineConfig } from 'astro/config'\nimport markdownIntegration from '@astropub/md'\n\nexport default defineConfig({\n  integrations: [\n    markdownIntegration(),\n  ],\n  markdown: {\n    remarkPlugins: [],\n    rehypePlugins: [],\n    // syntaxHighlight: 'shiki'\n    // syntaxHighlight: 'prism'\n  }\n})\n```\n\nNow `markdown` configuration is automatically applied to `\u003cMarkdown\u003e` components and `markdown()` functions.\n\nUse `markdown.inline()` or `\u003cMarkdown.Inline\u003e` to handle short strings of text without the surrounding paragraph.\n\n```astro\n---\nimport { Markdown } from '@astropub/md'\n---\n\u003cMarkdown.Inline of={\n  /* Renders `Welcome to my \u003cem\u003ewebsite\u003c/em\u003e.` */\n  `Welcome to my _website_.`\n} /\u003e\n```\n\n```astro\n---\nimport { markdown } from '@astropub/md'\n---\n{await markdown.inline(\n  /* Renders `Welcome to my \u003cem\u003ewebsite\u003c/em\u003e.` */\n  `Welcome to my _website_.`\n)}\n```\n\n\u003cbr /\u003e\n\nEnjoy!\n\n## Project Structure\n\nInside of this Astro project, you'll see the following folders and files:\n\n```\n/\n├── demo/\n│   ├── public/\n│   └── src/\n│       └── pages/\n            ├── index.astro\n│           └── ...etc\n└── packages/\n    └── md/\n        ├── package.json\n        └── ...etc\n```\n\nThis project uses **workspaces** to develop a single package, `@astropub/md`.\n\nIt also includes a minimal Astro project, `demo`, for developing and demonstrating the component.\n\n## Commands\n\nAll commands are run from the root of the project, from a terminal:\n\n| Command         | Action                                       |\n|:----------------|:---------------------------------------------|\n| `npm install`   | Installs dependencies                        |\n| `npm run start` | Starts local dev server at `localhost:3000`  |\n| `npm run build` | Build your production site to `./dist/`      |\n| `npm run serve` | Preview your build locally, before deploying |\n\nWant to learn more?\nRead the [Astro documentation][docs-url] or jump into the [Astro Discord][chat-url].\n\n[chat-url]: https://astro.build/chat\n[docs-url]: https://github.com/withastro/astro\n\n[npm-img]: https://img.shields.io/npm/v/@astropub/md?color=%23444\u0026label=\u0026labelColor=%23CB0000\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjE1MCAxNTAgNDAwIDQwMCIgZmlsbD0iI0ZGRiI+PHBhdGggZD0iTTE1MCA1NTBoMjAwVjI1MGgxMDB2MzAwaDEwMFYxNTBIMTUweiIvPjwvc3ZnPg==\u0026style=for-the-badge\n[npm-url]: https://www.npmjs.com/package/@astropub/md\n[stackblitz-img]: https://img.shields.io/badge/-Open%20in%20Stackblitz-%231374EF?color=%23444\u0026labelColor=%231374EF\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjEwIDggMTIgMTgiIGhlaWdodD0iMTgiIGZpbGw9IiNGRkYiPjxwYXRoIGQ9Ik0xMCAxNy42aDUuMmwtMyA3LjRMMjIgMTQuNGgtNS4ybDMtNy40TDEwIDE3LjZaIi8+PC9zdmc+\u0026style=for-the-badge\n[stackblitz-url]: https://stackblitz.com/github/astro-community/md\n[bundlejs-img]: https://img.shields.io/badge/dynamic/json?url=https://bundlejs.com/api?q=@astropub/md\u0026query=size.totalCompressedSize\u0026color=%23444\u0026labelColor=%233B82F6\u0026label=\u0026logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3MDAgNzAwIiBmaWxsPSIjRkZGIj4KCTxwYXRoIGQ9Ik0xNDYgMkExNzEgMTcxIDAgMCAwIDMgMTM5bC0yIDExdjQwMmwyIDExYzE1IDcyIDcxIDEyNSAxNDMgMTM2bDIwOSAxIDE5OS0xIDktMmM3MC0xNiAxMTktNjYgMTM0LTEzNWwyLTEwVjE1MGwtMi0xMkExNzEgMTcxIDAgMCAwIDU2MiAzbC0xMC0yLTE5OS0xQzE4NyAwIDE1MyAwIDE0NiAyem0xODEgMjUxdjM2bDctM2MxMy02IDMzLTkgNTAtNyA0MSA1IDcwIDM0IDgwIDc4IDIgMTIgMiA0MSAwIDUzLTUgMjItMTMgMzgtMjcgNTJhODIgODIgMCAwIDEtNjMgMjZjLTE1IDAtMTkgMC0yNS0yLTEwLTItMTctNi0yNC0xMGwtNS0zdjExaC00NVYyMTdoNTJ2MzZ6bTI5IDcxYy0yMCAzLTMyIDE5LTM1IDQ4LTMgMjUgMyA0OCAxNCA2MCA1IDYgMTMgMTAgMjMgMTEgMjUgNCA0NC05IDUxLTM2bDMtMTljMC0xNy0xLTI3LTctMzktOS0xOS0yNi0yOC00OS0yNXoiLz4KPC9zdmc+\u0026style=for-the-badge\n[bundlejs-url]: https://bundlejs.com/?bundle\u0026q=@astropub/md\n[download-url]: https://www.npmjs.com/package/@astropub/md\n[download-img]: https://img.shields.io/badge/dynamic/json?url=https://api.npmjs.org/downloads/point/last-week/@astropub/md\u0026query=downloads\u0026label=⇓+week\u0026color=%23444\u0026labelColor=%23EEd100\u0026style=for-the-badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro-community%2Fmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro-community%2Fmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro-community%2Fmd/lists"}