mailify-md


Namemailify-md JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
Summary一个将 Markdown 文件转换为适合电子邮件的 HTML 的工具,并支持自定义 CSS
upload_time2025-07-12 05:38:41
maintainerNone
docs_urlNone
author2bitbit
requires_python>=3.10
licenseMIT License Copyright (c) 2025 2bitbit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords markdown email html converter katex
VCS
bugtrack_url
requirements cairosvg Requests premailer Pygments typer markdown-it-py pygments beautifulsoup4 playwright
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mailify-md
## 简介
轻松将md文件转化为邮箱环境渲染后的html文件

<img src="./rsc/light_demo.gif" alt="light_demo">
<img src="./rsc/dark_demo.gif" alt="dark_demo">

## 安装
```bash
# 安装包
pip install mailify-md
# 安装浏览器依赖:
playwright install --with-deps
```

## 快速开始
```bash
# 用法一: 在原目录下生成同名 .html 文件
mailify-md test.md

# 用法二: 在指定输出目录下生成同名 .html 文件
mailify-md test.md ./output/

# 用法三: 指定输出文件名字和路径
mailify-md test.md ./output/email.html
```

## 功能特色
- 结果美观:
  - 支持自定义 css 美化
  - 支持latex
  - 支持代码块(支持代码高亮)
  - 针对电脑和手机显示做了优化
- 简单易用:
  - 一行命令得到可直接在email使用的html文件
  - 内置一些精美样式
- 支持全面:
  - 自动处理远程和本地图片
  - 支持svg, gif, png等各种图片格式自动内嵌(无需修改你的md文件中的路径)

## 命令行用法

`mailify-md [OPTIONS] INPUT_PATH [OUTPUT_PATH]`

**参数:**
- `INPUT_PATH`:  必须项,你的 Markdown 文件路径。
- `OUTPUT_PATH`: 可选项,可以是输出目录或完整的文件路径。
  - 如果是目录,则输出文件名与输入文件相同。
  - 如果省略,则输出在输入文件旁边。

**可选项:**
- `-t, --theme TEXT`:  设置主题。可以是 `light`, `dark`, 或一个自定义 CSS 文件的路径。
  - 示例: `mailify-md test.md -t dark`
  - 示例: `mailify-md test.md -t ./my-style.css`
  - (tip:可参考[内置主题css](./src/mailify_md/data/dark_style_bak.css)设置)

## 作为库使用

你也可以在 Python 代码中直接调用 `mailify_md`: `from mailify_md import mailify_md`




<!-- 
<p align="center" style="font-size: 1em; font-style: italic; background: linear-gradient(270deg, #ff8a00, #e52e71, #4a90e2, #43e97b); color: transparent; background-clip: text; font-weight: bold; margin: 4em 0;">
听说你要心仪的老登写邮件?<br>
还不快用 <span style="text-shadow: 0 0 1px rgb(250, 171, 0), 0 0 0px rgb(254, 51, 0);">mailify-md</span> 炫染你的E妹儿,多种花样送给亲。
</p> -->

<p align="center">
    <img src="./rsc/demo.svg" alt="demo" style="max-height: 50px;">
