{"id":16957897,"url":"https://github.com/joshnuss/svelte-markdoc","last_synced_at":"2025-03-22T13:32:25.617Z","repository":{"id":40295892,"uuid":"491327956","full_name":"joshnuss/svelte-markdoc","owner":"joshnuss","description":"Markdoc preprocessor for Svelte","archived":false,"fork":false,"pushed_at":"2022-06-23T18:31:14.000Z","size":30,"stargazers_count":34,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T10:51:29.761Z","etag":null,"topics":["markdoc","svelte"],"latest_commit_sha":null,"homepage":"","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/joshnuss.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-12T01:45:29.000Z","updated_at":"2024-09-14T12:05:51.000Z","dependencies_parsed_at":"2022-08-09T16:38:21.631Z","dependency_job_id":null,"html_url":"https://github.com/joshnuss/svelte-markdoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fsvelte-markdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fsvelte-markdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fsvelte-markdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshnuss%2Fsvelte-markdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshnuss","download_url":"https://codeload.github.com/joshnuss/svelte-markdoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244963014,"owners_count":20539256,"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","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":["markdoc","svelte"],"created_at":"2024-10-13T22:20:23.723Z","updated_at":"2025-03-22T13:32:25.309Z","avatar_url":"https://github.com/joshnuss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"svelte-markdoc\n-----------------\n\nA [Markdoc](https://markdoc.io) preprocessor for [Svelte](https://svelte.dev). Supports [SvelteKit](https://kit.svelte.dev).\n\n## Setup\n\nCreate a [SvelteKit](https://kit.svelte.dev) project:\n\n```bash\nmkdir my-markdoc-project\ncd my-markdoc-project\n\npnpm init svelte@next \n```\n\nInstall the `svelte-markdoc` package:\n\n```bash\npnpm install -D svelte-markdoc\n```\n\nCreate a `markdoc.config.js` in the root folder to hold your markdoc config:\n\n```javascript\nexport default {\n  variables: {\n    title: 'My awesome site'\n  }\n}\n```\n\nThen, configure the preprocessor in `svelte.config.js`:\n\n```javascript\nimport preprocessMarkdoc from 'svelte-markdoc'\nimport markdocConfig from './markdoc.config.js'\n\nconst config = {\n  extensions: ['.svelte', '.markdoc'],\n  preprocess: {\n    markup: preprocessMarkdoc(markdocConfig)\n  },\n  kit: {\n    // ...\n  }\n}\n\nexport default config\n```\n\nNow you can create pages with the `.markdoc` extension in `src/routes`:\n\n```markdown\n---\ntitle: Hello from Markdoc\n---\n\n# {% $markdoc.frontmatter.title %}\n\nThis is *super* cool.\n```\n\n## FAQ\n\n### How is this different than MDX?\n\nMDX is great! It's very flexible, this is a more contrained editing system where docs are treated as data, whereas with mdx, it's more like code.\nMore info here: https://markdoc.io/docs/faq#why-not-mdx\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Fsvelte-markdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshnuss%2Fsvelte-markdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshnuss%2Fsvelte-markdoc/lists"}