跳转到主要内容

Markdown的子集

项目描述

submark

Markdown的子集

此项目最初是一个示例项目,用于描述从脚本迁移到包的过程,利用flit、tox、coverage和pytest。

有关故事,请参阅http://testandcode.com/80

特性

  • 转换标题

    • # 标题 -> <h1> 标题 </h1>
    • ## 标题 -> <h2> 标题 </h2>
    • ### 标题 -> <h3> 标题 </h3>
    • #### 标题 -> <h4> 标题 </h4>
    • ##### 标题 -> <h5> 标题 </h5>
  • 转换加粗

    • **加粗** -> <strong>加粗</strong>
    • __加粗__-> <strong>加粗</strong>
  • 转换斜体

    • **内容** -> <em>内容</em>
    • __内容__-> <em>内容</em>
  • 链接

    • [消息](http://some.link.html "我的标题")
      -> <a href="http://some.link.html" title="我的标题">消息</a>
    • [消息](http://some.link.html)
      -> <a href="http://some.link.html">消息</a>
  • 图片

    • ![替代文本](/some/image.png "标题")
      -> <img src="/some/image.png" title="标题"/>
  • 内联代码

    • this is `some code`
      -> this is <code>some code</code>
  • 带有两个空格结束文本的换行

  • 水平线,3个或更多短横线

    • --- -> <hr>

用法

使用方法如下

$ submark something.md > something.html

$ cat something.md | submark > something.html

$ echo '**hi**' | submark
<strong>hi</strong>

开发和测试虚拟环境

测试和开发应该在虚拟环境中进行。

$ git clone https://github.com/okken/submark.git
$ cd submark
$ python3 -m venv venv --prompt submark
$ source venv/bin/activate
(submark) $ pip install -U pip

测试

测试使用tox进行。

(submark) $ pip install tox
(submark) $ tox

开发

开发需要一些工具。在本地安装submark,并使用flit安装开发工具。

(submark) $ pip install flit
(submark) $ flit install --pth-file

然后您可以使用pytest在本地测试任何更改。

(submark) $ pytest --cov=submark 

准备好作为已安装包测试一切时

(submark) $ tox

构建wheel

在运行flit之前请确保已提交所有内容。

(submark) $ pip install flit
(submark) $ flit build

是的。就是这样。现在应该有一个轮子在 dist 文件夹中。

(submark) $ ls dist
submark-0.5-py2.py3-none-any.whl
submark-0.5.tar.gz

正在部署

Flit 也这样做。

(submark) $ flit publish

除非

  • 你是 Brian Okken

历史记录

  • 0.1 初始脚本和测试
  • 0.2 使用 flit 构建wheel
  • 0.3 使用 tox 构建 和 测试
  • 0.4 将源模块移动到包目录中
  • 0.5 将测试移动到测试目录中
  • 0.6 将 readme 与 toml 文件关联
  • 0.7
    • 使用 requires-extra 开发 flit
    • 支持链接、图片、内联代码、换行、水平线

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分布

submark-0.7.tar.gz (4.9 kB 查看哈希值)

上传时间

构建分布

submark-0.7-py2.py3-none-any.whl (6.6 kB 查看哈希值)

上传时间 Python 2 Python 3

支持者

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误记录StatusPageStatusPage状态页面