{"id":48985256,"url":"https://github.com/backrunner/markvue","last_synced_at":"2026-04-18T12:11:04.686Z","repository":{"id":57291464,"uuid":"437077818","full_name":"backrunner/markvue","owner":"backrunner","description":"Allows you mix Vue SFC or component into Markdown","archived":false,"fork":false,"pushed_at":"2022-03-11T15:17:09.000Z","size":179,"stargazers_count":27,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T16:51:38.629Z","etag":null,"topics":["component-library","markdown","vue","vue3"],"latest_commit_sha":null,"homepage":"markvue.vercel.app","language":"Vue","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/backrunner.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-12-10T18:30:55.000Z","updated_at":"2024-01-17T11:32:09.000Z","dependencies_parsed_at":"2022-08-27T12:20:16.990Z","dependency_job_id":null,"html_url":"https://github.com/backrunner/markvue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/backrunner/markvue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backrunner%2Fmarkvue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backrunner%2Fmarkvue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backrunner%2Fmarkvue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backrunner%2Fmarkvue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backrunner","download_url":"https://codeload.github.com/backrunner/markvue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backrunner%2Fmarkvue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31968143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["component-library","markdown","vue","vue3"],"created_at":"2026-04-18T12:11:03.987Z","updated_at":"2026-04-18T12:11:04.679Z","avatar_url":"https://github.com/backrunner.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MarkVue\n\nAllows you to mix Vue component or Vue SFC into Markdown, inspired by `@vue/sfc-playground`.\n\n## How to use\n\n1: Install the package:\n\n```bash\nnpm install markvue --save\n```\n\n2: Import it to your project:\n\n```js\nimport MarkVue from 'markvue';\nimport { createApp } from 'vue';\nimport App from './app.vue';\n\nconst app = createApp(App);\napp.use(MarkVue);\n\napp.mount('#app');\n```\n\nOur component only support Vue 3, Vue 2 is not supported.\n\n3: Use it in your pages:\n\n```vue\n\u003ctemplate\u003e\n  \u003cMarkVue :content=\"content\" /\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport { defineComponent } from 'vue';\n\nconst content = `\n# Title\n\n## Subtitle\n\nHere's some content and the following is a vue sfc.\n\n\u003cvue-sfc\u003e\n\u003ctemplate\u003e\n  \u003cdiv class=\"sfc-test\"\u003e\n    \u003cbutton @click=\"count++\"\u003e{{ count }}\u003c/button\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript setup\u003e\nimport { ref } from 'vue';\n\nconst count = ref(0);\n\u003c/script\u003e\n\u003cstyle scoped\u003e\nbutton {\n  padding: 6px 12px;\n  background: #41aeff;\n  color: #fff;\n  font-weight: 600;\n  border-radius: 6px;\n}\n\u003c/style\u003e\n\u003c/vue-sfc\u003e\n\n\u003cvue-sfc\u003e\n\u003ctemplate\u003e\n  \u003cdiv class=\"sfc-test\"\u003e\n    \u003cspan\u003esecond sfc\u003c/span\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\u003c/vue-sfc\u003e\n\nHere's a vue component stub.\n\n\u003cvue-comp component=\"stubTest\" /\u003e\n`\nexport default defineComponent({\n  setup() {\n    return {\n      content,\n    };\n  },\n});\n\u003c/script\u003e\n```\n\nFor Vue SFC, markvue will inject Vue into the SFC as `context`, you can import APIs from Vue directly.\n\nIf you want to import something from other package, be sure to put it in the `context`, and bind it to markvue, just like this:\n\n```vue\n\u003ctemplate\u003e\n  \u003cMarkVue :content=\"content\" :context=\"context\" /\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nimport SOMETHING from 'SOME_PACKAGE';\n\nreturn {\n  content: `\n  \u003cvue-sfc\u003e\n  \u003ctemplate\u003e\n    \u003cdiv\u003e{{ content }}\u003c/div\u003e\n  \u003c/template\u003e\n  \u003cscript setup\u003e\n  import { SOME_METHOD } from 'SOME_PACKAGE';\n\n  return {\n    content: SOME_METHOD(),\n  };\n  \u003c/script\u003e\n  \u003c/vue-sfc\u003e\n  `,\n  context: {\n    SOME_PACKAGE: SOMETHING,\n  },\n};\n\u003c/script\u003e\n```\n\nYou can also put a Vue component into `context` directly, you can mix it into your Markdown like this:\n\n```markdown\n# Title\n\ncontent\n\n\u003cvue-comp component=\"myComponent\" /\u003e\n```\n\n```vue\n\u003ctemplate\u003e\n  \u003cMarkVue :context=\"context\"\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nimport myComponent from './myComponent.vue';\n\nreturn {\n  context: {\n    myComponent,\n  },\n};\n\u003c/script\u003e\n```\n\nIf you want to add `class` or some other attribute in the root element of Vue SFC or Vue component, you can just add it to the `\u003cvue-sfc\u003e` or `\u003cvue-comp\u003e` tag, like this:\n\n```Markdown\n\u003cvue-comp class=\"my-vue-comp\" /\u003e\n\nor\n\n\u003cvue-sfc class=\"my-vue-sfc\"\u003e\n\u003c/vue-sfc\u003e\n```\n\nFor custom options of `marked`, you can set an attribute `markedOptions` to `markvue`, like this:\n\n```vue\n\u003ctemplate\u003e\n  \u003cMarkVue :markedOptions=\"markedOptions\"\u003e\n\u003c/template\u003e\n```\n\n## Features\n\nSupported SFC Features:\n\n- `\u003cscript setup\u003e`\n\n- Scoped styles\n\nUnsupported SFC Features:\n\n- TypeScript\n\n- Style Preprocessors\n\n- Babel transform (The script which your wrote in the SFC will only be compiled by `@vue/compiler-sfc`, you need to ensure the compatibility by yourself)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackrunner%2Fmarkvue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackrunner%2Fmarkvue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackrunner%2Fmarkvue/lists"}