{"id":16269199,"url":"https://github.com/tonycrane/mkdocs-heti-plugin","last_synced_at":"2025-08-18T03:39:19.915Z","repository":{"id":65641335,"uuid":"579077844","full_name":"TonyCrane/mkdocs-heti-plugin","owner":"TonyCrane","description":"A MkDocs plugin that uses heti to improve typesetting","archived":false,"fork":false,"pushed_at":"2023-09-30T07:39:19.000Z","size":52,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T07:39:09.663Z","etag":null,"topics":["chinese","chinese-typesetting","mkdocs","mkdocs-material","mkdocs-plugin","typesetting"],"latest_commit_sha":null,"homepage":"","language":"Python","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/TonyCrane.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":"2022-12-16T15:49:37.000Z","updated_at":"2025-03-12T19:23:31.000Z","dependencies_parsed_at":"2024-10-27T21:53:36.737Z","dependency_job_id":null,"html_url":"https://github.com/TonyCrane/mkdocs-heti-plugin","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"c1c37da248597429c88d0dc396e0e96ce8981dc6"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/TonyCrane/mkdocs-heti-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonyCrane%2Fmkdocs-heti-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonyCrane%2Fmkdocs-heti-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonyCrane%2Fmkdocs-heti-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonyCrane%2Fmkdocs-heti-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TonyCrane","download_url":"https://codeload.github.com/TonyCrane/mkdocs-heti-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonyCrane%2Fmkdocs-heti-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270940602,"owners_count":24671677,"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-18T02:00:08.743Z","response_time":89,"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":["chinese","chinese-typesetting","mkdocs","mkdocs-material","mkdocs-plugin","typesetting"],"created_at":"2024-10-10T18:07:34.296Z","updated_at":"2025-08-18T03:39:19.848Z","avatar_url":"https://github.com/TonyCrane.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkdocs-heti-plugin\n\n一个使用 [heti](https://github.com/sivan/heti) 来优化 mkdocs 中文正文排版的插件。\n\n具体表现在：\n\n- 中西文混排间使用四分宽空格\n    - 注：与 heti 不同，此时复制得到的是带半角空格的文本，而 heti 原脚本复制下来不带空格\n- 进行连续标点的挤压\n\n预览：https://note.tonycrane.cc/\n\n## 提示\nheti 原本是跑在前端的，不过在加载出页面到 heti 处理好之间有一小段时间间隔，感觉有些不爽，就写了这个插件，将这个任务直接放到网站生成的时候来做。\n\n不过嘛，效率是极低的，我的 note 用上之后需要三分多钟才能完成网站构建。\n\n如果可以忍受在前端处理的话可以看这个 commit：[TonyCrane/note@`5a0259`](https://github.com/TonyCrane/note/commit/5a02592e23bbf756ab02e4452f83eab80d694768)\n\n## 安装\n可以通过 pypi 直接安装：\n```shell\n$ pip install mkdocs-heti-plugin\n```\n\n也可以从源码安装\n\n```shell\n$ git clone https://github.com/TonyCrane/mkdocs-heti-plugin.git\n$ cd mkdocs-heti-plugin\n$ pip install . # or pip install -e .\n```\n\n## 使用\n- 在 mkdocs.yml 中启用插件即可：\n    ```yaml\n    plugins:\n      - heti\n    ```\n- 由于效率实在是太低，所以默认在 serve 的时候不进行处理，想要处理的话这样写：\n    ```yaml\n    plugins:\n      - heti:\n          disable_serve: false\n    ```\n\n目前配置项配置的不多，用法啥的也以后再完善（~~咕咕咕~~\n\n## 开发\n`mkdocs_heti_plugin/utils/finder.py` 是我对着 [padolsey/findAndReplaceDOMText](https://github.com/padolsey/findAndReplaceDOMText) 的 js 代码扒出来的，我也不敢说我看懂了，反正它目前确实能跑，能用就行了。\n\n`mkdocs_heti_plugin/utils/heti.py` 里面有一些用很不优雅的方式解决的一些不想深究的 bug，有时间再细看看。\n\n有想修改、改进的我非常且热烈欢迎，尽管 PR 就好（\n\n### TODO\n- [ ] 与 mkdocs-encryptcontent-plugin 加密页面兼容\n- [x] 支持 pymdownx.arithmatex\n\n## 注意事项\n与 mkdocs-encryptcontent-plugin 还没兼容，加密的页面目前不做处理（处理的话目前会卡死）。\n\n## 参考 \u0026 鸣谢\n- [sivan/heti](https://github.com/sivan/heti)\n- [padolsey/findAndReplaceDOMText](https://github.com/padolsey/findAndReplaceDOMText)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonycrane%2Fmkdocs-heti-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonycrane%2Fmkdocs-heti-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonycrane%2Fmkdocs-heti-plugin/lists"}