smart-markdown-editor 1.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,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,20 @@
1
+ smart_markdown_editor-1.0.0.dist-info/licenses/LICENSE,sha256=EV4Gnsw0m4vG_pBZ_lEEjxqvjtLQhsFwYTRpghuQQJ0,1073
2
+ src/__init__.py,sha256=YI_uZYH0jfVkczTeHxBEckAXLbnXP8MW2RYk3RToOL4,309
3
+ src/config.py,sha256=mUBSOb06GBz0_wDT1MGlvTKiaXwIJRDG1JlO3wXqYt0,5777
4
+ src/main.py,sha256=4JZ0VMuoo7B6djmkXYb7_I3qpSSKzcBBLCC8JI0EcbY,1180
5
+ src/core/__init__.py,sha256=MfQiCJGsN81ksv1BZlbNUaiiK9_rIb2auhUTo5SZ4Oo,337
6
+ src/core/analyzer.py,sha256=x-dCBEbF4YbD2mNXFnMqony7f1Bv-TU5eGg9pqGsG0Q,12797
7
+ src/core/highlighter.py,sha256=PTe7ZbFG8KvnYLPEQKGThP3qyp73rlXCif2JThz34Tc,8162
8
+ src/exporters/__init__.py,sha256=fMxdzYtZV_n_NKw2YVZlyjV5ghjL9J6QfQ2zyD128sY,4353
9
+ src/exporters/builtin.py,sha256=iJdNp2wY6hrBMRRIJiEJDUpxIE8UDOi-J-a4HwThF0I,17429
10
+ src/ui/__init__.py,sha256=PVadaJFzfMBf2WPskqyOyW2Dp9X9hd6qft98BgldpvA,235
11
+ src/ui/assistant_panel.py,sha256=9nK-iDQynsiJTtmnWZiLyCmTT3P1hMVZ9b47_FJhrS4,7138
12
+ src/ui/dialogs.py,sha256=jjKr6IY1DwEnPcZj2MNrIJ4SKA-gEdT6MFClUGPkKVk,7571
13
+ src/ui/main_window.py,sha256=WXqirxic0R33tWwH6OtdOsHZYf0VKuf4EENpxC-2EXQ,22003
14
+ src/ui/themes.py,sha256=RRs8Pbu07H65kjppLvsM-WiKMZWkqwTB-TOvAIroEag,7072
15
+ src/utils/__init__.py,sha256=r2yabNrlQLGWKwdmrsc06AJX4sWADngQdfnxxieP1NM,7760
16
+ smart_markdown_editor-1.0.0.dist-info/METADATA,sha256=ML8JjDpFnWuHuiZDXUR4cvD-_pmm-EFg-bAppEUoLh0,12766
17
+ smart_markdown_editor-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
18
+ smart_markdown_editor-1.0.0.dist-info/entry_points.txt,sha256=OQdjlLCa7_Ic_HZPijjo4kXS4rDqF4bkuCBlGQSIhrk,56
19
+ smart_markdown_editor-1.0.0.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
20
+ smart_markdown_editor-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ smart-markdown-editor = src.main:main
@@ -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.
src/__init__.py ADDED
@@ -0,0 +1,8 @@
1
+ """Smart Markdown Editor - A cross-platform markdown editor with live preview.
2
+
3
+ This package provides a modern, feature-rich markdown editor built with PySide6
4
+ that includes real-time preview, document analysis, and multi-format export capabilities.
5
+ """
6
+
7
+ __version__ = "2.0.0"
8
+ __author__ = "Michail Semoglou"
src/config.py ADDED
@@ -0,0 +1,165 @@
1
+ """Configuration constants for the Smart Markdown Editor.
2
+
3
+ This module contains all configurable constants, timing values, and settings
4
+ used throughout the application. Centralizing these values makes the codebase
5
+ more maintainable and allows for easy customization.
6
+ """
7
+
8
+ from typing import Final
9
+
10
+ # =============================================================================
11
+ # Application Metadata
12
+ # =============================================================================
13
+
14
+ APP_NAME: Final[str] = "Smart Markdown Editor"
15
+ APP_VERSION: Final[str] = "1.0.0"
16
+ APP_ORGANIZATION: Final[str] = "smart-markdown-editor"
17
+
18
+ # =============================================================================
19
+ # Timing Constants (in milliseconds)
20
+ # =============================================================================
21
+
22
+ # Delay before updating the HTML preview after text changes
23
+ PREVIEW_UPDATE_DELAY_MS: Final[int] = 300
24
+
25
+ # Delay before updating document analysis after text changes
26
+ ANALYSIS_UPDATE_DELAY_MS: Final[int] = 800
27
+
28
+ # Default auto-save interval
29
+ DEFAULT_AUTOSAVE_INTERVAL_MS: Final[int] = 30_000 # 30 seconds
30
+
31
+ # =============================================================================
32
+ # File Size Limits
33
+ # =============================================================================
34
+
35
+ # Maximum file size in bytes (10 MB)
36
+ MAX_FILE_SIZE_BYTES: Final[int] = 10 * 1024 * 1024
37
+
38
+ # Maximum recent files to store
39
+ MAX_RECENT_FILES: Final[int] = 10
40
+
41
+ # =============================================================================
42
+ # Editor Settings
43
+ # =============================================================================
44
+
45
+ # Default font settings
46
+ DEFAULT_FONT_FAMILY: Final[str] = "SF Mono"
47
+ DEFAULT_FONT_SIZE: Final[int] = 14
48
+
49
+ # Fallback font families
50
+ FONT_FALLBACKS: Final[list[str]] = [
51
+ "Monaco", "Menlo", "Consolas", "Courier New", "monospace"
52
+ ]
53
+
54
+ # =============================================================================
55
+ # Reading/Analysis Constants
56
+ # =============================================================================
57
+
58
+ # Average words per minute for reading time estimation
59
+ WORDS_PER_MINUTE: Final[int] = 200
60
+
61
+ # Maximum recommended paragraph length (words)
62
+ MAX_PARAGRAPH_LENGTH_WARNING: Final[int] = 100
63
+ MAX_PARAGRAPH_LENGTH_ERROR: Final[int] = 150
64
+
65
+ # Maximum recommended line length
66
+ MAX_LINE_LENGTH_WARNING: Final[int] = 120
67
+
68
+ # =============================================================================
69
+ # Theme Colors
70
+ # =============================================================================
71
+
72
+ class LightTheme:
73
+ """Color constants for light theme."""
74
+ EDITOR_BG: Final[str] = "#ffffff"
75
+ EDITOR_FG: Final[str] = "#333333"
76
+ EDITOR_BORDER: Final[str] = "#ddd"
77
+ SELECTION_BG: Final[str] = "#0078d4"
78
+ SELECTION_FG: Final[str] = "#ffffff"
79
+
80
+ # Syntax highlighting colors
81
+ HEADING_COLOR: Final[str] = "#0b4f9c"
82
+ MUTED_COLOR: Final[str] = "#6a737d"
83
+ RULE_COLOR: Final[str] = "#d0d7de"
84
+ CODE_FG: Final[str] = "#0969da"
85
+ CODE_BG: Final[str] = "#f6f8fa"
86
+ LINK_COLOR: Final[str] = "#0969da"
87
+ URL_COLOR: Final[str] = "#1a7f37"
88
+
89
+
90
+ class DarkTheme:
91
+ """Color constants for dark theme."""
92
+ EDITOR_BG: Final[str] = "#0d1117"
93
+ EDITOR_FG: Final[str] = "#c9d1d9"
94
+ EDITOR_BORDER: Final[str] = "#30363d"
95
+ SELECTION_BG: Final[str] = "#2f81f7"
96
+ SELECTION_FG: Final[str] = "#ffffff"
97
+
98
+ # Syntax highlighting colors
99
+ HEADING_COLOR: Final[str] = "#2f81f7"
100
+ MUTED_COLOR: Final[str] = "#8b949e"
101
+ RULE_COLOR: Final[str] = "#30363d"
102
+ CODE_FG: Final[str] = "#c9d1d9"
103
+ CODE_BG: Final[str] = "#161b22"
104
+ LINK_COLOR: Final[str] = "#2f81f7"
105
+ URL_COLOR: Final[str] = "#3fb950"
106
+
107
+
108
+ # =============================================================================
109
+ # Preview CSS Constants
110
+ # =============================================================================
111
+
112
+ # Maximum content width in preview
113
+ PREVIEW_MAX_WIDTH: Final[str] = "800px"
114
+ PREVIEW_PADDING: Final[str] = "20px"
115
+
116
+ # =============================================================================
117
+ # Export Settings
118
+ # =============================================================================
119
+
120
+ # Supported export formats
121
+ SUPPORTED_EXPORT_FORMATS: Final[list[str]] = [
122
+ "md", "txt", "html", "docx", "pdf", "rtf", "odt"
123
+ ]
124
+
125
+ # File filter patterns for export dialogs
126
+ EXPORT_FILE_FILTERS: Final[dict[str, str]] = {
127
+ "md": "Markdown Files (*.md)",
128
+ "txt": "Text Files (*.txt)",
129
+ "html": "HTML Files (*.html)",
130
+ "docx": "Word Documents (*.docx)",
131
+ "pdf": "PDF Files (*.pdf)",
132
+ "rtf": "Rich Text Format (*.rtf)",
133
+ "odt": "OpenDocument Text (*.odt)",
134
+ }
135
+
136
+ # =============================================================================
137
+ # Quality Thresholds
138
+ # =============================================================================
139
+
140
+ # Readability score thresholds
141
+ READABILITY_EXCELLENT: Final[int] = 80
142
+ READABILITY_GOOD: Final[int] = 60
143
+ READABILITY_POOR: Final[int] = 40
144
+
145
+ # =============================================================================
146
+ # Window Settings
147
+ # =============================================================================
148
+
149
+ # Default window geometry
150
+ DEFAULT_WINDOW_WIDTH: Final[int] = 1400
151
+ DEFAULT_WINDOW_HEIGHT: Final[int] = 900
152
+
153
+ # Default splitter sizes (editor, preview, assistant)
154
+ DEFAULT_SPLITTER_SIZES: Final[list[int]] = [420, 630, 350]
155
+
156
+ # =============================================================================
157
+ # Settings Keys
158
+ # =============================================================================
159
+
160
+ class SettingsKeys:
161
+ """Keys used for QSettings storage."""
162
+ DARK_MODE: Final[str] = "darkMode"
163
+ PREVIEW_CSS_PATH: Final[str] = "previewCssPath"
164
+ AUTOSAVE_INTERVAL_MS: Final[str] = "autoSaveIntervalMs"
165
+ RECENT_FILES: Final[str] = "recentFiles"
src/core/__init__.py ADDED
@@ -0,0 +1,10 @@
1
+ """Core modules for the Smart Markdown Editor.
2
+
3
+ This package contains the core functionality including:
4
+ - MarkdownAnalyzer: Document analysis and quality metrics
5
+ - MarkdownSyntaxHighlighter: Syntax highlighting for the editor (UI-only, import directly)
6
+ """
7
+
8
+ from src.core.analyzer import MarkdownAnalyzer
9
+
10
+ __all__ = ["MarkdownAnalyzer"]