md2linkedin 0.3.0__tar.gz → 0.5.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.3.0
3
+ Version: 0.5.0
4
4
  Summary: Convert Markdown to LinkedIn-friendly Unicode text
5
5
  Keywords: markdown,linkedin,unicode,formatting,conversion
6
6
  Author: Indrajeet Patil
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: End Users/Desktop
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
15
  Classifier: Programming Language :: Python :: 3.12
18
16
  Classifier: Programming Language :: Python :: 3.13
19
17
  Classifier: Programming Language :: Python :: 3.14
@@ -22,7 +20,9 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
20
  Classifier: Topic :: Text Processing :: Markup
23
21
  Classifier: Topic :: Utilities
24
22
  Requires-Dist: click>=8.5.0
25
- Requires-Python: >=3.10
23
+ Requires-Dist: comrak>=0.0.16
24
+ Requires-Dist: selectolax>=1.0.0
25
+ Requires-Python: >=3.12
26
26
  Project-URL: Homepage, https://github.com/IndrajeetPatil/md2linkedin
27
27
  Project-URL: Documentation, https://www.indrapatil.com/md2linkedin/
28
28
  Project-URL: Repository, https://github.com/IndrajeetPatil/md2linkedin
@@ -32,26 +32,20 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  # md2linkedin <img src="https://raw.githubusercontent.com/IndrajeetPatil/md2linkedin/main/docs/assets/logo.png" align="right" width="240" />
34
34
 
