Skip to main content

A Subset of Markdown

Project description

submark

Subset of Markdown

This project started as an example project to describe migrating from a script to a package, utilizing flit, tox, coverage, and pytest.

See http://testandcode.com/80 for the story.

Features

  • Convert headings

    • # heading -> <h1> heading </h1>
    • ## heading -> <h2> heading </h2>
    • ### heading -> <h3> heading </h3>
    • #### heading -> <h4> heading </h4>
    • ##### heading -> <h5> heading </h5>
  • Convert strong

    • **strong** -> <strong>strong</strong>
    • __strong__-> <strong>strong</strong>
  • Convert em

    • **something** -> <em>something</em>
    • __something__-> <em>something</em>

Usage

Use it like this:

$ submark something.md > something.html

or:

$ cat something.md | submark > something.html

or:

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

Testing

Test in a virtual environment with the usual incantations.

$ 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

Then install tox.

(submark) $ pip install tox

Now run tests.

(submark) $ tox

Building a wheel

Make sure everything is committed before running flit.

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

Yep. That's it. There should be a wheel now sitting in a dist folder.

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

Deploying

Flit does that too.

(submark) $ flit publish

But don't do that unless:

  • You are Brian Okken

or:

History

  • 0.1 Initial script and tests
  • 0.2 build wheel with flit
  • 0.3 build and test with tox
  • 0.4 move source module into a package directory
  • 0.5 move tests into tests directory
  • 0.6 hook up readme in toml file

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

submark-0.6.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

submark-0.6-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file submark-0.6.tar.gz.

File metadata

  • Download URL: submark-0.6.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for submark-0.6.tar.gz
Algorithm Hash digest
SHA256 a6251e1bbf0f4fa63484a4f43d0caec3e70a513d4f138603075428701f0044cd
MD5 79c826caadfe5e3b3beba8f02d6f2e9c
BLAKE2b-256 e7d026c493bbd8d0bb56e0360c0b07dd447c27a6a6a767b017852c37b838ddc7

See more details on using hashes here.

File details

Details for the file submark-0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: submark-0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for submark-0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2cf9ebb96ab0a3b9946da5633c49ac512433f93c6a009d4f0d8942865d0f0146
MD5 248a07bdc7d6f3f2732553f63294aab9
BLAKE2b-256 f7c499de352e03abe534bd1afea92304d50bad7385f4ad768b60e6bf0cf6b309

See more details on using hashes here.

Supported by

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