md2linkedin 0.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: md2linkedin
3
- Version: 0.2.3
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
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Classifier: Topic :: Text Processing :: Markup
23
23
  Classifier: Topic :: Utilities
24
- Requires-Dist: click>=8.4.0
24
+ Requires-Dist: click>=8.5.0
25
25
  Requires-Python: >=3.10
26
26
  Project-URL: Homepage, https://github.com/IndrajeetPatil/md2linkedin
27
27
  Project-URL: Documentation, https://www.indrapatil.com/md2linkedin/
@@ -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 App](https://019d695e-8448-ee38-5db3-7ca4acf2ce2c.share.connect.posit.cloud/) — an interactive web interface for `md2linkedin`, built by [Yann Cohen](https://github.com/iamYannC).
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 (`&amp;` → `&`, 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 App](https://019d695e-8448-ee38-5db3-7ca4acf2ce2c.share.connect.posit.cloud/) — an interactive web interface for `md2linkedin`, built by [Yann Cohen](https://github.com/iamYannC).
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.2.3"
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"
@@ -29,7 +29,7 @@ classifiers = [
29
29
  "Topic :: Text Processing :: Markup",
30
30
  "Topic :: Utilities",
31
31
  ]
32
- dependencies = ["click>=8.4.0"]
32
+ dependencies = ["click>=8.5.0"]
33
33
 
34
34
  [[project.authors]]
35
35
  name = "Indrajeet Patil"
@@ -47,17 +47,21 @@ Changelog = "https://github.com/IndrajeetPatil/md2linkedin/blob/main/CHANGELOG.m
47
47
 
48
48
  [dependency-groups]
49
49
  dev = [
50
- "coverage>=7.14.0",
50
+ "add-trailing-comma>=4.0.0",
51
+ "coverage>=7.16.1",
51
52
  "jupyter>=1.1.1",
52
- "zensical>=0.0.43",
53
- "mkdocstrings-python>=2.0.3",
54
- "ty>=0.0.47",
55
- "prek>=0.4.1",
56
- "pytest>=9.0.3",
53
+ "mkdocstrings-python>=2.0.8",
54
+ "mutmut>=3.8.0",
55
+ "prek>=0.5.3",
56
+ "pyrefly>=1.3.1",
57
+ "pytest>=9.1.1",
58
+ "pytest-codspeed==5.0.3",
57
59
  "pytest-cov>=7.1.0",
58
60
  "pytest-random-order>=1.2.0",
59
- "ruff>=0.15.13",
60
- "add-trailing-comma>=4.0.0",
61
+ "pyyaml>=6.0.3",
62
+ "ruff>=0.16.8",
63
+ "ty>=0.0.82",
64
+ "zensical>=0.0.63",
61
65
  ]
62
66
 
63
67
  [build-system]
@@ -78,6 +82,9 @@ ignore = [
78
82
  "CPY",
79
83
  "ambiguous-unicode-character-docstring",
80
84
  "ambiguous-unicode-character-comment",
85
+ "docstring-missing-returns",
86
+ "docstring-missing-yields",
87
+ "docstring-missing-exception",
81
88
  ]
82
89
 
83
90
  [tool.ruff.lint.per-file-ignores]
@@ -124,6 +131,17 @@ sort = "-Cover"
124
131
  show_missing = true
125
132
  skip_empty = true
126
133
 
134
+ [tool.mutmut]
135
+ source_paths = ["src/md2linkedin/"]
136
+ also_copy = ["scripts/"]
137
+ pytest_add_cli_args_test_selection = ["tests/"]
138
+ mutate_only_covered_lines = true
139
+ do_not_mutate_patterns = [
140
+ 'closing_fence = rest\.rfind\(fence\)',
141
+ "pos = 0",
142
+ 'previous_start = text\.rfind',
143
+ ]
144
+
127
145
  [tool.ty.src]
128
146
  exclude = [
129
147
  ".venv",
@@ -135,5 +153,13 @@ exclude = [
135
153
  [tool.ty.environment]
136
154
  python-version = "3.10"
137
155
 
156
+ [tool.ty.rules]
157
+ all = "error"
158
+
159
+ [tool.ty.analysis]
160
+ respect-type-ignore-comments = false
161
+ strict-equality-semantics = true
162
+ strict-generic-narrowing = true
163
+
138
164
  [tool.uv]
139
165
  required-version = ">=0.12.0"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "md2linkedin"
3
- version = "0.2.3"
3
+ version = "0.4.0"
4
4
  description = "Convert Markdown to LinkedIn-friendly Unicode text"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -27,7 +27,7 @@ classifiers = [
27
27
  "Topic :: Utilities",
28
28
  ]
29
29
  dependencies = [
30
- "click>=8.4.0",
30
+ "click>=8.5.0",
31
31
  ]
32
32
 
33
33
  [project.scripts]
@@ -42,17 +42,21 @@ Changelog = "https://github.com/IndrajeetPatil/md2linkedin/blob/main/CHANGELOG.m
42
42
 
43
43
  [dependency-groups]
44
44
  dev = [
45
- "coverage>=7.14.0",
45
+ "add-trailing-comma>=4.0.0",
46
+ "coverage>=7.16.1",
46
47
  "jupyter>=1.1.1",
47
- "zensical>=0.0.43",
48
- "mkdocstrings-python>=2.0.3",
49
- "ty>=0.0.47",
50
- "prek>=0.4.1",
51
- "pytest>=9.0.3",
48
+ "mkdocstrings-python>=2.0.8",
49
+ "mutmut>=3.8.0",
50
+ "prek>=0.5.3",
51
+ "pyrefly>=1.3.1",
52
+ "pytest>=9.1.1",
53
+ "pytest-codspeed==5.0.3",
52
54
  "pytest-cov>=7.1.0",
53
55
  "pytest-random-order>=1.2.0",
54
- "ruff>=0.15.13",
55
- "add-trailing-comma>=4.0.0",
56
+ "pyyaml>=6.0.3",
57
+ "ruff>=0.16.8",
58
+ "ty>=0.0.82",
59
+ "zensical>=0.0.63",
56
60
  ]
57
61
 
58
62
  [build-system]
@@ -78,6 +82,14 @@ ignore = [
78
82
  # docstring examples and block-comment separators is intentional.
79
83
  "ambiguous-unicode-character-docstring",
80
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",
81
93
  ]
82
94
 
83
95
  [tool.ruff.lint.per-file-ignores]
@@ -131,11 +143,61 @@ sort = "-Cover"
131
143
  show_missing = true
132
144
  skip_empty = true
133
145
 
146
+ [tool.mutmut]
147
+ source_paths = ["src/md2linkedin/"]
148
+ # The regression-gate tests import the comparator from this support package.
149
+ also_copy = ["scripts/"]
150
+ pytest_add_cli_args_test_selection = ["tests/"]
151
+ # Only mutate lines exercised by the test suite so mutmut concentrates on
152
+ # meaningful mutations that the tests should actually catch.
153
+ mutate_only_covered_lines = true
154
+ # Skip mutations that cannot be detected by the tests in practice. The
155
+ # pattern is hoisted onto its own source line so the line-granularity
156
+ # exclusion below suppresses only the equivalence mutation described and
157
+ # not any other operations on the same statement.
158
+ # * ``closing_fence = rest.rfind(fence)`` on a fenced code block is
159
+ # equivalent to ``rest.find(fence)`` because the non-greedy regex that
160
+ # captured the block already trims to the shortest matching span, so
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.
173
+ #
174
+ # ``encoding=_ENCODING`` mutations (``encoding=None`` / arg-removal) are
175
+ # NOT excluded here — they are covered by focused tests that assert the
176
+ # UTF-8 argument is passed explicitly, so surviving mutants would show up
177
+ # as real test failures rather than being silently skipped.
178
+ do_not_mutate_patterns = [
179
+ 'closing_fence = rest\.rfind\(fence\)',
180
+ 'pos = 0',
181
+ 'previous_start = text\.rfind',
182
+ ]
183
+
134
184
  [tool.ty.src]
135
185
  exclude = [".venv", "build", "dist", "docs"]
136
186
 
137
187
  [tool.ty.environment]
138
188
  python-version = "3.10"
139
189
 
190
+ [tool.ty.rules]
191
+ # Enable every current diagnostic, including soundness and suppression checks that
192
+ # ty leaves disabled by default. Pinning ty in uv.lock keeps new rules from arriving
193
+ # silently between dependency updates.
194
+ all = "error"
195
+
196
+ [tool.ty.analysis]
197
+ # Prefer sound narrowing over convenience assumptions at external-data boundaries.
198
+ respect-type-ignore-comments = false
199
+ strict-equality-semantics = true
200
+ strict-generic-narrowing = true
201
+
140
202
  [tool.uv]
141
203
  required-version = ">=0.12.0"
@@ -24,7 +24,7 @@ from ._unicode import (
24
24
  to_sans_italic,
25
25
  )
26
26
 
27
- __version__ = version("md2linkedin")
27
+ __version__: str = version("md2linkedin")
28
28
 
29
29
  __all__ = [
30
30
  "__version__",
@@ -112,13 +112,9 @@ def main(
112
112
 
113
113
 
114
114
  def _stdin_is_tty() -> bool:
115
- """Return True when stdin is an interactive terminal.
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
- return sys.stdin.isatty()
120
+ return bool(sys.stdin.isatty())