{"id":20508614,"url":"https://github.com/wecatch/markdown-css","last_synced_at":"2025-04-09T19:18:51.478Z","repository":{"id":53472907,"uuid":"73593581","full_name":"wecatch/markdown-css","owner":"wecatch","description":"A tool convert css style into markdown inline style","archived":false,"fork":false,"pushed_at":"2021-03-29T19:33:21.000Z","size":5017,"stargazers_count":151,"open_issues_count":4,"forks_count":53,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T19:18:47.533Z","etag":null,"topics":["css","easy-to-use","format","html","markdown","themes","wechat"],"latest_commit_sha":null,"homepage":"http://wecatch.me/markdown-css","language":"CSS","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/wecatch.png","metadata":{"files":{"readme":"README-zh_cn.md","changelog":"CHANGES.md","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":"2016-11-13T03:38:11.000Z","updated_at":"2025-03-29T03:57:15.000Z","dependencies_parsed_at":"2022-09-26T17:20:41.419Z","dependency_job_id":null,"html_url":"https://github.com/wecatch/markdown-css","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wecatch%2Fmarkdown-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wecatch%2Fmarkdown-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wecatch%2Fmarkdown-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wecatch%2Fmarkdown-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wecatch","download_url":"https://codeload.github.com/wecatch/markdown-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094990,"owners_count":21046770,"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":["css","easy-to-use","format","html","markdown","themes","wechat"],"created_at":"2024-11-15T20:19:28.074Z","updated_at":"2025-04-09T19:18:51.457Z","avatar_url":"https://github.com/wecatch.png","language":"CSS","readme":"\nmakrdown-css\n=========\n\nMarkdown-css 是一个命令行工具，用来把 css 样式转换成 html 内联样式。\n\n\n# 为什么是 markdown-css ？\n\n可能吧的阿禅的在[可能吧的文章是如何排版的？](http://mp.weixin.qq.com/s?__biz=MjM5ODQwMjA4MA==\u0026mid=2649293603\u0026idx=1\u0026sn=57f38200555dcba76d6358594416c089\u0026mpshare=1\u0026scene=1\u0026srcid=1106ssUPcBWLZUq7D9vqXEkj#rd)中介绍了他是如何排版公众号文章的。思路就是用 markdown 写作，然后使用专门的工具导出为 html 文件，最后把自定义的样式应用到导出的文件，复制粘贴内容到微信公众号。想要自定义样式在微信公众号起作用，这些样式必须是内联的 `inline-style`，所以才有了 `markdown-css`。\n\nmarkdown-css  可以一键把 css 样式转换成内联样式，并输出 html 文件，就像这样:\n\n```shell\nmkdir public\nmarkdown-css markdown.html --style=style.css\n```\n\n默认生成同名的 html 文件并存放在当前目录的 public 中，双击用浏览器打开输出的文件，然后复制粘贴到公众号的编辑中，一次自定义排版就完成了。\n\n# 如何使用\n\n\nmarkdown-css  是用 Python 编写的，想要使用 markdown-css，最好在 linux 或 mac 系统下，这些系统都自带了 Python，很容易安装。\n\n\n## 安装\n\n在 macOS 中安装\n\n\n```shell\nxcode-select --install\npip install markdown-css\n```\n\n在 Ubuntu 中安装\n\n\n```shell\napt-get install libxml2-dev libxslt1-dev python-dev\napt-get install python-lxml\npip install markdown-css\n```\n\nmarkdown-css 没有在 windows 下测试过，为了获得最佳体验，最好使用 macOS 和 linux。\n\n\n## 使用\n\n安装完 markdown-css，打开终端，键入 `markdown-css -h` 查看是否正确安装。虽然 markdown-css 提供一键转换的功能，但是那些漂亮的 css 还是需要自己去编写的。如果你不太懂，可以请教一下身边的程序员同学，如果你身边没有可爱的程序员，请把你的使用情况反馈给我们。\n\n\n# 注意事项\n\n\n1. 大多数 markdown 写作工具都支持导出 html 文件，为了让自定义样式充分发挥作用，最好导出的是无样式 html 文件，[typora](http://www.typora.io/) 这款 markdown 工具就支持。\n\n2. makrdown-css 现在只支持非常简单的 css 选择器，但对于 markdown 文件导出的 html 来说已经足够了，具体见 [Doc](https://github.com/wecatch/markdown-css#selector)。\n\n\n# 反馈\n\n- 在 github 提 issue 给我们反馈 [issues](https://github.com/wecatch/markdown-css/issues)\n- 发邮件给我们 wecatch.me@gmail.com\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwecatch%2Fmarkdown-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwecatch%2Fmarkdown-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwecatch%2Fmarkdown-css/lists"}