</p>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mailify-md",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "markdown, email, html, converter, katex",
    "author": "2bitbit",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/96/6a/9327156c6d634b3de3532fc69b2ee49d587ec01913b83713d147eccbaae2/mailify_md-0.1.5.tar.gz",
    "platform": null,
    "description": "# mailify-md\n## \u7b80\u4ecb\n\u8f7b\u677e\u5c06md\u6587\u4ef6\u8f6c\u5316\u4e3a\u90ae\u7bb1\u73af\u5883\u6e32\u67d3\u540e\u7684html\u6587\u4ef6\n\n<img src=\"./rsc/light_demo.gif\" alt=\"light_demo\">\n<img src=\"./rsc/dark_demo.gif\" alt=\"dark_demo\">\n\n## \u5b89\u88c5\n```bash\n# \u5b89\u88c5\u5305\npip install mailify-md\n# \u5b89\u88c5\u6d4f\u89c8\u5668\u4f9d\u8d56:\nplaywright install --with-deps\n```\n\n## \u5feb\u901f\u5f00\u59cb\n```bash\n# \u7528\u6cd5\u4e00: \u5728\u539f\u76ee\u5f55\u4e0b\u751f\u6210\u540c\u540d .html \u6587\u4ef6\nmailify-md test.md\n\n# \u7528\u6cd5\u4e8c: \u5728\u6307\u5b9a\u8f93\u51fa\u76ee\u5f55\u4e0b\u751f\u6210\u540c\u540d .html \u6587\u4ef6\nmailify-md test.md ./output/\n\n# \u7528\u6cd5\u4e09: \u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u5b57\u548c\u8def\u5f84\nmailify-md test.md ./output/email.html\n```\n\n## \u529f\u80fd\u7279\u8272\n- \u7ed3\u679c\u7f8e\u89c2:\n  - \u652f\u6301\u81ea\u5b9a\u4e49 css \u7f8e\u5316\n  - \u652f\u6301latex\n  - \u652f\u6301\u4ee3\u7801\u5757(\u652f\u6301\u4ee3\u7801\u9ad8\u4eae)\n  - \u9488\u5bf9\u7535\u8111\u548c\u624b\u673a\u663e\u793a\u505a\u4e86\u4f18\u5316\n- \u7b80\u5355\u6613\u7528:\n  - \u4e00\u884c\u547d\u4ee4\u5f97\u5230\u53ef\u76f4\u63a5\u5728email\u4f7f\u7528\u7684html\u6587\u4ef6\n  - \u5185\u7f6e\u4e00\u4e9b\u7cbe\u7f8e\u6837\u5f0f\n- \u652f\u6301\u5168\u9762:\n  - \u81ea\u52a8\u5904\u7406\u8fdc\u7a0b\u548c\u672c\u5730\u56fe\u7247\n  - \u652f\u6301svg, gif, png\u7b49\u5404\u79cd\u56fe\u7247\u683c\u5f0f\u81ea\u52a8\u5185\u5d4c(\u65e0\u9700\u4fee\u6539\u4f60\u7684md\u6587\u4ef6\u4e2d\u7684\u8def\u5f84)\n\n## \u547d\u4ee4\u884c\u7528\u6cd5\n\n`mailify-md [OPTIONS] INPUT_PATH [OUTPUT_PATH]`\n\n**\u53c2\u6570:**\n- `INPUT_PATH`:  \u5fc5\u987b\u9879\uff0c\u4f60\u7684 Markdown \u6587\u4ef6\u8def\u5f84\u3002\n- `OUTPUT_PATH`: \u53ef\u9009\u9879\uff0c\u53ef\u4ee5\u662f\u8f93\u51fa\u76ee\u5f55\u6216\u5b8c\u6574\u7684\u6587\u4ef6\u8def\u5f84\u3002\n  - \u5982\u679c\u662f\u76ee\u5f55\uff0c\u5219\u8f93\u51fa\u6587\u4ef6\u540d\u4e0e\u8f93\u5165\u6587\u4ef6\u76f8\u540c\u3002\n  - \u5982\u679c\u7701\u7565\uff0c\u5219\u8f93\u51fa\u5728\u8f93\u5165\u6587\u4ef6\u65c1\u8fb9\u3002\n\n**\u53ef\u9009\u9879:**\n- `-t, --theme TEXT`:  \u8bbe\u7f6e\u4e3b\u9898\u3002\u53ef\u4ee5\u662f `light`, `dark`, \u6216\u4e00\u4e2a\u81ea\u5b9a\u4e49 CSS \u6587\u4ef6\u7684\u8def\u5f84\u3002\n  - \u793a\u4f8b: `mailify-md test.md -t dark`\n  - \u793a\u4f8b: `mailify-md test.md -t ./my-style.css`\n  - (tip\uff1a\u53ef\u53c2\u8003[\u5185\u7f6e\u4e3b\u9898css](./src/mailify_md/data/dark_style_bak.css)\u8bbe\u7f6e)\n\n## \u4f5c\u4e3a\u5e93\u4f7f\u7528\n\n\u4f60\u4e5f\u53ef\u4ee5\u5728 Python \u4ee3\u7801\u4e2d\u76f4\u63a5\u8c03\u7528 `mailify_md`: `from mailify_md import mailify_md`\n\n\n\n\n<!-- \n<p align=\"center\" style=\"font-size: 1em; font-style: italic; background: linear-gradient(270deg, #ff8a00, #e52e71, #4a90e2, #43e97b); color: transparent; background-clip: text; font-weight: bold; margin: 4em 0;\">\n\u542c\u8bf4\u4f60\u8981\u5fc3\u4eea\u7684\u8001\u767b\u5199\u90ae\u4ef6\uff1f<br>\n\u8fd8\u4e0d\u5feb\u7528 <span style=\"text-shadow: 0 0 1px rgb(250, 171, 0), 0 0 0px rgb(254, 51, 0);\">mailify-md</span> \u70ab\u67d3\u4f60\u7684E\u59b9\u513f\uff0c\u591a\u79cd\u82b1\u6837\u9001\u7ed9\u4eb2\u3002\n</p> -->\n\n<p align=\"center\">\n    <img src=\"./rsc/demo.svg\" alt=\"demo\" style=\"max-height: 50px;\">\n</p>\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 2bitbit\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "\u4e00\u4e2a\u5c06 Markdown \u6587\u4ef6\u8f6c\u6362\u4e3a\u9002\u5408\u7535\u5b50\u90ae\u4ef6\u7684 HTML \u7684\u5de5\u5177\uff0c\u5e76\u652f\u6301\u81ea\u5b9a\u4e49 CSS ",
    "version": "0.1.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/2bitbit/mailify-md/issues",
        "Homepage": "https://github.com/2bitbit/mailify-md"
    },
    "split_keywords": [
        "markdown",
        " email",
        " html",
        " converter",
        " katex"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "aa6dfff87697770b000fa659f40665d57c81752a4a56c99813ee7a6d4c1f432e",
                "md5": "621bdac712a02e9e589c433cbcf1bdbf",
                "sha256": "a8d324fdc30cc3e83262476f4ce1d8cc31a8a7a253f677d0bd23c6455d5a571f"
            },
            "downloads": -1,
            "filename": "mailify_md-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "621bdac712a02e9e589c433cbcf1bdbf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 358259,
            "upload_time": "2025-07-12T05:38:39",
            "upload_time_iso_8601": "2025-07-12T05:38:39.405906Z",
            "url": "https://files.pythonhosted.org/packages/aa/6d/fff87697770b000fa659f40665d57c81752a4a56c99813ee7a6d4c1f432e/mailify_md-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "966a9327156c6d634b3de3532fc69b2ee49d587ec01913b83713d147eccbaae2",
                "md5": "eaee23b0d2071d888a64f094cafb28fd",
                "sha256": "2fc92c1d1d3ed5def765bc0757677feee522c7c6a257525587b714e702528b11"
            },
            "downloads": -1,
            "filename": "mailify_md-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "eaee23b0d2071d888a64f094cafb28fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 359342,
            "upload_time": "2025-07-12T05:38:41",
            "upload_time_iso_8601": "2025-07-12T05:38:41.015707Z",
            "url": "https://files.pythonhosted.org/packages/96/6a/9327156c6d634b3de3532fc69b2ee49d587ec01913b83713d147eccbaae2/mailify_md-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 05:38:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "2bitbit",
    "github_project": "mailify-md",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "cairosvg",
            "specs": []
        },
        {
            "name": "Requests",
            "specs": []
        },
        {
            "name": "premailer",
            "specs": []
        },
        {
            "name": "Pygments",
            "specs": []
        },
        {
            "name": "typer",
            "specs": []
        },
        {
            "name": "markdown-it-py",
            "specs": []
        },
        {
            "name": "pygments",
            "specs": []
        },
        {
            "name": "beautifulsoup4",
            "specs": []
        },
        {
            "name": "playwright",
            "specs": []
        }
    ],
    "lcname": "mailify-md"
}
        
Elapsed time: 0.52477s