Skip to main content

A tool that formats markdown text in Chinese.

Project description

prettymd

A tool that formats markdown text in Chinese.

Install

  • 从 pypi 安装
    pip install prettymd
    

Features

  • 在中英文之间添加空格

    $ python -m prettymd "我是中文nihao呀"
    我是中文 nihao 
  • 将英文变为代码风格。指定 style = 'code',将英文用反引号包裹起来

    $ python -m prettymd "我是中文nihao呀" -s code
    我是中文 `nihao` 
  • 从文件读取内容

    $ cat .\tests\testfile.md
    摘要算法就是通过摘要函数f()对任意长度的数据data计算出固定长度的摘要digest,目的是为了发现原始数据是否被人篡改过。
    
    $ python -m prettymd -f .\tests\testfile.md
    摘要算法就是通过摘要函数 f() 对任意长度的数据 data 计算出固定长度的摘要 digest,目的是为了发现原始数据是否被人篡改过。
    
  • 输出到指定文件

    $ # -o 指定输出文件路径
    $ python -m prettymd -f .\tests\testfile.md -o testfile.md
    
    $ cat testfile.md
    摘要算法就是通过摘要函数 f() 对任意长度的数据 data 计算出固定长度的摘要 digest,目的是为了发现原始数据是否被人篡改过。
    
  • 代码调用

    >>> from prettymd import format
    >>> format('这是一个示例rst文档')
    '这是一个实例 rst 文档'
    
    >>> from prettymd import format
    >>> format('这是一个示例rst文档', style='code')
    '这是一个实例 `rst` 文档'
    
    >>> # 为标题添加索引
    >>> from prettymd import format
    >>> print(format("""
    ## h2
    ### h3
    ## h22
    #### h4
    """))
    
    ## 1. h2
    ### 1.1. h3
    ## 2. h22
    #### 2.0.1. h4
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prettymd-0.1.111.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

prettymd-0.1.111-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file prettymd-0.1.111.tar.gz.

File metadata

  • Download URL: prettymd-0.1.111.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.13

File hashes

Hashes for prettymd-0.1.111.tar.gz
Algorithm Hash digest
SHA256 01afa0cc8c53f9649f30b15a8967f72255953444de0bd5cdde1d2095498de57e
MD5 e6a6994d45a628b9cbd9b1d726ffbcfb
BLAKE2b-256 81cd07563727ff5e45445fdc03893a43771cef5b00341a4a7758058da84b2997

See more details on using hashes here.

File details

Details for the file prettymd-0.1.111-py2.py3-none-any.whl.

File metadata

  • Download URL: prettymd-0.1.111-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for prettymd-0.1.111-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 473738ec082cf10598ab0cf94e6bfa4c1cff31a49e95ea0c1ed572939b2e4e43
MD5 af3d4865deda802c4cac69804c166a49
BLAKE2b-256 f19203dfb5297909e39df41f77ba79cd2d2c4486c1b88945a52fbc91a204f749

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page