{"id":13674374,"url":"https://github.com/BuptStEve/markdown-it-vuese","last_synced_at":"2025-04-28T14:31:12.798Z","repository":{"id":142311710,"uuid":"167567443","full_name":"BuptStEve/markdown-it-vuese","owner":"BuptStEve","description":"📖 Vuese plugin for markdown-it markdown parser","archived":false,"fork":false,"pushed_at":"2019-10-11T13:31:06.000Z","size":487,"stargazers_count":17,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T16:55:50.609Z","etag":null,"topics":["documentation","markdown","markdown-it","markdown-plugin","vuese"],"latest_commit_sha":null,"homepage":"https://buptsteve.github.io/markdown-it-vuese","language":"JavaScript","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/BuptStEve.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T15:19:45.000Z","updated_at":"2024-07-31T08:25:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"edf1d50a-7692-4a7d-a5d6-9d37d26dbd02","html_url":"https://github.com/BuptStEve/markdown-it-vuese","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuptStEve%2Fmarkdown-it-vuese","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuptStEve%2Fmarkdown-it-vuese/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuptStEve%2Fmarkdown-it-vuese/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuptStEve%2Fmarkdown-it-vuese/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BuptStEve","download_url":"https://codeload.github.com/BuptStEve/markdown-it-vuese/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251330224,"owners_count":21572249,"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":["documentation","markdown","markdown-it","markdown-plugin","vuese"],"created_at":"2024-08-02T11:00:48.226Z","updated_at":"2025-04-28T14:31:12.178Z","avatar_url":"https://github.com/BuptStEve.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003emarkdown-it-vuese\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://circleci.com/gh/BuptStEve/markdown-it-vuese/tree/master\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/circleci/project/github/BuptStEve/markdown-it-vuese/master.svg\" alt=\"Build Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://codecov.io/github/BuptStEve/markdown-it-vuese?branch=master\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/codecov/c/github/BuptStEve/markdown-it-vuese/master.svg\" alt=\"Coverage Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://david-dm.org/buptsteve/markdown-it-vuese\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://david-dm.org/buptsteve/markdown-it-vuese.svg\" alt=\"dependencies\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/markdown-it-vuese\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://badgen.net/npm/dm/markdown-it-vuese\" alt=\"Downloads per month\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/v/markdown-it-vuese.svg\" alt=\"Version\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/l/markdown-it-vuese.svg\" alt=\"License\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nEnglish | \u003ca href=\"https://buptsteve.github.io/markdown-it-vuese/zh/\"\u003e简体中文\u003c/a\u003e\n\n\u003e [Vuese][1] plugin for [markdown-it][2] markdown parser.\n\nWith this plugin, you can use [Vuese][1] to automatically generate documents while importing existing `*.vue` files via following syntax.\n\n```md\n\u003c[vuese](@/filePath)\n```\n\n\u003e The default value of @ is `process.cwd()`.\n\n\u003ca href=\"https://buptsteve.github.io/markdown-it-vuese/example/demo.html\"\u003ePlease click here to see the demo\u003c/a\u003e\n\n## Install\n\n```bash\n$ npm i -S markdown-it-vuese\n# OR\n$ yarn add markdown-it-vuese\n```\n\n## Usage\n\n```js\nconst md = require('markdown-it')()\n    .use(require('markdown-it-vuese') [, options])\n```\n\n## Options\n\n```js\nconst md = require('markdown-it')()\n    .use(require('markdown-it-vuese'), {\n        root: 'some path',\n        vueseRe: /your regexp/,\n        useParser: parserRes =\u003e parserRes.name,\n        useRender: (vueseRender) =\u003e {\n            const renderRes = vueseRender.render()\n            const markdownRes = vueseRender.renderMarkdown()\n\n            return 'something'\n        },\n        useAll: ({ ... }) =\u003e {\n            return 'something'\n        },\n    })\n```\n\n### root\n* Type: `String`\n* Default: `process.cwd()`\n\nRoot Directory, this value will replace the @ in file path.\n\n### vueseRe\n* Type: `RegExp`\n* Default: `/\u003c\\[vuese\\]\\((.+)\\)/i`\n\nRegular expression, you can customize it as you like.\n\n### ruleName\n* Type: `String`\n* Default: `vuese`\n\nRule name, it will be used by [markdown-it][2], so be careful not to duplicate [existing rules][9].\n\nUse it with `vueseRe`, we can use different rules in the same document to render different results.\n\n```js\nconst vuese = require('markdown-it-vuese')\n\nconst md = require('markdown-it')()\n    // default\n    // \u003c[vuese](filePath)\n    .use(vuese)\n    // \u003c[vuese-h3](filePath)\n    // No title, `Props` and other attributes should be changed from `\u003ch2\u003e` to `\u003ch3\u003e`\n    .use(vuese, {\n        vueseRe: /\u003c\\[vuese-h3\\]\\((.+)\\)/i,\n        ruleName: 'vuese-h3',\n        useRender: (vueseRender) =\u003e {\n            const renderRes = vueseRender.render()\n            const genMd = key =\u003e `### ${key}\\n${renderRes[key]}\\n`\n\n            return Object.keys(renderRes).map(genMd).join('')\n        },\n    })\n```\n\n### useParser\n* Type: `Function`\n* Default: `null`\n\nIt takes [@vuese/parser `ParserResult`][7] as a parameter.\n\nIf `useParser` exists, it returns the result directly after running, otherwise try running `useRender`.\n\n### useRender\n* Type: `Function`\n* Default: `null`\n\nIt takes [@vuese/markdown-render `Render Class`][8] as a parameter.\n\nIf `useRender` exists, it returns the result directly after running, otherwise try running `useAll`.\n\nFor example, you can call the following methods to generate objects and markdown documents, respectively.\n\n* `render`: will generate `renderRes`\n* `renderMarkdown`: will generate `markdownRes`\n\n### useAll\n* Type: `Function`\n* Default: `null`\n\nIt takes an object as parameters with there attributes: `content`(source file content), `parserRes`, `renderRes`, `markdownRes`.\n\nReturn `markdownRes.content` by default, if `useAll` does not exist.\n\n```js\nconst md = require('markdown-it')()\n    .use(require('markdown-it-vuese'), {\n        useAll: ({\n            content,\n            parserRes,\n            renderRes,\n            markdownRes,\n        }) =\u003e {\n            return 'something'\n        },\n    })\n```\n\n### parserOptions\n* Type: `Object`\n* Default: `{}`\n\nIt passes [@vuese/parser options][5]\n\n### renderOptions\n* Type: `Object`\n* Default: `{}`\n\nIt passes [@vuese/markdown-render options][6]\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) [StEve Young](https://github.com/BuptStEve)\n\n[1]: https://github.com/vuese/vuese\n[2]: https://github.com/markdown-it/markdown-it\n[3]: https://vuese.org/parser/\n[4]: https://vuese.org/markdown-render/\n[5]: https://vuese.org/parser/#parseroptions\n[6]: https://vuese.org/markdown-render/#renderoptions\n[7]: https://vuese.org/parser/#parserresult\n[8]: https://vuese.org/markdown-render/#render-class\n[9]: https://markdown-it.github.io/markdown-it/#Renderer.prototype.rules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBuptStEve%2Fmarkdown-it-vuese","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBuptStEve%2Fmarkdown-it-vuese","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBuptStEve%2Fmarkdown-it-vuese/lists"}