md2linkedin 0.3.0__tar.gz → 0.4.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.
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/PKG-INFO +15 -3
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/README.md +14 -2
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/pyproject.toml +11 -3
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/pyproject.toml.orig +24 -2
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/src/md2linkedin/__init__.py +1 -1
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/src/md2linkedin/_cli.py +2 -6
- md2linkedin-0.4.0/src/md2linkedin/_converter.py +738 -0
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/src/md2linkedin/_unicode.py +3 -10
- md2linkedin-0.3.0/src/md2linkedin/_converter.py +0 -578
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/LICENSE.md +0 -0
- {md2linkedin-0.3.0 → md2linkedin-0.4.0}/src/md2linkedin/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: md2linkedin
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Convert Markdown to LinkedIn-friendly Unicode text
|
|
5
5
|
Keywords: markdown,linkedin,unicode,formatting,conversion
|
|
6
6
|
Author: Indrajeet Patil
|
|
@@ -129,7 +129,8 @@ md2linkedin post.md --no-monospace-code
|
|
|
129
129
|
- **Links**: stripped to display text by default; `--preserve-links`
|
|
130
130
|
retains URLs
|
|
131
131
|
- **Images**: replaced by alt text
|
|
132
|
-
- **Bullet lists**: `-`/`*`/`+` → `•`; nested items
|
|
132
|
+
- **Bullet lists**: `-`/`*`/`+` → `•`; nested items get one marker per
|
|
133
|
+
level (`‣`, `◦`, `▪`)
|
|
133
134
|
- **Blockquotes**: leading `>` stripped
|
|
134
135
|
- **HTML spans**: unwrapped, inner text preserved
|
|
135
136
|
- **HTML entities**: decoded (`&` → `&`, etc.)
|
|
@@ -158,13 +159,24 @@ notable limitations:
|
|
|
158
159
|
- **Searchability**: Text styled with these Unicode characters may not
|
|
159
160
|
be indexed properly by LinkedIn’s search algorithm, meaning people
|
|
160
161
|
searching for your keywords might not find your post.
|
|
162
|
+
- **Markdown parsing**: The converter is a pipeline of regular
|
|
163
|
+
expressions, not a CommonMark parser. Ordinary posts convert
|
|
164
|
+
faithfully, but constructs whose meaning depends on their surroundings
|
|
165
|
+
— indented code blocks, nested blockquotes, link reference
|
|
166
|
+
definitions, a thematic break indented inside a list item — are read
|
|
167
|
+
more loosely than a real parser would read them. See [Markdown parsing
|
|
168
|
+
fidelity](https://www.indrapatil.com/md2linkedin/advanced/#markdown-parsing-fidelity)
|
|
169
|
+
for the specifics.
|
|
161
170
|
|
|
162
171
|
For more examples, check out the package documentation at:
|
|
163
172
|
<https://www.indrapatil.com/md2linkedin/>
|
|
164
173
|
|
|
165
174
|
## See Also
|
|
166
175
|
|
|
167
|
-
- [md2linkedin Web
|
|
176
|
+
- [md2linkedin Web
|
|
177
|
+
App](https://019d695e-8448-ee38-5db3-7ca4acf2ce2c.share.connect.posit.cloud/)
|
|
178
|
+
— an interactive web interface for `md2linkedin`, built by [Yann
|
|
179
|
+
Cohen](https://github.com/iamYannC).
|
|
168
180
|
|
|
169
181
|
## License
|
|
170
182
|
|
|
@@ -97,7 +97,8 @@ md2linkedin post.md --no-monospace-code
|
|
|
97
97
|
- **Links**: stripped to display text by default; `--preserve-links`
|
|
98
98
|
retains URLs
|
|
99
99
|
- **Images**: replaced by alt text
|
|
100
|
-
- **Bullet lists**: `-`/`*`/`+` → `•`; nested items
|
|
100
|
+
- **Bullet lists**: `-`/`*`/`+` → `•`; nested items get one marker per
|
|
101
|
+
level (`‣`, `◦`, `▪`)
|
|
101
102
|
- **Blockquotes**: leading `>` stripped
|
|
102
103
|
- **HTML spans**: unwrapped, inner text preserved
|
|
103
104
|
- **HTML entities**: decoded (`&` → `&`, etc.)
|
|
@@ -126,13 +127,24 @@ notable limitations:
|
|
|
126
127
|
- **Searchability**: Text styled with these Unicode characters may not
|
|
127
128
|
be indexed properly by LinkedIn’s search algorithm, meaning people
|
|
128
129
|
searching for your keywords might not find your post.
|
|
130
|
+
- **Markdown parsing**: The converter is a pipeline of regular
|
|
131
|
+
expressions, not a CommonMark parser. Ordinary posts convert
|
|
132
|
+
faithfully, but constructs whose meaning depends on their surroundings
|
|
133
|
+
— indented code blocks, nested blockquotes, link reference
|
|
134
|
+
definitions, a thematic break indented inside a list item — are read
|
|
135
|
+
more loosely than a real parser would read them. See [Markdown parsing
|
|
136
|
+
fidelity](https://www.indrapatil.com/md2linkedin/advanced/#markdown-parsing-fidelity)
|
|
137
|
+
for the specifics.
|
|
129
138
|
|
|
130
139
|
For more examples, check out the package documentation at:
|
|
131
140
|
<https://www.indrapatil.com/md2linkedin/>
|
|
132
141
|
|
|
133
142
|
## See Also
|
|
134
143
|
|
|
135
|
-
- [md2linkedin Web
|
|
144
|
+
- [md2linkedin Web
|
|
145
|
+
App](https://019d695e-8448-ee38-5db3-7ca4acf2ce2c.share.connect.posit.cloud/)
|
|
146
|
+
— an interactive web interface for `md2linkedin`, built by [Yann
|
|
147
|
+
Cohen](https://github.com/iamYannC).
|
|
136
148
|
|
|
137
149
|
## License
|
|
138
150
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "md2linkedin"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "Convert Markdown to LinkedIn-friendly Unicode text"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -53,6 +53,7 @@ dev = [
|
|
|
53
53
|
"mkdocstrings-python>=2.0.8",
|
|
54
54
|
"mutmut>=3.8.0",
|
|
55
55
|
"prek>=0.5.3",
|
|
56
|
+
"pyrefly>=1.3.1",
|
|
56
57
|
"pytest>=9.1.1",
|
|
57
58
|
"pytest-codspeed==5.0.3",
|
|
58
59
|
"pytest-cov>=7.1.0",
|
|
@@ -60,7 +61,7 @@ dev = [
|
|
|
60
61
|
"pyyaml>=6.0.3",
|
|
61
62
|
"ruff>=0.16.8",
|
|
62
63
|
"ty>=0.0.82",
|
|
63
|
-
"zensical>=0.0.
|
|
64
|
+
"zensical>=0.0.63",
|
|
64
65
|
]
|
|
65
66
|
|
|
66
67
|
[build-system]
|
|
@@ -81,6 +82,9 @@ ignore = [
|
|
|
81
82
|
"CPY",
|
|
82
83
|
"ambiguous-unicode-character-docstring",
|
|
83
84
|
"ambiguous-unicode-character-comment",
|
|
85
|
+
"docstring-missing-returns",
|
|
86
|
+
"docstring-missing-yields",
|
|
87
|
+
"docstring-missing-exception",
|
|
84
88
|
]
|
|
85
89
|
|
|
86
90
|
[tool.ruff.lint.per-file-ignores]
|
|
@@ -132,7 +136,11 @@ source_paths = ["src/md2linkedin/"]
|
|
|
132
136
|
also_copy = ["scripts/"]
|
|
133
137
|
pytest_add_cli_args_test_selection = ["tests/"]
|
|
134
138
|
mutate_only_covered_lines = true
|
|
135
|
-
do_not_mutate_patterns = [
|
|
139
|
+
do_not_mutate_patterns = [
|
|
140
|
+
'closing_fence = rest\.rfind\(fence\)',
|
|
141
|
+
"pos = 0",
|
|
142
|
+
'previous_start = text\.rfind',
|
|
143
|
+
]
|
|
136
144
|
|
|
137
145
|
[tool.ty.src]
|
|
138
146
|
exclude = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "md2linkedin"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = "Convert Markdown to LinkedIn-friendly Unicode text"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -48,6 +48,7 @@ dev = [
|
|
|
48
48
|
"mkdocstrings-python>=2.0.8",
|
|
49
49
|
"mutmut>=3.8.0",
|
|
50
50
|
"prek>=0.5.3",
|
|
51
|
+
"pyrefly>=1.3.1",
|
|
51
52
|
"pytest>=9.1.1",
|
|
52
53
|
"pytest-codspeed==5.0.3",
|
|
53
54
|
"pytest-cov>=7.1.0",
|
|
@@ -55,7 +56,7 @@ dev = [
|
|
|
55
56
|
"pyyaml>=6.0.3",
|
|
56
57
|
"ruff>=0.16.8",
|
|
57
58
|
"ty>=0.0.82",
|
|
58
|
-
"zensical>=0.0.
|
|
59
|
+
"zensical>=0.0.63",
|
|
59
60
|
]
|
|
60
61
|
|
|
61
62
|
[build-system]
|
|
@@ -81,6 +82,14 @@ ignore = [
|
|
|
81
82
|
# docstring examples and block-comment separators is intentional.
|
|
82
83
|
"ambiguous-unicode-character-docstring",
|
|
83
84
|
"ambiguous-unicode-character-comment",
|
|
85
|
+
# Internal (underscore-prefixed) functions carry a description-only
|
|
86
|
+
# docstring: no Args/Returns/Raises sections, which would only restate a
|
|
87
|
+
# signature the reader is already looking at. See AGENTS.md. The public
|
|
88
|
+
# API still documents its returns, raises and yields in full; these rules
|
|
89
|
+
# cannot distinguish the two, so that part is upheld in review.
|
|
90
|
+
"docstring-missing-returns",
|
|
91
|
+
"docstring-missing-yields",
|
|
92
|
+
"docstring-missing-exception",
|
|
84
93
|
]
|
|
85
94
|
|
|
86
95
|
[tool.ruff.lint.per-file-ignores]
|
|
@@ -150,6 +159,17 @@ mutate_only_covered_lines = true
|
|
|
150
159
|
# equivalent to ``rest.find(fence)`` because the non-greedy regex that
|
|
151
160
|
# captured the block already trims to the shortest matching span, so
|
|
152
161
|
# no additional ``fence`` marker can appear inside ``rest``.
|
|
162
|
+
# * ``pos = 0`` in ``_convert_bullets`` is equivalent to ``pos = None``
|
|
163
|
+
# because the cursor is only ever used as the lower bound of a slice, and
|
|
164
|
+
# ``text[None:i]`` is ``text[0:i]``. Every later assignment to it is an
|
|
165
|
+
# integer, so no test can tell the two initial values apart.
|
|
166
|
+
# * ``previous_start = text.rfind("\n", 0, end) + 1`` in
|
|
167
|
+
# ``_interrupts_paragraph`` is equivalent to the same call with ``None`` as
|
|
168
|
+
# the lower bound, which is how ``str.rfind`` spells "from the beginning".
|
|
169
|
+
# The line also carries a ``0`` → ``1`` mutation that is *not* equivalent;
|
|
170
|
+
# ``test_block_above_is_read_at_the_top_of_the_document`` is the test that
|
|
171
|
+
# catches it, so the behaviour stays pinned even though this exclusion
|
|
172
|
+
# stops mutmut from generating that mutant.
|
|
153
173
|
#
|
|
154
174
|
# ``encoding=_ENCODING`` mutations (``encoding=None`` / arg-removal) are
|
|
155
175
|
# NOT excluded here — they are covered by focused tests that assert the
|
|
@@ -157,6 +177,8 @@ mutate_only_covered_lines = true
|
|
|
157
177
|
# as real test failures rather than being silently skipped.
|
|
158
178
|
do_not_mutate_patterns = [
|
|
159
179
|
'closing_fence = rest\.rfind\(fence\)',
|
|
180
|
+
'pos = 0',
|
|
181
|
+
'previous_start = text\.rfind',
|
|
160
182
|
]
|
|
161
183
|
|
|
162
184
|
[tool.ty.src]
|
|
@@ -112,13 +112,9 @@ def main(
|
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
def _stdin_is_tty() -> bool:
|
|
115
|
-
"""
|
|
115
|
+
"""Report whether stdin is an interactive terminal.
|
|
116
116
|
|
|
117
|
-
Extracted into its own function so tests can mock it cleanly without
|
|
117
|
+
Extracted into its own function so tests can mock it cleanly, without
|
|
118
118
|
fighting Click's own stdin-swapping inside ``CliRunner.invoke``.
|
|
119
|
-
|
|
120
|
-
Returns:
|
|
121
|
-
Whether stdin is connected to an interactive terminal.
|
|
122
|
-
|
|
123
119
|
"""
|
|
124
120
|
return bool(sys.stdin.isatty())
|