conwaymd 5.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- conwaymd-5.0.0/PKG-INFO +128 -0
- conwaymd-5.0.0/README.md +110 -0
- conwaymd-5.0.0/conwaymd/__init__.py +0 -0
- conwaymd-5.0.0/conwaymd/_version.py +1 -0
- conwaymd-5.0.0/conwaymd/authorities.py +1944 -0
- conwaymd-5.0.0/conwaymd/bases.py +384 -0
- conwaymd-5.0.0/conwaymd/cli.py +132 -0
- conwaymd-5.0.0/conwaymd/constants.py +435 -0
- conwaymd-5.0.0/conwaymd/core.py +88 -0
- conwaymd-5.0.0/conwaymd/employables.py +1922 -0
- conwaymd-5.0.0/conwaymd/exceptions.py +28 -0
- conwaymd-5.0.0/conwaymd/idioms.py +349 -0
- conwaymd-5.0.0/conwaymd/placeholders.py +120 -0
- conwaymd-5.0.0/conwaymd/references.py +67 -0
- conwaymd-5.0.0/conwaymd/utilities.py +98 -0
- conwaymd-5.0.0/pyproject.toml +29 -0
conwaymd-5.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: conwaymd
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: Conway-Markdown (conwaymd, CMD)
|
|
5
|
+
Keywords: conway-markdown,html5
|
|
6
|
+
Author-email: Conway <pypi.sheep257@passmail.net>
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT No Attribution License (MIT-0)
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Project-URL: changelog, https://github.com/conwaymd/conwaymd/blob/master/CHANGELOG.md
|
|
15
|
+
Project-URL: issues, https://github.com/conwaymd/conwaymd/issues
|
|
16
|
+
Project-URL: repository, https://github.com/conwaymd/conwaymd
|
|
17
|
+
|
|
18
|
+
# Conway-Markdown (conwaymd, CMD)
|
|
19
|
+
|
|
20
|
+
Conway-Markdown is:
|
|
21
|
+
|
|
22
|
+
- A replacement-driven markup language inspired by Markdown.
|
|
23
|
+
- A demonstration of the folly of throwing regex at a parsing problem.
|
|
24
|
+
- The result of someone joking that "the filenames would look like Windows executables from the 90s".
|
|
25
|
+
- Implemented in [Python 3.{whatever Debian stable is at}][python3].
|
|
26
|
+
- Licensed under "MIT No Attribution" (MIT-0), see [LICENSE].
|
|
27
|
+
|
|
28
|
+
For detailed documentation, see <<https://conwaymd.github.io/>>.
|
|
29
|
+
|
|
30
|
+
[python3]: https://packages.debian.org/stable/python3
|
|
31
|
+
[LICENSE]: LICENSE
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
$ pip3 install conwaymd
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## Usage (command line)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
$ cmd [-h] [-v] [-a] [-x] [file.cmd ...]
|
|
45
|
+
|
|
46
|
+
Convert Conway-Markdown (CMD) to HTML.
|
|
47
|
+
|
|
48
|
+
positional arguments:
|
|
49
|
+
file.cmd name of CMD file to be converted (can be abbreviated as
|
|
50
|
+
`file` or `file.` for increased productivity)
|
|
51
|
+
|
|
52
|
+
options:
|
|
53
|
+
-h, --help show this help message and exit
|
|
54
|
+
-v, --version show program's version number and exit
|
|
55
|
+
-a, --all convert all CMD files under the working directory
|
|
56
|
+
-x, --verbose run in verbose mode (prints every replacement applied)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
On Windows:
|
|
60
|
+
- Use the aliases `cmd-` or `conwaymd` instead of `cmd` to avoid summoning Command Prompt.
|
|
61
|
+
- **Beware not to run any `.cmd` files by accident; they might break your computer. God save!**
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Usage (scripting example)
|
|
65
|
+
|
|
66
|
+
Code:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from conwaymd.core import cmd_to_html
|
|
70
|
+
|
|
71
|
+
cmd_content = '''
|
|
72
|
+
# Test
|
|
73
|
+
==
|
|
74
|
+
- This is a *near*-minimal test.
|
|
75
|
+
- Here be [__dragons__].
|
|
76
|
+
==
|
|
77
|
+
[__dragons__]: https://example.com/
|
|
78
|
+
'''
|
|
79
|
+
|
|
80
|
+
html_content = cmd_to_html(cmd_content, cmd_file_name='scripting-test.py')
|
|
81
|
+
|
|
82
|
+
print(html_content)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Output:
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<!DOCTYPE html>
|
|
89
|
+
<html lang="en">
|
|
90
|
+
<head>
|
|
91
|
+
<meta charset="utf-8">
|
|
92
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
93
|
+
<title>Title</title>
|
|
94
|
+
</head>
|
|
95
|
+
<body>
|
|
96
|
+
<h1>Test</h1>
|
|
97
|
+
<ul>
|
|
98
|
+
<li>
|
|
99
|
+
This is a <em>near</em>-minimal test.
|
|
100
|
+
</li>
|
|
101
|
+
<li>
|
|
102
|
+
Here be <a href="https://example.com/"><b>dragons</b></a>.
|
|
103
|
+
</li>
|
|
104
|
+
</ul>
|
|
105
|
+
</body>
|
|
106
|
+
</html>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Features
|
|
111
|
+
|
|
112
|
+
- [Specify element attributes] (e.g. `id` and `class`)
|
|
113
|
+
- [Write arbitrary text outside code]
|
|
114
|
+
- [Use `<b>`, `<i>`, and `<cite>` elements], not just `<strong>` and `<em>`
|
|
115
|
+
- [Use `<div>` elements] without falling back to HTML
|
|
116
|
+
- [Define your own syntax] as you go
|
|
117
|
+
|
|
118
|
+
[Specify element attributes]:
|
|
119
|
+
https://conwaymd.github.io/#cmd-attribute-specifications
|
|
120
|
+
[Write arbitrary text outside code]:
|
|
121
|
+
https://conwaymd.github.io/#literals
|
|
122
|
+
[Use `<b>`, `<i>`, and `<cite>` elements]:
|
|
123
|
+
https://conwaymd.github.io/#inline-semantics
|
|
124
|
+
[Use `<div>` elements]:
|
|
125
|
+
https://conwaymd.github.io/#divisions
|
|
126
|
+
[Define your own syntax]:
|
|
127
|
+
https://conwaymd.github.io/#replacement-rule-syntax
|
|
128
|
+
|
conwaymd-5.0.0/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Conway-Markdown (conwaymd, CMD)
|
|
2
|
+
|
|
3
|
+
Conway-Markdown is:
|
|
4
|
+
|
|
5
|
+
- A replacement-driven markup language inspired by Markdown.
|
|
6
|
+
- A demonstration of the folly of throwing regex at a parsing problem.
|
|
7
|
+
- The result of someone joking that "the filenames would look like Windows executables from the 90s".
|
|
8
|
+
- Implemented in [Python 3.{whatever Debian stable is at}][python3].
|
|
9
|
+
- Licensed under "MIT No Attribution" (MIT-0), see [LICENSE].
|
|
10
|
+
|
|
11
|
+
For detailed documentation, see <<https://conwaymd.github.io/>>.
|
|
12
|
+
|
|
13
|
+
[python3]: https://packages.debian.org/stable/python3
|
|
14
|
+
[LICENSE]: LICENSE
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
$ pip3 install conwaymd
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Usage (command line)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
$ cmd [-h] [-v] [-a] [-x] [file.cmd ...]
|
|
28
|
+
|
|
29
|
+
Convert Conway-Markdown (CMD) to HTML.
|
|
30
|
+
|
|
31
|
+
positional arguments:
|
|
32
|
+
file.cmd name of CMD file to be converted (can be abbreviated as
|
|
33
|
+
`file` or `file.` for increased productivity)
|
|
34
|
+
|
|
35
|
+
options:
|
|
36
|
+
-h, --help show this help message and exit
|
|
37
|
+
-v, --version show program's version number and exit
|
|
38
|
+
-a, --all convert all CMD files under the working directory
|
|
39
|
+
-x, --verbose run in verbose mode (prints every replacement applied)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
On Windows:
|
|
43
|
+
- Use the aliases `cmd-` or `conwaymd` instead of `cmd` to avoid summoning Command Prompt.
|
|
44
|
+
- **Beware not to run any `.cmd` files by accident; they might break your computer. God save!**
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Usage (scripting example)
|
|
48
|
+
|
|
49
|
+
Code:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from conwaymd.core import cmd_to_html
|
|
53
|
+
|
|
54
|
+
cmd_content = '''
|
|
55
|
+
# Test
|
|
56
|
+
==
|
|
57
|
+
- This is a *near*-minimal test.
|
|
58
|
+
- Here be [__dragons__].
|
|
59
|
+
==
|
|
60
|
+
[__dragons__]: https://example.com/
|
|
61
|
+
'''
|
|
62
|
+
|
|
63
|
+
html_content = cmd_to_html(cmd_content, cmd_file_name='scripting-test.py')
|
|
64
|
+
|
|
65
|
+
print(html_content)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Output:
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<!DOCTYPE html>
|
|
72
|
+
<html lang="en">
|
|
73
|
+
<head>
|
|
74
|
+
<meta charset="utf-8">
|
|
75
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
76
|
+
<title>Title</title>
|
|
77
|
+
</head>
|
|
78
|
+
<body>
|
|
79
|
+
<h1>Test</h1>
|
|
80
|
+
<ul>
|
|
81
|
+
<li>
|
|
82
|
+
This is a <em>near</em>-minimal test.
|
|
83
|
+
</li>
|
|
84
|
+
<li>
|
|
85
|
+
Here be <a href="https://example.com/"><b>dragons</b></a>.
|
|
86
|
+
</li>
|
|
87
|
+
</ul>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## Features
|
|
94
|
+
|
|
95
|
+
- [Specify element attributes] (e.g. `id` and `class`)
|
|
96
|
+
- [Write arbitrary text outside code]
|
|
97
|
+
- [Use `<b>`, `<i>`, and `<cite>` elements], not just `<strong>` and `<em>`
|
|
98
|
+
- [Use `<div>` elements] without falling back to HTML
|
|
99
|
+
- [Define your own syntax] as you go
|
|
100
|
+
|
|
101
|
+
[Specify element attributes]:
|
|
102
|
+
https://conwaymd.github.io/#cmd-attribute-specifications
|
|
103
|
+
[Write arbitrary text outside code]:
|
|
104
|
+
https://conwaymd.github.io/#literals
|
|
105
|
+
[Use `<b>`, `<i>`, and `<cite>` elements]:
|
|
106
|
+
https://conwaymd.github.io/#inline-semantics
|
|
107
|
+
[Use `<div>` elements]:
|
|
108
|
+
https://conwaymd.github.io/#divisions
|
|
109
|
+
[Define your own syntax]:
|
|
110
|
+
https://conwaymd.github.io/#replacement-rule-syntax
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '5.0.0'
|