{"id":18781738,"url":"https://github.com/dillonchanis/solidjs-markdoc","last_synced_at":"2025-08-10T08:35:41.850Z","repository":{"id":57679614,"uuid":"492313843","full_name":"dillonchanis/solidjs-markdoc","owner":"dillonchanis","description":"SolidJS renderer for Markdoc","archived":false,"fork":false,"pushed_at":"2022-05-15T12:38:36.000Z","size":45,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-18T07:41:18.159Z","etag":null,"topics":["javascript","markdoc","markdown","solid","solidjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/dillonchanis.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}},"created_at":"2022-05-14T20:01:51.000Z","updated_at":"2025-04-07T14:53:35.000Z","dependencies_parsed_at":"2022-09-14T09:10:52.279Z","dependency_job_id":null,"html_url":"https://github.com/dillonchanis/solidjs-markdoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dillonchanis/solidjs-markdoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillonchanis%2Fsolidjs-markdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillonchanis%2Fsolidjs-markdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillonchanis%2Fsolidjs-markdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillonchanis%2Fsolidjs-markdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dillonchanis","download_url":"https://codeload.github.com/dillonchanis/solidjs-markdoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dillonchanis%2Fsolidjs-markdoc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269697795,"owners_count":24461149,"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-08-10T02:00:08.965Z","response_time":71,"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":["javascript","markdoc","markdown","solid","solidjs"],"created_at":"2024-11-07T20:33:18.545Z","updated_at":"2025-08-10T08:35:41.795Z","avatar_url":"https://github.com/dillonchanis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solidjs-markdoc\n\nRender [Markdoc](https://markdoc.io/) syntax with SolidJS.\n\n## Install\n\n```bash\nnpm install solidjs-markdoc\n```\n\n## Usage\n\n### Simple Markdown\n\nYou can provide simple markdown strings to the renderer to render Markdoc.\n\n```js\nimport Markdoc from \"@markdoc/markdoc\";\nimport render from \"solidjs-markdoc\";\n\nfunction App() {\n  const md = `\n    # Hello World\n\n    We can render markdown.\n  `;\n  const ast = Markdoc.parse(md);\n  const content = Markdoc.transform(ast);\n\n  return render(content);\n}\n```\n\n### Markdoc Schema and SolidJS Components\n\nSetup a Markdoc schema.\n\n```\nschema/\n└── Alert.markdoc.ts\n```\n\n```js\n// schema/Alert.markdoc.ts\n\nexport default {\n  render: \"Alert\",\n  description: \"Display the enclosed content in an alert box\",\n  children: [\"paragraph\", \"tag\", \"list\"],\n  attributes: {\n    type: {\n      type: String,\n      default: \"default\",\n      matches: [\"default\", \"info\", \"warning\", \"error\", \"success\"],\n    },\n  },\n};\n```\n\nCreate your Solid component.\n\n```js\nfunction Alert({ type, children }) {\n  return (\n    \u003cdiv class={`alert alert--${type}`}\u003e\n      {children}\n    \u003c/div\u003e\n  );\n}\n```\n\nImport the renderer and schema into your component.\n\n```js\nimport Markdoc from \"@markdoc/markdoc\";\nimport render from \"solidjs-markdoc\";\nimport alert from \"./schema/Alert.markdoc\";\n\nfunction Alert({ type, children }) {\n  return (\n    \u003cdiv class={`alert alert--${type}`}\u003e\n      {children}\n    \u003c/div\u003e\n  );\n}\n\nfunction App() {\n  //...\n}\n```\n\nCreate the `config` to pass into your `Markdoc.transform` call.\n\n```js\nfunction App() {\n  const md = `\n    # Getting started\n\n    You can run SolidJS components in here.\n\n    Check this alert:\n\n    {% alert type=\"info\" %}\n    Hey there! Something to look at!\n    {% /alert %}\n  `;\n\n  const config = {\n    tags: {\n      alert,\n    },\n  };\n\n  const ast = Markdoc.parse(md);\n  const content = Markdoc.transform(ast, config);\n\n  //...\n}\n```\n\nFinally, return the result of the `render` function making sure to supply your custom component to the render function's `components` object.\n\n\n```js\nfunction App() {\n  // ...\n\n  return render(content, {\n    components: {\n      Alert,\n    },\n  });\n}\n```\n\n## Full Example\n\n```js\nconst alert = {\n  render: \"Alert\",\n  description: \"Display the enclosed content in an alert box\",\n  children: [\"paragraph\", \"tag\", \"list\"],\n  attributes: {\n    type: {\n      type: String,\n      default: \"default\",\n      matches: [\"default\", \"info\", \"warning\", \"error\", \"success\"],\n    },\n  },\n};\n\nfunction Alert({ type, children }) {\n  return (\n    \u003cdiv class={`alert alert--${type}`}\u003e\n      {children}\n    \u003c/div\u003e\n  );\n}\n\nfunction App() {\n  const md = `\n    # Getting started\n\n    You can run SolidJS components in here.\n\n    Check this alert:\n\n    {% alert type=\"info\" %}\n    Hey there! Something to look at!\n    {% /alert %}\n  `;\n\n  const config = {\n    tags: {\n      alert,\n    },\n  };\n\n  const ast = Markdoc.parse(md);\n  const content = Markdoc.transform(ast, config);\n\n  return render(content, {\n    components: {\n      Alert,\n    },\n  });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdillonchanis%2Fsolidjs-markdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdillonchanis%2Fsolidjs-markdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdillonchanis%2Fsolidjs-markdoc/lists"}