mintlify-convert 2.0.0__py3-none-any.whl

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.
@@ -0,0 +1,299 @@
1
+ Metadata-Version: 2.4
2
+ Name: mintlify-convert
3
+ Version: 2.0.0
4
+ Summary: Convert MDX documentation to Mintlify format
5
+ Author-email: olamide_codex <oluwamusiwaolamide@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/Olamideod/mintlify-convert
8
+ Project-URL: Repository, https://github.com/Olamideod/mintlify-convert.git
9
+ Project-URL: Issues, https://github.com/Olamideod/mintlify-convert/issues
10
+ Keywords: mintlify,mdx,documentation,conversion,migration
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Documentation
20
+ Classifier: Topic :: Text Processing :: Markup
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
27
+ Requires-Dist: black>=23.0.0; extra == "dev"
28
+ Requires-Dist: flake8>=5.0.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
30
+ Requires-Dist: isort>=5.10.0; extra == "dev"
31
+ Requires-Dist: jsonschema>=4; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # Mintlify Convert
35
+
36
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
+
38
+ Convert MDX documentation to Mintlify format with enhanced features for seamless migration.
39
+
40
+ ## ✨ Features
41
+
42
+ ### 🎯 Core Conversions
43
+ - βœ… Frontmatter generation (title, description, icon, mode)
44
+ - βœ… Callouts/Admonitions β†’ Proper Mintlify components (`<Warning>`, `<Tip>`, `<Note>`, `<Info>`, `<Check>`)
45
+ - βœ… Numbered lists β†’ one `<Steps>` per list, with plain-text titles taken from each step
46
+ - βœ… Help sections β†’ `<Card>` components with contextual icons
47
+ - βœ… API links β†’ Mintlify API reference format
48
+ - βœ… Code blocks with proper formatting
49
+
50
+ ### 🧩 Advanced Components (Enhanced with Technical Writing Rules)
51
+ - βœ… `<Accordion>` for H3 sections whose titles match a keyword heuristic (troubleshooting, FAQ, advanced, common issues, known issues, error codes, walkthrough, step by step, breakdown)
52
+ - βœ… `<Tabs>` and `<Tab>` for language-labelled code blocks, with display names such as "JavaScript"
53
+ - βœ… `<Banner>` for paragraphs that start with "Deprecated:", "Important:", "Notice:" or "Alert:"
54
+ - βœ… `<Frame>` around images that are copied with `--download-assets`
55
+
56
+ ### 🧭 Navigation
57
+ - βœ… `docs.json` generation (default), or legacy `mint.json` with `--legacy-mint-json`
58
+ - βœ… Nested groups based on folder structure ("Getting Started" first, then "Documentation", then A-Z)
59
+ - βœ… Proper page titles from frontmatter
60
+ - βœ… Optional alphabetical sorting
61
+
62
+ ### πŸ–ΌοΈ Asset Handling
63
+ - βœ… Image copying to `/images` directory (only with `--download-assets`, only from inside the input directory)
64
+ - βœ… Relative link rewriting (links that resolve outside the input directory are left unchanged)
65
+ - βœ… Automatic path correction
66
+
67
+ ### πŸ”§ Quality Assurance
68
+ - βœ… Input files over 1 MiB are rejected; symlinked inputs and `file:` images are skipped with a warning on stderr
69
+ - βœ… MDX validation (unclosed or mismatched tags; code blocks are ignored)
70
+ - βœ… Detailed error reporting
71
+ - βœ… Verbose mode for debugging
72
+
73
+ ## πŸš€ Quick Start
74
+
75
+ ### Installation
76
+
77
+ ```bash
78
+ # From source (Python 3.10 or newer)
79
+ git clone https://github.com/Olamideod/mintlify-convert.git
80
+ cd mintlify-convert
81
+ pip install -e .
82
+ ```
83
+
84
+ The package is not yet published to PyPI.
85
+
86
+ ### Basic Usage
87
+
88
+ ```bash
89
+ # Convert a single file
90
+ mintlify-convert input.mdx -o output.mdx
91
+
92
+ # Convert an entire directory
93
+ mintlify-convert docs/ -o mintlify-docs/
94
+
95
+ # With all features
96
+ mintlify-convert docs/ -o mintlify-docs/ \
97
+ --generate-config \
98
+ --download-assets \
99
+ --validate \
100
+ --sort-pages
101
+ ```
102
+
103
+ `--generate-config` writes `docs.json`. Add `--legacy-mint-json` to write `mint.json` instead. `--generate-mint-json` is a deprecated alias for both flags together.
104
+
105
+ Converting is idempotent: running the tool on its own output produces the same output. The output path must not be the same as, or inside, the input path.
106
+
107
+ ## πŸ“– Documentation
108
+
109
+ - **[Getting Started](docs/getting-started.mdx)** - Quick start guide
110
+ - **[API Reference](docs/api-reference.mdx)** - Complete CLI and programmatic API
111
+ - **[Component Mapping](docs/component-mapping.mdx)** - How patterns are converted
112
+ - **[Troubleshooting](docs/troubleshooting.mdx)** - Common issues and solutions
113
+
114
+ ## 🎯 Component Conversions
115
+
116
+ ### Callouts (Enhanced)
117
+ **Input:**
118
+ ```markdown
119
+ > **Warning:** This is a critical note.
120
+ > Please read carefully.
121
+ ```
122
+
123
+ **Output:**
124
+ ```mdx
125
+ <Warning>
126
+ **Warning:** This is a critical note.
127
+ Please read carefully.
128
+ </Warning>
129
+ ```
130
+
131
+ ### Steps (Enhanced with Smart Titles)
132
+ **Input:**
133
+ ```markdown
134
+ 1. Install dependencies using npm
135
+ 2. Configure your environment variables
136
+ 3. Start the development server
137
+ ```
138
+
139
+ **Output:**
140
+ ```mdx
141
+ <Steps>
142
+ <Step title="Install dependencies using npm">
143
+ Install dependencies using npm
144
+ </Step>
145
+ <Step title="Configure your environment variables">
146
+ Configure your environment variables
147
+ </Step>
148
+ <Step title="Start the development server">
149
+ Start the development server
150
+ </Step>
151
+ </Steps>
152
+ ```
153
+
154
+ ### Tabs (Enhanced Language Support)
155
+ **Input:**
156
+ ```markdown
157
+ JavaScript:
158
+ const api = require('api');
159
+
160
+ Python:
161
+ import api
162
+ ```
163
+
164
+ **Output:**
165
+ ````mdx
166
+ <Tabs>
167
+ <Tab title="JavaScript">
168
+ ```javascript
169
+ const api = require('api');
170
+ ```
171
+ </Tab>
172
+ <Tab title="Python">
173
+ ```python
174
+ import api
175
+ ```
176
+ </Tab>
177
+ </Tabs>
178
+ ````
179
+
180
+ ## Development
181
+
182
+ ### Setup
183
+ ```bash
184
+ git clone https://github.com/Olamideod/mintlify-convert.git
185
+ cd mintlify-convert
186
+ pip install -e ".[dev]"
187
+ ```
188
+
189
+ ### Run Tests
190
+ ```bash
191
+ pytest tests/ -v --cov=mintlify_convert
192
+ ```
193
+
194
+ ### Run Mintlify Convert
195
+ ```bash
196
+ # Convert all MDX files in docs/ and write docs.json
197
+ python -m mintlify_convert.cli docs/ -o mintlify-docs/ --generate-config
198
+
199
+ # Convert a single file
200
+ python -m mintlify_convert.cli doc.mdx -o output.mdx
201
+ ```
202
+
203
+ ### Conversion behaviour
204
+ The converter follows the component guidance in [agent.md](agent.md):
205
+
206
+ - Callouts become `<Warning>`, `<Tip>`, `<Note>`, `<Info>` or `<Check>`
207
+ - Numbered lists become `<Steps>` with descriptive titles taken from each step
208
+ - Accordions, Banners and Frames follow the narrow rules listed under Features
209
+ - Callouts, banners and numbered lists that start with a code fence are left unconverted; banners and help cards only match at the start of a paragraph
210
+ - Three or more consecutive language-labelled blocks form one `<Tabs>` group
211
+ - Code fences are left untouched
212
+
213
+ ### Code Formatting
214
+ ```bash
215
+ black mintlify_convert/
216
+ flake8 mintlify_convert/
217
+ mypy mintlify_convert/
218
+ ```
219
+
220
+ ## Project Structure
221
+
222
+ ```
223
+ mintlify-convert/
224
+ β”œβ”€β”€ mintlify_convert/ # Main package
225
+ β”‚ β”œβ”€β”€ __init__.py # Package initialization
226
+ β”‚ β”œβ”€β”€ cli.py # Command-line interface
227
+ β”‚ β”œβ”€β”€ converter.py # Core conversion logic
228
+ β”‚ β”œβ”€β”€ navigation.py # docs.json / mint.json generation
229
+ β”‚ └── utils.py # Helper utilities
230
+ β”‚
231
+ β”œβ”€β”€ tests/ # Test suite
232
+ β”‚ β”œβ”€β”€ test_converter.py # Unit tests for converter
233
+ β”‚ β”œβ”€β”€ test_integration.py # Integration tests
234
+ β”‚ β”œβ”€β”€ test_navigation.py # Navigation tests
235
+ β”‚ └── fixtures/ # Test fixtures
236
+ β”‚
237
+ β”œβ”€β”€ examples/ # Example conversions
238
+ β”‚ β”œβ”€β”€ basic/ # Basic examples
239
+ β”‚ β”œβ”€β”€ advanced/ # Advanced examples
240
+ β”‚ └── full-migration/ # Complete migration example
241
+ β”‚
242
+ β”œβ”€β”€ docs/ # Package documentation
243
+ β”‚ β”œβ”€β”€ getting-started.mdx
244
+ β”‚ β”œβ”€β”€ api-reference.mdx
245
+ β”‚ β”œβ”€β”€ component-mapping.mdx
246
+ β”‚ └── troubleshooting.mdx
247
+ β”‚
248
+ β”œβ”€β”€ .github/
249
+ β”‚ └── workflows/ # CI/CD workflows
250
+ β”‚
251
+ β”œβ”€β”€ pyproject.toml # Modern Python project config
252
+ β”œβ”€β”€ requirements.txt # Dependencies
253
+ β”œβ”€β”€ requirements-dev.txt # Development dependencies
254
+ β”œβ”€β”€ README.md # This file
255
+ β”œβ”€β”€ LICENSE # MIT License
256
+ β”œβ”€β”€ CHANGELOG.md # Version history
257
+ β”œβ”€β”€ agent.md # Mintlify technical writing rules
258
+ └── .gitignore # Git ignore rules
259
+ ```
260
+
261
+ ## πŸ—ΊοΈ Roadmap
262
+
263
+ ### Future work
264
+ - [ ] AI-powered description generation (not implemented)
265
+ - [ ] Parallel processing for large docs (not implemented)
266
+ - [ ] Interactive migration wizard (TUI)
267
+ - [ ] Incremental conversion (only changed files)
268
+ - [ ] Custom component plugins
269
+ - [ ] Automatic image optimization
270
+ - [ ] Diff viewer for conversions
271
+ - [ ] VS Code extension
272
+ - [ ] Web-based converter UI
273
+ - [ ] Support for Docusaurus β†’ Mintlify
274
+ - [ ] Support for GitBook β†’ Mintlify
275
+ - [ ] Migration analytics and reporting
276
+
277
+ ## 🀝 Contributing
278
+
279
+ Contributions are welcome! Please:
280
+
281
+ 1. Fork the repository
282
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
283
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
284
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
285
+ 5. Open a Pull Request
286
+
287
+ ## πŸ“„ License
288
+
289
+ MIT License - see [LICENSE](LICENSE) file for details.
290
+
291
+ ## Support
292
+
293
+ - Issues: [GitHub Issues](https://github.com/Olamideod/mintlify-convert/issues)
294
+
295
+ ## πŸ™ Acknowledgments
296
+
297
+ Built with ❀️ to help teams migrate to Mintlify faster.
298
+
299
+ *Star ⭐ this repo if it helped you!*
@@ -0,0 +1,11 @@
1
+ mintlify_convert/__init__.py,sha256=Q5_nXpijsri4VNaOTQuJ7m8aVzQe1XfhQ5u0jqXqbRQ,465
2
+ mintlify_convert/cli.py,sha256=wB46pBFVyQh9cfb8ivjgxZ-gYr89UhF8O2pPTta8liA,5969
3
+ mintlify_convert/converter.py,sha256=PhbN3CND2ibpEIeULjwBw7PDK2Sp-34qN8iJsBj9r6Y,41767
4
+ mintlify_convert/navigation.py,sha256=rCWRfEIhUyHdYrFpktbLFN6eXlXiMgVa4sc5mnoiC2w,8689
5
+ mintlify_convert/utils.py,sha256=HT0LDq6MnSnEIHST88BPZlnLQMkYWMvXKL4JzDhT2Tg,8980
6
+ mintlify_convert-2.0.0.dist-info/licenses/LICENSE,sha256=6GYG6tUrz91USRK36wvwhX6zQp9-LePbbYrinXag-dQ,1073
7
+ mintlify_convert-2.0.0.dist-info/METADATA,sha256=L8G_vd-PEOaMjViL-5d65E7_izX7766K1SV83bWIk84,9706
8
+ mintlify_convert-2.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
+ mintlify_convert-2.0.0.dist-info/entry_points.txt,sha256=eWSOFtff3Wl0KEYy6TL461QMxuf882l3SCuhvoK1LrI,63
10
+ mintlify_convert-2.0.0.dist-info/top_level.txt,sha256=q2B4cLtuxF7_Y__3ct9ylimlGBgH1TXZxia8zODsek0,17
11
+ mintlify_convert-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mintlify-convert = mintlify_convert.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Mintlify Convert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ mintlify_convert