35
-
36
35
  [![PyPI
37
36
  version](https://img.shields.io/pypi/v/md2linkedin.png)](https://pypi.org/project/md2linkedin/)
38
- ![Python
39
- versions](https://img.shields.io/pypi/pyversions/md2linkedin.png)
40
- [![PyPI
41
- Downloads](https://img.shields.io/pypi/dm/md2linkedin.png)](https://pypistats.org/packages/md2linkedin)
37
+ ![Python versions](https://img.shields.io/pypi/pyversions/md2linkedin.png)
42
38
 
43
- `md2linkedin` converts Markdown text to LinkedIn-compatible plain text
44
- by replacing bold, italic, and bold-italic markers with Unicode
45
- Mathematical Sans-Serif characters. This preserves visual formatting
46
- when pasting into platforms like LinkedIn that do not support Markdown
47
- natively.
39
+ `md2linkedin` converts Markdown text to LinkedIn-compatible plain text by
40
+ replacing bold, italic, and bold-italic markers with Unicode Mathematical
41
+ Sans-Serif characters. This preserves visual formatting when pasting into
42
+ platforms like LinkedIn that do not support Markdown natively.
48
43
 
49
44
  ## Installation
50
45
 
51
- | Package Manager | Installation Command |
52
- |-----------------|---------------------------|
53
- | pip | `pip install md2linkedin` |
54
- | uv | `uv add md2linkedin` |
46
+ ```bash
47
+ uv add md2linkedin
48
+ ```
55
49
 
56
50
  > **Tip:** Run the CLI without installing it with
57
51
  > `uvx md2linkedin post.md`.
@@ -60,7 +54,7 @@ natively.
60
54
 
61
55
  ### Python API
62
56
 
63
- ``` python
57
+ ```python
64
58
  # @pyodide
65
59
  from md2linkedin import convert
66
60
 
@@ -81,23 +75,27 @@ Check it out and let me know what you think.
81
75
  print(convert(md))
82
76
  ```
83
77
 
84
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
85
- 𝗘𝗫𝗖𝗜𝗧𝗜𝗡𝗚 𝗡𝗘𝗪𝗦
86
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+ <!--pytest-codeblocks:expected-output-->
79
+
80
+ ```text
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ 𝗘𝗫𝗖𝗜𝗧𝗜𝗡𝗚 𝗡𝗘𝗪𝗦
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
84
 
88
- I'm thrilled to share that 𝘄𝗲 𝗷𝘂𝘀𝘁 𝗹𝗮𝘂𝗻𝗰𝗵𝗲𝗱 a new product!
85
+ I'm thrilled to share that 𝘄𝗲 𝗷𝘂𝘀𝘁 𝗹𝗮𝘂𝗻𝗰𝗵𝗲𝗱 a new product!
89
86
 
90
- Key highlights:
87
+ Key highlights:
91
88
 
92
- • 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲: 3𝘹 𝘧𝘢𝘴𝘵𝘦𝘳 than the previous version
93
- • 𝗥𝗲𝗹𝗶𝗮𝗯𝗶𝗹𝗶𝘁𝘆: 𝙯𝙚𝙧𝙤 𝙙𝙤𝙬𝙣𝙩𝙞𝙢𝙚 deployments
94
- • 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗨𝗫: clean, intuitive API
89
+ • 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲: 3𝘹 𝘧𝘢𝘴𝘵𝘦𝘳 than the previous version
90
+ • 𝗥𝗲𝗹𝗶𝗮𝗯𝗶𝗹𝗶𝘁𝘆: 𝙯𝙚𝙧𝙤 𝙙𝙤𝙬𝙣𝙩𝙞𝙢𝙚 deployments
91
+ • 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗨𝗫: clean, intuitive API
95
92
 
96
- Check it out and let me know what you think.
93
+ Check it out and let me know what you think.
94
+ ```
97
95
 
98
96
  ### CLI
99
97
 
100
- ``` bash
98
+ ```bash
101
99
  # Convert a Markdown file (output: post.linkedin.txt)
102
100
  md2linkedin post.md
103
101
 
@@ -118,46 +116,32 @@ md2linkedin post.md --no-monospace-code
118
116
 
119
117
  - **Bold**: `**text**` or `__text__` → Unicode Sans-Serif Bold (𝗯𝗼𝗹𝗱)
120
118
  - **Italic**: `*text*` or `_text_` → Unicode Sans-Serif Italic (𝘪𝘵𝘢𝘭𝘪𝘤)
121
- - **Bold-italic**: `***text***` or `___text___` → Unicode Sans-Serif
122
- Bold Italic (𝙗𝙤𝙡𝙙-𝙞𝙩𝙖𝙡𝙞𝙘)
123
- - **Headers**: `#`/`##`/etc. styled with bold Unicode; H1 gets a `━`
124
- border
125
- - **Code spans**: backticks stripped, content rendered in Unicode
126
- Monospace (𝚌𝚘𝚍𝚎) by default; `--no-monospace-code` keeps plain text
127
- - **Fenced code blocks**: fences stripped and content rendered in
128
- Unicode Monospace by default; `--no-monospace-code` preserves verbatim
129
- - **Links**: stripped to display text by default; `--preserve-links`
130
- retains URLs
119
+ - **Bold-italic**: `***text***` or `___text___` → Unicode Sans-Serif Bold Italic (𝙗𝙤𝙡𝙙-𝙞𝙩𝙖𝙡𝙞𝙘)
120
+ - **Headers**: `#`/`##`/etc. styled with bold Unicode; H1 gets a `━` border
121
+ - **Code spans**: backticks stripped, content rendered in Unicode Monospace (𝚌𝚘𝚍𝚎) by default; `--no-monospace-code` keeps plain text
122
+ - **Fenced and indented code blocks**: fences and indent stripped, content rendered in Unicode Monospace by default; `--no-monospace-code` keeps plain text
123
+ - **Links**: stripped to display text by default; `--preserve-links` retains URLs
131
124
  - **Images**: replaced by alt text
132
- - **Bullet lists**: `-`/`*`/`+` → `•`; nested items → `‣`
133
- - **Blockquotes**: leading `>` stripped
125
+ - **Bullet lists**: `-`/`*`/`+` → `•`; nested items get one marker per level (`‣`, `◦`, `▪`)
126
+ - **Ordered lists**: numbers kept verbatim, counting on from wherever the list starts
127
+ - **Tables**: header row in bold, cells joined by ` | `
128
+ - **Strikethrough**: `~~text~~` → `text`, markers dropped
129
+ - **Blockquotes**: leading `>` stripped at every level of nesting
134
130
  - **HTML spans**: unwrapped, inner text preserved
135
131
  - **HTML entities**: decoded (`&amp;` → `&`, etc.)
136
132
  - **Backslash escapes**: resolved (`\*` → `*`)
137
133
  - **Windows line endings**: normalised automatically
138
- - **Emojis & non-ASCII**: pass through unchanged — no accidental
139
- corruption
134
+ - **Emojis & non-ASCII**: pass through unchanged — no accidental corruption
140
135
 
141
136
  ## Limitations
142
137
 
143
- Converting Markdown to LinkedIn-friendly text relies on Unicode
144
- Mathematical Alphanumeric Symbols to simulate styling. This approach has
145
- notable limitations:
146
-
147
- - **Code Blocks**: Monospace Unicode characters do not enforce true
148
- fixed-width alignment on proportional fonts (like LinkedIn’s default
149
- font). As a result, indentation and column alignment in code blocks
150
- will often break visually.
151
- - **Tables**: Markdown tables are not converted — they pass through as
152
- raw pipe syntax (`| col | col |`), which LinkedIn does not render,
153
- producing unreadable output.
154
- - **Accessibility**: Screen readers often read Unicode mathematical
155
- characters aloud individually (e.g., “mathematical sans-serif bold b”)
156
- instead of as complete words, making the content difficult for
157
- visually impaired users to understand.
158
- - **Searchability**: Text styled with these Unicode characters may not
159
- be indexed properly by LinkedIn’s search algorithm, meaning people
160
- searching for your keywords might not find your post.
138
+ Converting Markdown to LinkedIn-friendly text relies on Unicode Mathematical Alphanumeric Symbols to simulate styling. This approach has notable limitations:
139
+
140
+ - **Code Blocks**: Monospace Unicode characters do not enforce true fixed-width alignment on proportional fonts (like LinkedIn's default font). As a result, indentation and column alignment in code blocks will often break visually.
141
+ - **Tables**: Markdown tables are flattened to one line per row, with a bold header and cells joined by ` | `. Nothing keeps the columns aligned on LinkedIn's proportional font, so wide tables are better rewritten as lists.
142
+ - **Accessibility**: Screen readers often read Unicode mathematical characters aloud individually (e.g., "mathematical sans-serif bold b") instead of as complete words, making the content difficult for visually impaired users to understand.
143
+ - **Searchability**: Text styled with these Unicode characters may not be indexed properly by LinkedIn's search algorithm, meaning people searching for your keywords might not find your post.
144
+ - **Markdown extensions**: The converter reads CommonMark, plus tables, strikethrough and autolinks. Task-list checkboxes and footnotes are not enabled, because LinkedIn has nowhere to put them: `- [ ] todo` keeps its literal `[ ]`, and `text[^1]` becomes `text^1`. See [What Gets Transformed](https://www.indrapatil.com/md2linkedin/advanced/#what-gets-transformed-and-what-doesnt) for the full list.
161
145
 
162
146
  For more examples, check out the package documentation at:
163
147
  <https://www.indrapatil.com/md2linkedin/>
@@ -172,9 +156,8 @@ This project is licensed under the MIT License.
172
156
 
173
157
  ## Code of Conduct
174
158
 
175
- Please note that the md2linkedin project is released with a [Contributor
176
- Code of
177
- Conduct](https://www.contributor-covenant.org/version/3/0/code_of_conduct/).
159
+ Please note that the md2linkedin project is released with a
160
+ [Contributor Code of Conduct](https://www.contributor-covenant.org/version/3/0/code_of_conduct/).
178
161
  By contributing to this project, you agree to abide by its terms.
179
162
 
180
163
  ## Acknowledgements
@@ -184,5 +167,4 @@ Hex sticker font is `Rubik`. Icons are sourced from
184
167
 
185
168
  - Markdown icon by [Freepik](https://www.flaticon.com/authors/freepik)
186
169
  - LinkedIn icon by [Freepik](https://www.flaticon.com/authors/freepik)
187
- - Arrow/conversion icon by
188
- [Freepik](https://www.flaticon.com/authors/freepik)
170
+ - Arrow/conversion icon by [Freepik](https://www.flaticon.com/authors/freepik)
@@ -0,0 +1,138 @@
1
+ # md2linkedin <img src="https://raw.githubusercontent.com/IndrajeetPatil/md2linkedin/main/docs/assets/logo.png" align="right" width="240" />
2
+
3
+ [![PyPI
4
+ version](https://img.shields.io/pypi/v/md2linkedin.png)](https://pypi.org/project/md2linkedin/)
5
+ ![Python versions](https://img.shields.io/pypi/pyversions/md2linkedin.png)
6
+
7
+ `md2linkedin` converts Markdown text to LinkedIn-compatible plain text by
8
+ replacing bold, italic, and bold-italic markers with Unicode Mathematical
9
+ Sans-Serif characters. This preserves visual formatting when pasting into
10
+ platforms like LinkedIn that do not support Markdown natively.
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ uv add md2linkedin
16
+ ```
17
+
18
+ > **Tip:** Run the CLI without installing it with
19
+ > `uvx md2linkedin post.md`.
20
+
21
+ ## Usage
22
+
23
+ ### Python API
24
+
25
+ ```python
26
+ # @pyodide
27
+ from md2linkedin import convert
28
+
29
+ md = """
30
+ # Exciting News
31
+
32
+ I'm thrilled to share that **we just launched** a new product!
33
+
34
+ Key highlights:
35
+
36
+ - **Performance**: *3x faster* than the previous version
37
+ - **Reliability**: ***zero downtime*** deployments
38
+ - **Developer UX**: clean, intuitive API
39
+
40
+ Check it out and let me know what you think.
41
+ """
42
+
43
+ print(convert(md))
44
+ ```
45
+
46
+ <!--pytest-codeblocks:expected-output-->
47
+
48
+ ```text
49
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
+ 𝗘𝗫𝗖𝗜𝗧𝗜𝗡𝗚 𝗡𝗘𝗪𝗦
51
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
52
+
53
+ I'm thrilled to share that 𝘄𝗲 𝗷𝘂𝘀𝘁 𝗹𝗮𝘂𝗻𝗰𝗵𝗲𝗱 a new product!
54
+
55
+ Key highlights:
56
+
57
+ • 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲: 3𝘹 𝘧𝘢𝘴𝘵𝘦𝘳 than the previous version
58
+ • 𝗥𝗲𝗹𝗶𝗮𝗯𝗶𝗹𝗶𝘁𝘆: 𝙯𝙚𝙧𝙤 𝙙𝙤𝙬𝙣𝙩𝙞𝙢𝙚 deployments
59
+ • 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗨𝗫: clean, intuitive API
60
+
61
+ Check it out and let me know what you think.
62
+ ```
63
+
64
+ ### CLI
65
+
66
+ ```bash
67
+ # Convert a Markdown file (output: post.linkedin.txt)
68
+ md2linkedin post.md
69
+
70
+ # Specify output path
71
+ md2linkedin post.md -o linkedin_post.txt
72
+
73
+ # Pipe from stdin
74
+ echo "**Hello**, *world*!" | md2linkedin
75
+
76
+ # Keep link URLs in the output
77
+ md2linkedin post.md --preserve-links
78
+
79
+ # Disable monospace code rendering
80
+ md2linkedin post.md --no-monospace-code
81
+ ```
82
+
83
+ ## Key Features
84
+
85
+ - **Bold**: `**text**` or `__text__` → Unicode Sans-Serif Bold (𝗯𝗼𝗹𝗱)
86
+ - **Italic**: `*text*` or `_text_` → Unicode Sans-Serif Italic (𝘪𝘵𝘢𝘭𝘪𝘤)
87
+ - **Bold-italic**: `***text***` or `___text___` → Unicode Sans-Serif Bold Italic (𝙗𝙤𝙡𝙙-𝙞𝙩𝙖𝙡𝙞𝙘)
88
+ - **Headers**: `#`/`##`/etc. styled with bold Unicode; H1 gets a `━` border
89
+ - **Code spans**: backticks stripped, content rendered in Unicode Monospace (𝚌𝚘𝚍𝚎) by default; `--no-monospace-code` keeps plain text
90
+ - **Fenced and indented code blocks**: fences and indent stripped, content rendered in Unicode Monospace by default; `--no-monospace-code` keeps plain text
91
+ - **Links**: stripped to display text by default; `--preserve-links` retains URLs
92
+ - **Images**: replaced by alt text
93
+ - **Bullet lists**: `-`/`*`/`+` → `•`; nested items get one marker per level (`‣`, `◦`, `▪`)
94
+ - **Ordered lists**: numbers kept verbatim, counting on from wherever the list starts
95
+ - **Tables**: header row in bold, cells joined by ` | `
96
+ - **Strikethrough**: `~~text~~` → `text`, markers dropped
97
+ - **Blockquotes**: leading `>` stripped at every level of nesting
98
+ - **HTML spans**: unwrapped, inner text preserved
99
+ - **HTML entities**: decoded (`&amp;` → `&`, etc.)
100
+ - **Backslash escapes**: resolved (`\*` → `*`)
101
+ - **Windows line endings**: normalised automatically
102
+ - **Emojis & non-ASCII**: pass through unchanged — no accidental corruption
103
+
104
+ ## Limitations
105
+
106
+ Converting Markdown to LinkedIn-friendly text relies on Unicode Mathematical Alphanumeric Symbols to simulate styling. This approach has notable limitations:
107
+
108
+ - **Code Blocks**: Monospace Unicode characters do not enforce true fixed-width alignment on proportional fonts (like LinkedIn's default font). As a result, indentation and column alignment in code blocks will often break visually.
109
+ - **Tables**: Markdown tables are flattened to one line per row, with a bold header and cells joined by ` | `. Nothing keeps the columns aligned on LinkedIn's proportional font, so wide tables are better rewritten as lists.
110
+ - **Accessibility**: Screen readers often read Unicode mathematical characters aloud individually (e.g., "mathematical sans-serif bold b") instead of as complete words, making the content difficult for visually impaired users to understand.
111
+ - **Searchability**: Text styled with these Unicode characters may not be indexed properly by LinkedIn's search algorithm, meaning people searching for your keywords might not find your post.
112
+ - **Markdown extensions**: The converter reads CommonMark, plus tables, strikethrough and autolinks. Task-list checkboxes and footnotes are not enabled, because LinkedIn has nowhere to put them: `- [ ] todo` keeps its literal `[ ]`, and `text[^1]` becomes `text^1`. See [What Gets Transformed](https://www.indrapatil.com/md2linkedin/advanced/#what-gets-transformed-and-what-doesnt) for the full list.
113
+
114
+ For more examples, check out the package documentation at:
115
+ <https://www.indrapatil.com/md2linkedin/>
116
+
117
+ ## See Also
118
+
119
+ - [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).
120
+
121
+ ## License
122
+
123
+ This project is licensed under the MIT License.
124
+
125
+ ## Code of Conduct
126
+
127
+ Please note that the md2linkedin project is released with a
128
+ [Contributor Code of Conduct](https://www.contributor-covenant.org/version/3/0/code_of_conduct/).
129
+ By contributing to this project, you agree to abide by its terms.
130
+
131
+ ## Acknowledgements
132
+
133
+ Hex sticker font is `Rubik`. Icons are sourced from
134
+ [Flaticon](https://www.flaticon.com/):
135
+
136
+ - Markdown icon by [Freepik](https://www.flaticon.com/authors/freepik)
137
+ - LinkedIn icon by [Freepik](https://www.flaticon.com/authors/freepik)
138
+ - Arrow/conversion icon by [Freepik](https://www.flaticon.com/authors/freepik)
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "md2linkedin"
3
- version = "0.3.0"
3
+ version = "0.5.0"
4
4
  description = "Convert Markdown to LinkedIn-friendly Unicode text"
5
5
  readme = "README.md"
6
- requires-python = ">=3.10"
6
+ requires-python = ">=3.12"
7
7
  license = "MIT"
8
8
  license-files = ["LICENSE.md"]
9
9
  keywords = [
@@ -19,8 +19,6 @@ classifiers = [
19
19
  "Intended Audience :: End Users/Desktop",
20
20
  "Operating System :: OS Independent",
21
21
  "Programming Language :: Python",
22
- "Programming Language :: Python :: 3.10",
23
- "Programming Language :: Python :: 3.11",
24
22
  "Programming Language :: Python :: 3.12",
25
23
  "Programming Language :: Python :: 3.13",
26
24
  "Programming Language :: Python :: 3.14",
@@ -29,7 +27,11 @@ classifiers = [
29
27
  "Topic :: Text Processing :: Markup",
30
28
  "Topic :: Utilities",
31
29
  ]
32
- dependencies = ["click>=8.5.0"]
30
+ dependencies = [
31
+ "click>=8.5.0",
32
+ "comrak>=0.0.16",
33
+ "selectolax>=1.0.0",
34
+ ]
33
35
 
34
36
  [[project.authors]]
35
37
  name = "Indrajeet Patil"
@@ -48,19 +50,20 @@ Changelog = "https://github.com/IndrajeetPatil/md2linkedin/blob/main/CHANGELOG.m
48
50
  [dependency-groups]
49
51
  dev = [
50
52
  "add-trailing-comma>=4.0.0",
51
- "coverage>=7.16.1",
52
- "jupyter>=1.1.1",
53
- "mkdocstrings-python>=2.0.8",
53
+ "coverage>=7.16.2",
54
+ "deptry>=0.25.1",
55
+ "mkdocstrings-python>=2.0.9",
54
56
  "mutmut>=3.8.0",
55
- "prek>=0.5.3",
57
+ "prek>=0.5.5",
58
+ "pyrefly>=1.3.2",
56
59
  "pytest>=9.1.1",
60
+ "pytest-codeblocks>=0.18.0",
57
61
  "pytest-codspeed==5.0.3",
58
62
  "pytest-cov>=7.1.0",
59
63
  "pytest-random-order>=1.2.0",
60
- "pyyaml>=6.0.3",
61
- "ruff>=0.16.8",
62
- "ty>=0.0.82",
63
- "zensical>=0.0.62",
64
+ "ruff>=0.16.10",
65
+ "ty>=0.0.85",
66
+ "zensical>=0.0.68",
64
67
  ]
65
68
 
66
69
  [build-system]
@@ -81,6 +84,9 @@ ignore = [
81
84
  "CPY",
82
85
  "ambiguous-unicode-character-docstring",
83
86
  "ambiguous-unicode-character-comment",
87
+ "docstring-missing-returns",
88
+ "docstring-missing-yields",
89
+ "docstring-missing-exception",
84
90
  ]
85
91
 
86
92
  [tool.ruff.lint.per-file-ignores]
@@ -98,17 +104,15 @@ ignore = [
98
104
  preview = true
99
105
  docstring-code-format = true
100
106
 
101
- [tool.pytest.ini_options]
107
+ [tool.pytest]
108
+ strict = true
102
109
  addopts = [
103
- "--strict-config",
104
- "--strict-markers",
105
110
  "-ra",
106
111
  "--verbose",
107
112
  "--random-order",
108
113
  ]
109
114
  testpaths = ["tests"]
110
115
  filterwarnings = ["error"]
111
- xfail_strict = true
112
116
  python_files = [
113
117
  "test_*.py",
114
118
  "test-*.py",
@@ -129,10 +133,12 @@ skip_empty = true
129
133
 
130
134
  [tool.mutmut]
131
135
  source_paths = ["src/md2linkedin/"]
132
- also_copy = ["scripts/"]
136
+ also_copy = [
137
+ "scripts/",
138
+ "README.md",
139
+ ]
133
140
  pytest_add_cli_args_test_selection = ["tests/"]
134
141
  mutate_only_covered_lines = true
135
- do_not_mutate_patterns = ['closing_fence = rest\.rfind\(fence\)']
136
142
 
137
143
  [tool.ty.src]
138
144
  exclude = [
@@ -143,7 +149,7 @@ exclude = [
143
149
  ]
144
150
 
145
151
  [tool.ty.environment]
146
- python-version = "3.10"
152
+ python-version = "3.12"
147
153
 
148
154
  [tool.ty.rules]
149
155
  all = "error"
@@ -154,4 +160,8 @@ strict-equality-semantics = true
154
160
  strict-generic-narrowing = true
155
161
 
156
162
  [tool.uv]
157
- required-version = ">=0.12.0"
163
+ required-version = ">=0.12.18"
164
+
165
+ [tool.deptry]
166
+ extend_exclude = ["scripts"]
167
+ known_first_party = ["md2linkedin"]
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "md2linkedin"
3
- version = "0.3.0"
3
+ version = "0.5.0"
4
4
  description = "Convert Markdown to LinkedIn-friendly Unicode text"
5
5
  readme = "README.md"
6
6
  authors = [
7
7
  { name = "Indrajeet Patil", email = "patilindrajeet.science@gmail.com" }
8
8
  ]
9
- requires-python = ">=3.10"
9
+ requires-python = ">=3.12"
10
10
  license = "MIT"
11
11
  license-files = ["LICENSE.md"]
12
12
  keywords = ["markdown", "linkedin", "unicode", "formatting", "conversion"]
@@ -16,8 +16,6 @@ classifiers = [
16
16
  "Intended Audience :: End Users/Desktop",
17
17
  "Operating System :: OS Independent",
18
18
  "Programming Language :: Python",
19
- "Programming Language :: Python :: 3.10",
20
- "Programming Language :: Python :: 3.11",
21
19
  "Programming Language :: Python :: 3.12",
22
20
  "Programming Language :: Python :: 3.13",
23
21
  "Programming Language :: Python :: 3.14",
@@ -28,6 +26,8 @@ classifiers = [
28
26
  ]
29
27
  dependencies = [
30
28
  "click>=8.5.0",
29
+ "comrak>=0.0.16",
30
+ "selectolax>=1.0.0",
31
31
  ]
32
32
 
33
33
  [project.scripts]
@@ -43,19 +43,20 @@ Changelog = "https://github.com/IndrajeetPatil/md2linkedin/blob/main/CHANGELOG.m
43
43
  [dependency-groups]
44
44
  dev = [
45
45
  "add-trailing-comma>=4.0.0",
46
- "coverage>=7.16.1",
47
- "jupyter>=1.1.1",
48
- "mkdocstrings-python>=2.0.8",
46
+ "coverage>=7.16.2",
47
+ "deptry>=0.25.1",
48
+ "mkdocstrings-python>=2.0.9",
49
49
  "mutmut>=3.8.0",
50
- "prek>=0.5.3",
50
+ "prek>=0.5.5",
51
+ "pyrefly>=1.3.2",
51
52
  "pytest>=9.1.1",
53
+ "pytest-codeblocks>=0.18.0",
52
54
  "pytest-codspeed==5.0.3",
53
55
  "pytest-cov>=7.1.0",
54
56
  "pytest-random-order>=1.2.0",
55
- "pyyaml>=6.0.3",
56
- "ruff>=0.16.8",
57
- "ty>=0.0.82",
58
- "zensical>=0.0.62",
57
+ "ruff>=0.16.10",
58
+ "ty>=0.0.85",
59
+ "zensical>=0.0.68",
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]
@@ -105,12 +114,12 @@ ignore = [
105
114
  preview = true
106
115
  docstring-code-format = true
107
116
 
108
- [tool.pytest.ini_options]
117
+ [tool.pytest]
118
+ # Strict mode enables strict_config, strict_markers, strict_parametrization_ids,
119
+ # and strict_xfail, plus any strictness options future pytest releases add. uv.lock
120
+ # pins pytest, so new options only arrive through a reviewed dependency update.
121
+ strict = true
109
122
  addopts = [
110
- # error on problems parsing pytest configuration
111
- "--strict-config",
112
- # error on using unregistered marker
113
- "--strict-markers",
114
123
  # show extra test summary info for everything
115
124
  "-ra",
116
125
  # include more verbose output
@@ -120,7 +129,6 @@ addopts = [
120
129
  ]
121
130
  testpaths = ["tests"]
122
131
  filterwarnings = ["error"]
123
- xfail_strict = true
124
132
  python_files = ["test_*.py", "test-*.py", "tests.py", "test.py"]
125
133
 
126
134
  [tool.coverage.run]
@@ -136,34 +144,23 @@ skip_empty = true
136
144
 
137
145
  [tool.mutmut]
138
146
  source_paths = ["src/md2linkedin/"]
139
- # The regression-gate tests import the comparator from this support package.
140
- also_copy = ["scripts/"]
147
+ # The regression-gate tests import the comparator from this support package,
148
+ # and tests/test_readme.py runs the examples in README.md.
149
+ also_copy = ["scripts/", "README.md"]
141
150
  pytest_add_cli_args_test_selection = ["tests/"]
142
151
  # Only mutate lines exercised by the test suite so mutmut concentrates on
143
152
  # meaningful mutations that the tests should actually catch.
144
153
  mutate_only_covered_lines = true
145
- # Skip mutations that cannot be detected by the tests in practice. The
146
- # pattern is hoisted onto its own source line so the line-granularity
147
- # exclusion below suppresses only the equivalence mutation described and
148
- # not any other operations on the same statement.
149
- # * ``closing_fence = rest.rfind(fence)`` on a fenced code block is
150
- # equivalent to ``rest.find(fence)`` because the non-greedy regex that
151
- # captured the block already trims to the shortest matching span, so
152
- # no additional ``fence`` marker can appear inside ``rest``.
153
- #
154
- # ``encoding=_ENCODING`` mutations (``encoding=None`` / arg-removal) are
155
- # NOT excluded here — they are covered by focused tests that assert the
156
- # UTF-8 argument is passed explicitly, so surviving mutants would show up
157
- # as real test failures rather than being silently skipped.
158
- do_not_mutate_patterns = [
159
- 'closing_fence = rest\.rfind\(fence\)',
160
- ]
154
+ # Nothing is excluded. ``do_not_mutate`` is deliberately unset: it only takes
155
+ # whole-file globs, so the smallest thing it can silence is an entire module.
156
+ # When a mutant survives, the answer is a test that kills it, or source that
157
+ # cannot express the mutation in the first place.
161
158
 
162
159
  [tool.ty.src]
163
160
  exclude = [".venv", "build", "dist", "docs"]
164
161
 
165
162
  [tool.ty.environment]
166
- python-version = "3.10"
163
+ python-version = "3.12"
167
164
 
168
165
  [tool.ty.rules]
169
166
  # Enable every current diagnostic, including soundness and suppression checks that
@@ -178,4 +175,8 @@ strict-equality-semantics = true
178
175
  strict-generic-narrowing = true
179
176
 
180
177
  [tool.uv]
181
- required-version = ">=0.12.0"
178
+ required-version = ">=0.12.18"
179
+
180
+ [tool.deptry]
181
+ extend_exclude = ["scripts"]
182
+ known_first_party = ["md2linkedin"]
@@ -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__",
@@ -43,8 +43,8 @@ from ._converter import convert, convert_file
43
43
  default=False,
44
44
  help=(
45
45
  "Disable monospace Unicode rendering for inline code and fenced"
46
- " code blocks. When set, inline code is kept as plain text and"
47
- " fenced blocks are preserved verbatim."
46
+ " code blocks. When set, code is kept as plain text, with the"
47
+ " backticks and fences stripped."
48
48
  ),
49
49
  )
50
50
  def main(
@@ -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
120
  return bool(sys.stdin.isatty())