项目概述
Convert HTML to Markdown-formatted text.
项目地址
https://github.com/Alir3z4/html2text
项目页面预览

关键指标
- Stars:2117
- 主要语言:Python
- License:GNU General Public License v3.0
- 最近更新:2025-10-28T11:03:41Z
- 默认分支:master
本站高速下载(国内可用)
点击下载(本站镜像)
– SHA256:c27a113dedfc4fcc143ca9b15ca695d73ed0906cfa864497607fc4f1b9b8b9b6
安装部署要点(README 精选)
How to install
html2text is available on pypi
https://pypi.org/project/html2text/
$ pip install html2text
How to run unit tests
$ tox
To see the coverage results:
$ coverage html
then open the ./htmlcov/index.html file in your browser.
常用命令(从 README 提取)
>>> import html2text
>>>
>>> print(html2text.html2text("<p><strong>Zed's</strong> dead baby, <em>Zed's</em> dead.</p>"))
**Zed's** dead baby, _Zed's_ dead.
>>> import html2text
>>>
>>> h = html2text.HTML2Text()
>>> # Ignore converting links from HTML
>>> h.ignore_links = True
>>> print(h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!"))
Hello, world!
>>> print(h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!"))
Hello, world!
>>> # Don't Ignore links anymore, I like links
>>> h.ignore_links = False
>>> print(h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!"))
Hello, [world](https://www.google.com/earth/)!
$ pip install html2text
通用部署说明
- 下载源码并阅读 README
- 安装依赖(pip/npm/yarn 等)
- 配置环境变量(API Key、模型路径、数据库等)
- 启动服务并测试访问
- 上线建议:Nginx 反代 + HTTPS + 进程守护(systemd / pm2)
免责声明与版权说明
本文仅做开源项目整理与教程索引,源码版权归原作者所有,请遵循对应 License 合规使用。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END








暂无评论内容