Skip to main content

Conway-Markdown (conwaymd, CMD)

Project description

Conway-Markdown (conwaymd, CMD)

Conway-Markdown is:

  • A replacement-driven markup language inspired by Markdown.
  • A demonstration of the folly of throwing regex at a parsing problem.
  • The result of someone joking that "the filenames would look like Windows executables from the 90s".
  • Implemented in Python 3.{whatever Debian stable is at}.
  • Licensed under "MIT No Attribution" (MIT-0), see LICENSE.

For detailed documentation, see <https://conwaymd.github.io/>.

Installation

Conway-Markdown is published to PyPI as conwaymd:

$ pip3 install conwaymd

On Windows, use pip instead of pip3.

Usage (command line)

$ cmd [-h] [-v] [-a] [-x] [file.cmd ...]

Convert Conway-Markdown (CMD) to HTML.

positional arguments:
  file.cmd       name of CMD file to be converted (can be abbreviated as
                 `file` or `file.` for increased productivity)

options:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit
  -a, --all      convert all CMD files under the working directory
  -x, --verbose  run in verbose mode (prints every replacement applied)

On Windows:

  • Use the aliases cmd- or conwaymd instead of cmd to avoid summoning Command Prompt.
  • Beware not to run any .cmd files by accident; they might break your computer. God save!

Usage (scripting example)

Code:

from conwaymd.core import cmd_to_html

cmd_content = '''
# Test
==
- This is a *near*-minimal test.
- Here be [__dragons__].
==
[__dragons__]: https://example.com/
'''

html_content = cmd_to_html(cmd_content, cmd_file_name='scripting-test.py')

print(html_content)

Output:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
</head>
<body>
<h1>Test</h1>
<ul>
<li>
This is a <em>near</em>-minimal test.
</li>
<li>
Here be <a href="https://example.com/"><b>dragons</b></a>.
</li>
</ul>
</body>
</html>

Features

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

conwaymd-5.0.1.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

conwaymd-5.0.1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file conwaymd-5.0.1.tar.gz.

File metadata

  • Download URL: conwaymd-5.0.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for conwaymd-5.0.1.tar.gz
Algorithm Hash digest
SHA256 dd065ff1e5ab6a7cd8e6623cc0cd07747f4a44804b53e6450c7fd11e4c878856
MD5 58f31346f344be1e6ebd862f285153c2
BLAKE2b-256 0ac129a53bfd0ff21b34e0d0ada51ac79909683edf58f91db8da4cf5c1304cd3

See more details on using hashes here.

File details

Details for the file conwaymd-5.0.1-py3-none-any.whl.

File metadata

  • Download URL: conwaymd-5.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for conwaymd-5.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55211581d122532f7bcfdbe8e8531caea691c0781a4b9846a1f18b462c80a01d
MD5 ae96bd15e0dc474a7709bf73befb802f
BLAKE2b-256 849044d0e7c1fbfd3b2242ada3d90108c832758ff3c831d55b1640d76653f61b

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