Skip to content

Commit f36b642

Browse files
Initial commit
Add basic Markdown editor. Encryption and advanced features not-yet-done.
0 parents  commit f36b642

13 files changed

Lines changed: 2137 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.venv/
2+
__pycache__/
3+
*.py[cod]
4+
.pytest_cache/
5+
.ruff_cache/
6+
.ty_cache/
7+
*.egg-info/
8+
dist/
9+
build/
10+
.python-version

‎README.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Morgul
2+
3+
Minimal Windows 11 Notepad-style **Markdown** editor (dark UI).
4+
5+
## Features
6+
7+
- Tabbed editing (new / open / close, dirty stars)
8+
- Markdown syntax highlighting
9+
- Live HTML preview pane (`Ctrl+Shift+P`)
10+
- Find & Replace (`Ctrl+F` / `Ctrl+H`): match case, whole word, regex, in selection, in highlighted zones only
11+
- Open / save UTF-8 Markdown files
12+
13+
## Requirements
14+
15+
- Python 3.10+
16+
- [uv](https://docs.astral.sh/uv/)
17+
18+
## Setup
19+
20+
```bash
21+
uv sync
22+
```
23+
24+
## Run
25+
26+
```bash
27+
uv run morgul
28+
```
29+
30+
## Develop
31+
32+
```bash
33+
uv run ruff check .
34+
uv run ruff format .
35+
uv run ty check
36+
uv run pytest
37+
```
38+
39+
## License
40+
41+
**Unlicense** (public domain). Runtime GUI toolkit is **PySide6-Essentials** (LGPL-3.0). Markdown parsing is **markdown-it-py** (MIT). No GPL/AGPL-only dependencies.

‎UNLICENSE‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <https://unlicense.org>

‎pyproject.toml‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
[project]
2+
name = "morgul"
3+
version = "0.1.0"
4+
description = "Minimal Windows 11 Notepad-style Markdown editor"
5+
readme = "README.md"
6+
# App is Unlicense. Runtime deps stay permissive (no GPL/AGPL-only).
7+
license = "Unlicense"
8+
authors = [
9+
{ name = "python-processing-unit", email = "darthmalware@orderofsithlords.onmicrosoft.com" },
10+
]
11+
# Floor: markdown-it-py 4 / pytest 9 / modern PySide6 all need 3.10+.
12+
requires-python = ">=3.10"
13+
dependencies = [
14+
# CommonMark → HTML for the preview pane (MIT).
15+
# 4.0.0 is the first 4.x line; requires-python >=3.10 (matches us).
16+
"markdown-it-py>=4.0.0",
17+
# GFM task lists for markdown-it-py (MIT). 0.4.0 still on py>=3.8.
18+
"mdit-py-plugins>=0.4.0",
19+
# Qt widgets only — skip PySide6_Addons. LGPL-3.0 OR GPL (we use LGPL terms).
20+
# 6.6.0: stable Essentials split; 6.9+ needed if you run on 3.13 (resolver picks it).
21+
"PySide6-Essentials>=6.6.0",
22+
# typing.override back-port (stdlib only since 3.12). 4.4.0 first shipped it.
23+
"typing-extensions>=4.4.0",
24+
]
25+
26+
[project.scripts]
27+
morgul = "morgul.app:run"
28+
29+
[build-system]
30+
requires = ["uv_build>=0.12.0,<0.13.0"]
31+
build-backend = "uv_build"
32+
33+
[dependency-groups]
34+
dev = [
35+
# 8.0.0: first pytest 8; requires-python was >=3.8 (fine on 3.10+).
36+
"pytest>=8.0.0",
37+
# 0.9.0: modern lint config (preview, stable ALL set). requires-python >=3.7.
38+
"ruff>=0.9.0",
39+
# 0.0.50: rules table + `all = "error"` are dependable. requires-python >=3.8.
40+
"ty>=0.0.50",
41+
]
42+
43+
[tool.uv]
44+
default-groups = ["dev"]
45+
46+
# --- ruff: strictest practical ---
47+
[tool.ruff]
48+
target-version = "py310"
49+
line-length = 88
50+
preview = true
51+
src = ["src", "tests"]
52+
53+
[tool.ruff.lint]
54+
select = ["ALL"]
55+
ignore = [
56+
# Formatter wars — ruff format owns these.
57+
"missing-trailing-comma",
58+
"single-line-implicit-string-concatenation",
59+
# Docstring style pairs that conflict with each other.
60+
"incorrect-blank-line-before-class",
61+
"multi-line-summary-second-line",
62+
# Unlicense / public domain — no copyright headers.
63+
"missing-copyright-notice",
64+
]
65+
66+
[tool.ruff.lint.per-file-ignores]
67+
# Tests may be a little looser (asserts, magic values, no main-guard demos).
68+
"tests/**" = [
69+
"assert",
70+
"magic-value-comparison",
71+
"D",
72+
"ANN",
73+
"implicit-namespace-package",
74+
]
75+
76+
[tool.ruff.lint.pydocstyle]
77+
convention = "google"
78+
79+
[tool.ruff.format]
80+
quote-style = "double"
81+
indent-style = "space"
82+
line-ending = "lf"
83+
84+
# --- ty: every rule is an error ---
85+
[tool.ty.environment]
86+
python-version = "3.10"
87+
88+
[tool.ty.rules]
89+
all = "error"
90+
91+
[tool.pytest.ini_options]
92+
testpaths = ["tests"]
93+
pythonpath = ["src"]
94+
addopts = "-q"

‎src/morgul/__init__.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Morgul — a tiny Win11-Notepad-flavoured Markdown editor.
2+
3+
Run with: ``uv run morgul`` or ``python -m morgul``.
4+
"""
5+
6+
from __future__ import annotations
7+
8+
__all__ = ["__version__"]
9+
10+
__version__ = "0.1.0"

‎src/morgul/__main__.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""``python -m morgul`` entry."""
2+
3+
from morgul.app import run
4+
5+
if __name__ == "__main__":
6+
run()

0 commit comments

Comments
 (0)