{"id":15546738,"url":"https://github.com/reonokiy/remark-directive-emphasis-dots","last_synced_at":"2026-01-15T23:56:14.114Z","repository":{"id":250981473,"uuid":"836050172","full_name":"reonokiy/remark-directive-emphasis-dots","owner":"reonokiy","description":"为 Markdown 中文行内文本添加着重号的remark插件","archived":false,"fork":false,"pushed_at":"2024-07-31T04:17:05.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-09T13:14:01.526Z","etag":null,"topics":["chinese","emphasis","emphasis-dots","markdown","rehype","remark","remark-directive","unified"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/remark-directive-emphasis-dots","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reonokiy.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":"2024-07-31T04:13:18.000Z","updated_at":"2024-07-31T04:22:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bef245e-c313-4fba-b93e-cf6d000abae2","html_url":"https://github.com/reonokiy/remark-directive-emphasis-dots","commit_stats":null,"previous_names":["reonokiy/remark-directive-emphasis-dots"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reonokiy%2Fremark-directive-emphasis-dots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reonokiy%2Fremark-directive-emphasis-dots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reonokiy%2Fremark-directive-emphasis-dots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reonokiy%2Fremark-directive-emphasis-dots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reonokiy","download_url":"https://codeload.github.com/reonokiy/remark-directive-emphasis-dots/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905830,"owners_count":20852818,"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":["chinese","emphasis","emphasis-dots","markdown","rehype","remark","remark-directive","unified"],"created_at":"2024-10-02T13:04:04.273Z","updated_at":"2026-01-15T23:56:14.090Z","avatar_url":"https://github.com/reonokiy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-directive-emphasis-dots\n\n这是一个为 Markdown 中文行内文本添加着重号的[remark]()插件\n\n## 安装\n\n```sh\nnpm install remark-directive-emphasis-dots\n```\n\n## 用例\n\n```js\nimport rehypeFormat from 'rehype-format'\nimport rehypeStringify from 'rehype-stringify'\nimport remarkDirective from 'remark-directive'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport { unified } from 'unified'\nimport remarkDirectiveEmphasisDots from 'remark-directive-emphasis-dots'\n\nconst text = \":emd[你好]，世界！\"\nconst file = unified()\n          .use(remarkParse)\n          .use(remarkDirective)\n          .use(remarkDirectiveEmphasisDots())\n          .use(remarkRehype)\n          .use(rehypeFormat)\n          .use(rehypeStringify)\n          .process(text)\n\nconsole.log((await file).toString())\n```\n这会产生如下输出：\n\n```\n\u003cp\u003e\u003cem class=\"emd\"\u003e你好\u003c/em\u003e，世界！\u003c/p\u003e\n```\n\n之后，你可以通过自定义CSS来为最终的显示效果添加着重号效果，例如\n\n```css\nem.emd {\n \tfont-style: normal;\n\ttext-emphasis: filled black;\n  text-emphasis-position: under right;\n}\n```\n\n### 自定义选项\n\n可以通过向函数中传入配置来更改行为，配置的格式如下\n\n```\n...\n.use(remarkDirectiveEmphasisDots{\n  tag: 'emd', /* markdown 中的标记名 */\n  hName: 'em', /* HTML 中的标签名 */\n  classNames: [\"emd\"] /* 为 HTML 标签添加的类 */\n})\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freonokiy%2Fremark-directive-emphasis-dots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freonokiy%2Fremark-directive-emphasis-dots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freonokiy%2Fremark-directive-emphasis-dots/lists"}