smart-markdown-editor 1.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.
Files changed (26) hide show
  1. smart_markdown_editor-1.0.0/LICENSE +21 -0
  2. smart_markdown_editor-1.0.0/PKG-INFO +276 -0
  3. smart_markdown_editor-1.0.0/README.md +208 -0
  4. smart_markdown_editor-1.0.0/pyproject.toml +132 -0
  5. smart_markdown_editor-1.0.0/setup.cfg +4 -0
  6. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/PKG-INFO +276 -0
  7. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/SOURCES.txt +24 -0
  8. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/dependency_links.txt +1 -0
  9. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/entry_points.txt +2 -0
  10. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/requires.txt +18 -0
  11. smart_markdown_editor-1.0.0/smart_markdown_editor.egg-info/top_level.txt +1 -0
  12. smart_markdown_editor-1.0.0/src/__init__.py +8 -0
  13. smart_markdown_editor-1.0.0/src/config.py +165 -0
  14. smart_markdown_editor-1.0.0/src/core/__init__.py +10 -0
  15. smart_markdown_editor-1.0.0/src/core/analyzer.py +380 -0
  16. smart_markdown_editor-1.0.0/src/core/highlighter.py +227 -0
  17. smart_markdown_editor-1.0.0/src/exporters/__init__.py +150 -0
  18. smart_markdown_editor-1.0.0/src/exporters/builtin.py +449 -0
  19. smart_markdown_editor-1.0.0/src/main.py +51 -0
  20. smart_markdown_editor-1.0.0/src/ui/__init__.py +10 -0
  21. smart_markdown_editor-1.0.0/src/ui/assistant_panel.py +184 -0
  22. smart_markdown_editor-1.0.0/src/ui/dialogs.py +222 -0
  23. smart_markdown_editor-1.0.0/src/ui/main_window.py +615 -0
  24. smart_markdown_editor-1.0.0/src/ui/themes.py +211 -0
  25. smart_markdown_editor-1.0.0/src/utils/__init__.py +279 -0
  26. smart_markdown_editor-1.0.0/tests/test_analyzer.py +202 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michail Semoglou
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,276 @@
1
+ Metadata-Version: 2.4
2
+ Name: smart-markdown-editor
3
+ Version: 1.0.0
4
+ Summary: A cross-platform desktop Markdown editor with real-time preview and an integrated Smart Assistant for document quality analysis.
5
+ Author-email: Michail Semoglou <m.semoglou@tongji.edu.cn>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Michail Semoglou
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/MichailSemoglou/smart-markdown-editor
29
+ Project-URL: Repository, https://github.com/MichailSemoglou/smart-markdown-editor
30
+ Project-URL: Documentation, https://github.com/MichailSemoglou/smart-markdown-editor#readme
31
+ Project-URL: Bug Tracker, https://github.com/MichailSemoglou/smart-markdown-editor/issues
32
+ Project-URL: Changelog, https://github.com/MichailSemoglou/smart-markdown-editor/blob/main/CHANGELOG.md
33
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.19328281
34
+ Keywords: markdown,editor,readability,document-analysis,academic-writing,pyside6,digital-humanities,plain-text-scholarship,scholarly-communication,research-software
35
+ Classifier: Development Status :: 5 - Production/Stable
36
+ Classifier: Intended Audience :: Science/Research
37
+ Classifier: Intended Audience :: Education
38
+ Classifier: Intended Audience :: Developers
39
+ Classifier: License :: OSI Approved :: MIT License
40
+ Classifier: Operating System :: OS Independent
41
+ Classifier: Programming Language :: Python :: 3
42
+ Classifier: Programming Language :: Python :: 3.9
43
+ Classifier: Programming Language :: Python :: 3.12
44
+ Classifier: Topic :: Text Editors
45
+ Classifier: Topic :: Text Processing :: Markup
46
+ Classifier: Topic :: Scientific/Engineering
47
+ Classifier: Topic :: Office/Business :: Office Suites
48
+ Classifier: Environment :: X11 Applications :: Qt
49
+ Requires-Python: >=3.9
50
+ Description-Content-Type: text/markdown
51
+ License-File: LICENSE
52
+ Requires-Dist: PySide6>=6.8.0
53
+ Requires-Dist: markdown>=3.5.1
54
+ Requires-Dist: pygments>=2.16.0
55
+ Requires-Dist: python-docx>=0.8.11
56
+ Requires-Dist: reportlab>=3.6.0
57
+ Requires-Dist: html2text>=2020.1.16
58
+ Provides-Extra: weasyprint
59
+ Requires-Dist: weasyprint>=59.0; extra == "weasyprint"
60
+ Provides-Extra: all
61
+ Requires-Dist: smart-markdown-editor[weasyprint]; extra == "all"
62
+ Provides-Extra: dev
63
+ Requires-Dist: pytest>=7.0; extra == "dev"
64
+ Requires-Dist: pytest-qt>=4.0; extra == "dev"
65
+ Requires-Dist: ruff>=0.4; extra == "dev"
66
+ Requires-Dist: mypy>=1.0; extra == "dev"
67
+ Dynamic: license-file
68
+
69
+ # Smart Markdown Editor
70
+
71
+ **Write better Markdown. Catch structural problems as you type. Export to 7 formats — entirely offline.**
72
+
73
+ A cross-platform desktop Markdown editor with real-time HTML preview and an integrated Smart Assistant for document quality analysis. Designed for researchers, digital humanities scholars, and technical writers who author in plain-text environments and need structural feedback — readability, heading hierarchy, issue detection — without leaving the editor or sending documents to a cloud service.
74
+
75
+ [![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/)
76
+ [![PySide6](https://img.shields.io/badge/PySide6-6.8%2B-green)](https://wiki.qt.io/Qt_for_Python)
77
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
78
+ [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)]()
79
+ [![CI](https://github.com/MichailSemoglou/smart-markdown-editor/actions/workflows/ci.yml/badge.svg)](https://github.com/MichailSemoglou/smart-markdown-editor/actions)
80
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19328281.svg)](https://doi.org/10.5281/zenodo.19328281)
81
+
82
+ ## Statement of Need
83
+
84
+ Scholars who write in Markdown — the lingua franca of digital humanities project documentation, digital editions, and computational humanities research — currently have no tool that combines the structural feedback familiar from word-processor track-changes workflows with the plain-text, version-control-friendly format that modern DH and open-science practice requires.
85
+
86
+ Existing Markdown editors either provide visual previewing with no quality analysis (Typora, Obsidian), operate headlessly with no authoring context (proselint, vale), or require cloud connectivity that creates privacy and data-sovereignty concerns (Grammarly, LanguageTool). Smart Markdown Editor fills this gap: real-time structural quality feedback, inside a Markdown-native, fully offline, open-source environment.
87
+
88
+ 100% local — **your documents never touch a server.**
89
+
90
+ ## Features
91
+
92
+ ### Core Features
93
+
94
+ - **Split-window interface**: Text editor on the left, live HTML preview on the right
95
+ - **Real-time preview**: Updates automatically as you type (300 ms debounce)
96
+ - **Syntax highlighting**: Editor highlights headings, bold, italic, code, links, and more
97
+ - **File operations**: New, Open, Save, Save As with standard keyboard shortcuts
98
+ - **Recent files menu**: Quickly reopen previously edited documents
99
+ - **Auto-save**: Periodically saves your work to prevent data loss
100
+ - **Find & Replace**: Full find and replace dialog with case-sensitive and backward search
101
+ - **Multi-format export**: Export to Markdown, Plain Text, HTML, Word (.docx), PDF, RTF, and ODT
102
+ - **Custom preview CSS**: Load any CSS file to style the live preview
103
+ - **GitHub-style rendering**: Preview styled similar to GitHub's markdown rendering
104
+ - **Cross-platform**: Windows, macOS, and Linux
105
+
106
+ ### Smart Markdown Assistant
107
+
108
+ An intelligent panel that provides real-time document analysis and quality feedback.
109
+
110
+ - **Live statistics**: Word count, character count, line count, estimated reading time
111
+ - **Structure analysis**: Heading hierarchy (H1–H6), links, images, code blocks, lists, blockquotes, tables
112
+ - **Quality metrics**: Flesch-Kincaid readability score with colour-coded rating
113
+ - **Issue detection**: Flags empty links, duplicate headings, and formatting problems
114
+ - **Auto-format**: One-click formatting that adds proper heading spacing, fixes list markers, and removes excessive blank lines
115
+
116
+ ## Screenshots
117
+
118
+ ![Smart Markdown Editor screenshot](docs/screenshot.png)
119
+
120
+ ## Installation
121
+
122
+ ```bash
123
+ # Clone the repository
124
+ git clone https://github.com/MichailSemoglou/smart-markdown-editor.git
125
+ cd smart-markdown-editor
126
+
127
+ # Create and activate a virtual environment
128
+ python3 -m venv venv
129
+ source venv/bin/activate # macOS / Linux
130
+ # venv\Scripts\activate # Windows
131
+
132
+ # Install dependencies
133
+ pip install -r requirements.txt
134
+
135
+ # Run the application
136
+ python markdown_editor.py
137
+ ```
138
+
139
+ ### Requirements
140
+
141
+ | Package | Version | Notes |
142
+ | ----------- | -------- | ------------------------- |
143
+ | Python | ≥ 3.9 | |
144
+ | PySide6 | ≥ 6.8.0 | GUI framework |
145
+ | Markdown | ≥ 3.5.1 | Markdown processing |
146
+ | Pygments | ≥ 2.0 | Syntax highlighting |
147
+ | python-docx | optional | `.docx` export |
148
+ | reportlab | optional | `.pdf` export (fallback) |
149
+ | weasyprint | optional | `.pdf` export (preferred) |
150
+ | html2text | optional | Plain-text export |
151
+
152
+ RTF and ODT export are built-in and require no extra libraries.
153
+
154
+ ## Usage
155
+
156
+ ```bash
157
+ python markdown_editor.py
158
+ ```
159
+
160
+ ### Keyboard Shortcuts
161
+
162
+ | Shortcut | Action |
163
+ | ------------------ | -------------- |
164
+ | `Cmd/Ctrl+N` | New file |
165
+ | `Cmd/Ctrl+O` | Open file |
166
+ | `Cmd/Ctrl+S` | Save |
167
+ | `Cmd/Ctrl+Shift+S` | Save As |
168
+ | `Cmd/Ctrl+F` | Find |
169
+ | `Cmd/Ctrl+H` | Find & Replace |
170
+ | `Cmd/Ctrl+Z` | Undo |
171
+ | `Cmd/Ctrl+Y` | Redo |
172
+ | `Cmd/Ctrl+Q` | Quit |
173
+
174
+ ## Export Formats
175
+
176
+ | Format | Extension | Extra dependency |
177
+ | ----------------- | --------- | --------------------------- |
178
+ | Markdown | `.md` | — |
179
+ | Plain Text | `.txt` | `html2text` (optional) |
180
+ | HTML | `.html` | — |
181
+ | Word Document | `.docx` | `python-docx` |
182
+ | PDF | `.pdf` | `weasyprint` or `reportlab` |
183
+ | Rich Text Format | `.rtf` | — |
184
+ | OpenDocument Text | `.odt` | — |
185
+
186
+ The application detects which libraries are available and shows only supported formats in the export menu.
187
+
188
+ ## Project Structure
189
+
190
+ ```
191
+ smart-markdown-editor/
192
+ ├── markdown_editor.py # Standalone legacy entry point
193
+ ├── requirements.txt
194
+ ├── README.md
195
+ ├── CONTRIBUTING.md
196
+ ├── CHANGELOG.md
197
+ ├── LICENSE
198
+ ├── src/
199
+ │ ├── main.py # Modular entry point
200
+ │ ├── config.py # Themes, constants, settings keys
201
+ │ ├── core/
202
+ │ │ ├── analyzer.py # MarkdownAnalyzer — document metrics
203
+ │ │ └── highlighter.py # MarkdownSyntaxHighlighter
204
+ │ ├── exporters/
205
+ │ │ ├── __init__.py # Exporter registry
206
+ │ │ └── builtin.py # All built-in exporters
207
+ │ ├── ui/
208
+ │ │ ├── main_window.py # MainWindow (QMainWindow)
209
+ │ │ ├── assistant_panel.py # Smart Assistant side panel
210
+ │ │ ├── dialogs.py # Find & Replace dialog
211
+ │ │ └── themes.py # ThemeManager — stylesheets & preview HTML
212
+ │ └── utils/
213
+ │ └── __init__.py # File and validation utilities
214
+ ├── tests/
215
+ │ └── test_analyzer.py # Unit tests for MarkdownAnalyzer
216
+ ├── test_exports.py # Integration tests for all exporters
217
+ └── .github/
218
+ └── workflows/
219
+ └── ci.yml # CI pipeline (lint, type-check, test, build)
220
+ ```
221
+
222
+ ## Running Tests
223
+
224
+ ```bash
225
+ pip install pytest pytest-cov
226
+ pytest tests/ test_exports.py -v --cov=src
227
+ ```
228
+
229
+ ## Technical Details
230
+
231
+ - **GUI framework**: PySide6 (Qt6)
232
+ - **Markdown processing**: Python Markdown with `codehilite`, `tables`, and `toc` extensions
233
+ - **HTML preview**: `QtWebEngineWidgets`
234
+ - **Architecture**: Modular `src/` package — core logic, UI layer, and exporters are decoupled
235
+ - **Exporter registry**: Exporters self-register; unavailable formats are hidden automatically
236
+ - **Live updates**: `QTimer`-based debounce (300 ms preview, 800 ms analysis)
237
+ - **CI**: GitHub Actions — Ruff linting, MyPy type checking, pytest on Python 3.9 and 3.12
238
+
239
+ ## Citing This Software
240
+
241
+ If you use Smart Markdown Editor in your research, please cite it using the metadata in [CITATION.cff](CITATION.cff). A ready-to-paste BibTeX entry:
242
+
243
+ ```bibtex
244
+ @software{semoglou_smart_markdown_editor_2026,
245
+ author = {Semoglou, Michail},
246
+ title = {Smart Markdown Editor},
247
+ year = {2026},
248
+ version = {1.0.0},
249
+ publisher = {Zenodo},
250
+ doi = {10.5281/zenodo.19328281},
251
+ url = {https://github.com/MichailSemoglou/smart-markdown-editor}
252
+ }
253
+ ```
254
+
255
+ ## Contributing
256
+
257
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style guidelines, and the pull-request workflow.
258
+
259
+ ## Changelog
260
+
261
+ See [CHANGELOG.md](CHANGELOG.md) for a full history of changes.
262
+
263
+ ## License
264
+
265
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
266
+
267
+ ## Acknowledgments
268
+
269
+ - Built with [PySide6](https://wiki.qt.io/Qt_for_Python)
270
+ - Markdown processing by [Python Markdown](https://python-markdown.github.io/)
271
+ - Syntax highlighting powered by [Pygments](https://pygments.org/)
272
+ - Positioned within the plain-text scholarship tradition: Tenen (2017) and Healy (2019)
273
+
274
+ ## Support
275
+
276
+ File an issue on the [GitHub issue tracker](https://github.com/MichailSemoglou/smart-markdown-editor/issues).
@@ -0,0 +1,208 @@
1
+ # Smart Markdown Editor
2
+
3
+ **Write better Markdown. Catch structural problems as you type. Export to 7 formats — entirely offline.**
4
+
5
+ A cross-platform desktop Markdown editor with real-time HTML preview and an integrated Smart Assistant for document quality analysis. Designed for researchers, digital humanities scholars, and technical writers who author in plain-text environments and need structural feedback — readability, heading hierarchy, issue detection — without leaving the editor or sending documents to a cloud service.
6
+
7
+ [![Python](https://img.shields.io/badge/python-3.9%2B-blue)](https://www.python.org/)
8
+ [![PySide6](https://img.shields.io/badge/PySide6-6.8%2B-green)](https://wiki.qt.io/Qt_for_Python)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
10
+ [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey)]()
11
+ [![CI](https://github.com/MichailSemoglou/smart-markdown-editor/actions/workflows/ci.yml/badge.svg)](https://github.com/MichailSemoglou/smart-markdown-editor/actions)
12
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.19328281.svg)](https://doi.org/10.5281/zenodo.19328281)
13
+
14
+ ## Statement of Need
15
+
16
+ Scholars who write in Markdown — the lingua franca of digital humanities project documentation, digital editions, and computational humanities research — currently have no tool that combines the structural feedback familiar from word-processor track-changes workflows with the plain-text, version-control-friendly format that modern DH and open-science practice requires.
17
+
18
+ Existing Markdown editors either provide visual previewing with no quality analysis (Typora, Obsidian), operate headlessly with no authoring context (proselint, vale), or require cloud connectivity that creates privacy and data-sovereignty concerns (Grammarly, LanguageTool). Smart Markdown Editor fills this gap: real-time structural quality feedback, inside a Markdown-native, fully offline, open-source environment.
19
+
20
+ 100% local — **your documents never touch a server.**
21
+
22
+ ## Features
23
+
24
+ ### Core Features
25
+
26
+ - **Split-window interface**: Text editor on the left, live HTML preview on the right
27
+ - **Real-time preview**: Updates automatically as you type (300 ms debounce)
28
+ - **Syntax highlighting**: Editor highlights headings, bold, italic, code, links, and more
29
+ - **File operations**: New, Open, Save, Save As with standard keyboard shortcuts
30
+ - **Recent files menu**: Quickly reopen previously edited documents
31
+ - **Auto-save**: Periodically saves your work to prevent data loss
32
+ - **Find & Replace**: Full find and replace dialog with case-sensitive and backward search
33
+ - **Multi-format export**: Export to Markdown, Plain Text, HTML, Word (.docx), PDF, RTF, and ODT
34
+ - **Custom preview CSS**: Load any CSS file to style the live preview
35
+ - **GitHub-style rendering**: Preview styled similar to GitHub's markdown rendering
36
+ - **Cross-platform**: Windows, macOS, and Linux
37
+
38
+ ### Smart Markdown Assistant
39
+
40
+ An intelligent panel that provides real-time document analysis and quality feedback.
41
+
42
+ - **Live statistics**: Word count, character count, line count, estimated reading time
43
+ - **Structure analysis**: Heading hierarchy (H1–H6), links, images, code blocks, lists, blockquotes, tables
44
+ - **Quality metrics**: Flesch-Kincaid readability score with colour-coded rating
45
+ - **Issue detection**: Flags empty links, duplicate headings, and formatting problems
46
+ - **Auto-format**: One-click formatting that adds proper heading spacing, fixes list markers, and removes excessive blank lines
47
+
48
+ ## Screenshots
49
+
50
+ ![Smart Markdown Editor screenshot](docs/screenshot.png)
51
+
52
+ ## Installation
53
+
54
+ ```bash
55
+ # Clone the repository
56
+ git clone https://github.com/MichailSemoglou/smart-markdown-editor.git
57
+ cd smart-markdown-editor
58
+
59
+ # Create and activate a virtual environment
60
+ python3 -m venv venv
61
+ source venv/bin/activate # macOS / Linux
62
+ # venv\Scripts\activate # Windows
63
+
64
+ # Install dependencies
65
+ pip install -r requirements.txt
66
+
67
+ # Run the application
68
+ python markdown_editor.py
69
+ ```
70
+
71
+ ### Requirements
72
+
73
+ | Package | Version | Notes |
74
+ | ----------- | -------- | ------------------------- |
75
+ | Python | ≥ 3.9 | |
76
+ | PySide6 | ≥ 6.8.0 | GUI framework |
77
+ | Markdown | ≥ 3.5.1 | Markdown processing |
78
+ | Pygments | ≥ 2.0 | Syntax highlighting |
79
+ | python-docx | optional | `.docx` export |
80
+ | reportlab | optional | `.pdf` export (fallback) |
81
+ | weasyprint | optional | `.pdf` export (preferred) |
82
+ | html2text | optional | Plain-text export |
83
+
84
+ RTF and ODT export are built-in and require no extra libraries.
85
+
86
+ ## Usage
87
+
88
+ ```bash
89
+ python markdown_editor.py
90
+ ```
91
+
92
+ ### Keyboard Shortcuts
93
+
94
+ | Shortcut | Action |
95
+ | ------------------ | -------------- |
96
+ | `Cmd/Ctrl+N` | New file |
97
+ | `Cmd/Ctrl+O` | Open file |
98
+ | `Cmd/Ctrl+S` | Save |
99
+ | `Cmd/Ctrl+Shift+S` | Save As |
100
+ | `Cmd/Ctrl+F` | Find |
101
+ | `Cmd/Ctrl+H` | Find & Replace |
102
+ | `Cmd/Ctrl+Z` | Undo |
103
+ | `Cmd/Ctrl+Y` | Redo |
104
+ | `Cmd/Ctrl+Q` | Quit |
105
+
106
+ ## Export Formats
107
+
108
+ | Format | Extension | Extra dependency |
109
+ | ----------------- | --------- | --------------------------- |
110
+ | Markdown | `.md` | — |
111
+ | Plain Text | `.txt` | `html2text` (optional) |
112
+ | HTML | `.html` | — |
113
+ | Word Document | `.docx` | `python-docx` |
114
+ | PDF | `.pdf` | `weasyprint` or `reportlab` |
115
+ | Rich Text Format | `.rtf` | — |
116
+ | OpenDocument Text | `.odt` | — |
117
+
118
+ The application detects which libraries are available and shows only supported formats in the export menu.
119
+
120
+ ## Project Structure
121
+
122
+ ```
123
+ smart-markdown-editor/
124
+ ├── markdown_editor.py # Standalone legacy entry point
125
+ ├── requirements.txt
126
+ ├── README.md
127
+ ├── CONTRIBUTING.md
128
+ ├── CHANGELOG.md
129
+ ├── LICENSE
130
+ ├── src/
131
+ │ ├── main.py # Modular entry point
132
+ │ ├── config.py # Themes, constants, settings keys
133
+ │ ├── core/
134
+ │ │ ├── analyzer.py # MarkdownAnalyzer — document metrics
135
+ │ │ └── highlighter.py # MarkdownSyntaxHighlighter
136
+ │ ├── exporters/
137
+ │ │ ├── __init__.py # Exporter registry
138
+ │ │ └── builtin.py # All built-in exporters
139
+ │ ├── ui/
140
+ │ │ ├── main_window.py # MainWindow (QMainWindow)
141
+ │ │ ├── assistant_panel.py # Smart Assistant side panel
142
+ │ │ ├── dialogs.py # Find & Replace dialog
143
+ │ │ └── themes.py # ThemeManager — stylesheets & preview HTML
144
+ │ └── utils/
145
+ │ └── __init__.py # File and validation utilities
146
+ ├── tests/
147
+ │ └── test_analyzer.py # Unit tests for MarkdownAnalyzer
148
+ ├── test_exports.py # Integration tests for all exporters
149
+ └── .github/
150
+ └── workflows/
151
+ └── ci.yml # CI pipeline (lint, type-check, test, build)
152
+ ```
153
+
154
+ ## Running Tests
155
+
156
+ ```bash
157
+ pip install pytest pytest-cov
158
+ pytest tests/ test_exports.py -v --cov=src
159
+ ```
160
+
161
+ ## Technical Details
162
+
163
+ - **GUI framework**: PySide6 (Qt6)
164
+ - **Markdown processing**: Python Markdown with `codehilite`, `tables`, and `toc` extensions
165
+ - **HTML preview**: `QtWebEngineWidgets`
166
+ - **Architecture**: Modular `src/` package — core logic, UI layer, and exporters are decoupled
167
+ - **Exporter registry**: Exporters self-register; unavailable formats are hidden automatically
168
+ - **Live updates**: `QTimer`-based debounce (300 ms preview, 800 ms analysis)
169
+ - **CI**: GitHub Actions — Ruff linting, MyPy type checking, pytest on Python 3.9 and 3.12
170
+
171
+ ## Citing This Software
172
+
173
+ If you use Smart Markdown Editor in your research, please cite it using the metadata in [CITATION.cff](CITATION.cff). A ready-to-paste BibTeX entry:
174
+
175
+ ```bibtex
176
+ @software{semoglou_smart_markdown_editor_2026,
177
+ author = {Semoglou, Michail},
178
+ title = {Smart Markdown Editor},
179
+ year = {2026},
180
+ version = {1.0.0},
181
+ publisher = {Zenodo},
182
+ doi = {10.5281/zenodo.19328281},
183
+ url = {https://github.com/MichailSemoglou/smart-markdown-editor}
184
+ }
185
+ ```
186
+
187
+ ## Contributing
188
+
189
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, code style guidelines, and the pull-request workflow.
190
+
191
+ ## Changelog
192
+
193
+ See [CHANGELOG.md](CHANGELOG.md) for a full history of changes.
194
+
195
+ ## License
196
+
197
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
198
+
199
+ ## Acknowledgments
200
+
201
+ - Built with [PySide6](https://wiki.qt.io/Qt_for_Python)
202
+ - Markdown processing by [Python Markdown](https://python-markdown.github.io/)
203
+ - Syntax highlighting powered by [Pygments](https://pygments.org/)
204
+ - Positioned within the plain-text scholarship tradition: Tenen (2017) and Healy (2019)
205
+
206
+ ## Support
207
+
208
+ File an issue on the [GitHub issue tracker](https://github.com/MichailSemoglou/smart-markdown-editor/issues).
@@ -0,0 +1,132 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ # ---------------------------------------------------------------------------
6
+ # Project metadata (PEP 621)
7
+ # ---------------------------------------------------------------------------
8
+
9
+ [project]
10
+ name = "smart-markdown-editor"
11
+ version = "1.0.0"
12
+ description = "A cross-platform desktop Markdown editor with real-time preview and an integrated Smart Assistant for document quality analysis."
13
+ readme = "README.md"
14
+ license = { file = "LICENSE" }
15
+ authors = [
16
+ { name = "Michail Semoglou", email = "m.semoglou@tongji.edu.cn" }
17
+ ]
18
+ keywords = [
19
+ "markdown",
20
+ "editor",
21
+ "readability",
22
+ "document-analysis",
23
+ "academic-writing",
24
+ "pyside6",
25
+ "digital-humanities",
26
+ "plain-text-scholarship",
27
+ "scholarly-communication",
28
+ "research-software",
29
+ ]
30
+ classifiers = [
31
+ "Development Status :: 5 - Production/Stable",
32
+ "Intended Audience :: Science/Research",
33
+ "Intended Audience :: Education",
34
+ "Intended Audience :: Developers",
35
+ "License :: OSI Approved :: MIT License",
36
+ "Operating System :: OS Independent",
37
+ "Programming Language :: Python :: 3",
38
+ "Programming Language :: Python :: 3.9",
39
+ "Programming Language :: Python :: 3.12",
40
+ "Topic :: Text Editors",
41
+ "Topic :: Text Processing :: Markup",
42
+ "Topic :: Scientific/Engineering",
43
+ "Topic :: Office/Business :: Office Suites",
44
+ "Environment :: X11 Applications :: Qt",
45
+ ]
46
+ requires-python = ">=3.9"
47
+
48
+ # Core dependencies — install cleanly on all platforms with pip alone.
49
+ # weasyprint is optional (requires system-level pango/cairo — see [weasyprint] extra).
50
+ dependencies = [
51
+ "PySide6>=6.8.0",
52
+ "markdown>=3.5.1",
53
+ "pygments>=2.16.0",
54
+ "python-docx>=0.8.11",
55
+ "reportlab>=3.6.0",
56
+ "html2text>=2020.1.16",
57
+ ]
58
+
59
+ [project.optional-dependencies]
60
+ # PDF export via WeasyPrint (requires system-level pango, cairo, gdk-pixbuf).
61
+ # On macOS: brew install pango cairo gdk-pixbuf
62
+ # On Ubuntu/Debian: apt-get install libpango-1.0-0 libcairo2 libgdk-pixbuf2.0-0
63
+ weasyprint = ["weasyprint>=59.0"]
64
+
65
+ # Install everything including WeasyPrint.
66
+ all = ["smart-markdown-editor[weasyprint]"]
67
+
68
+ # Development dependencies.
69
+ dev = [
70
+ "pytest>=7.0",
71
+ "pytest-qt>=4.0",
72
+ "ruff>=0.4",
73
+ "mypy>=1.0",
74
+ ]
75
+
76
+ [project.urls]
77
+ Homepage = "https://github.com/MichailSemoglou/smart-markdown-editor"
78
+ Repository = "https://github.com/MichailSemoglou/smart-markdown-editor"
79
+ Documentation = "https://github.com/MichailSemoglou/smart-markdown-editor#readme"
80
+ "Bug Tracker" = "https://github.com/MichailSemoglou/smart-markdown-editor/issues"
81
+ Changelog = "https://github.com/MichailSemoglou/smart-markdown-editor/blob/main/CHANGELOG.md"
82
+ DOI = "https://doi.org/10.5281/zenodo.19328281"
83
+
84
+ # ---------------------------------------------------------------------------
85
+ # Entry points
86
+ # ---------------------------------------------------------------------------
87
+
88
+ [project.scripts]
89
+ # GUI application — opens the editor window.
90
+ smart-markdown-editor = "src.main:main"
91
+
92
+ # ---------------------------------------------------------------------------
93
+ # Package discovery
94
+ # ---------------------------------------------------------------------------
95
+
96
+ [tool.setuptools.packages.find]
97
+ where = ["."]
98
+ include = ["src*"]
99
+ exclude = ["tests*", "docs*"]
100
+
101
+ [tool.setuptools.package-data]
102
+ "src" = ["py.typed"]
103
+
104
+ # ---------------------------------------------------------------------------
105
+ # Ruff (linter)
106
+ # ---------------------------------------------------------------------------
107
+
108
+ [tool.ruff]
109
+ target-version = "py39"
110
+ line-length = 100
111
+
112
+ [tool.ruff.lint]
113
+ select = ["E", "F", "W", "I", "UP"]
114
+ ignore = ["E501"]
115
+
116
+ # ---------------------------------------------------------------------------
117
+ # Mypy (type checker)
118
+ # ---------------------------------------------------------------------------
119
+
120
+ [tool.mypy]
121
+ python_version = "3.9"
122
+ warn_return_any = true
123
+ warn_unused_configs = true
124
+ ignore_missing_imports = true
125
+
126
+ # ---------------------------------------------------------------------------
127
+ # Pytest
128
+ # ---------------------------------------------------------------------------
129
+
130
+ [tool.pytest.ini_options]
131
+ testpaths = ["tests", "test_exports.py"]
132
+ python_files = ["test_*.py"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+