yom 0.1.0a0__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.
- yom-0.1.0a0/LICENSE +21 -0
- yom-0.1.0a0/PKG-INFO +130 -0
- yom-0.1.0a0/README.md +119 -0
- yom-0.1.0a0/pyproject.toml +43 -0
- yom-0.1.0a0/setup.cfg +4 -0
- yom-0.1.0a0/src/yom/__init__.py +3 -0
- yom-0.1.0a0/src/yom/__main__.py +4 -0
- yom-0.1.0a0/src/yom/assets/app.js +513 -0
- yom-0.1.0a0/src/yom/assets/shell.html +111 -0
- yom-0.1.0a0/src/yom/assets/style.css +958 -0
- yom-0.1.0a0/src/yom/cli.py +95 -0
- yom-0.1.0a0/src/yom/server.py +537 -0
- yom-0.1.0a0/src/yom.egg-info/PKG-INFO +130 -0
- yom-0.1.0a0/src/yom.egg-info/SOURCES.txt +18 -0
- yom-0.1.0a0/src/yom.egg-info/dependency_links.txt +1 -0
- yom-0.1.0a0/src/yom.egg-info/entry_points.txt +2 -0
- yom-0.1.0a0/src/yom.egg-info/requires.txt +2 -0
- yom-0.1.0a0/src/yom.egg-info/top_level.txt +1 -0
- yom-0.1.0a0/tests/test_cli.py +132 -0
- yom-0.1.0a0/tests/test_server.py +199 -0
yom-0.1.0a0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kj-9
|
|
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.
|
yom-0.1.0a0/PKG-INFO
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yom
|
|
3
|
+
Version: 0.1.0a0
|
|
4
|
+
Summary: Markdown tree web server with live updates
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: Markdown>=3.6
|
|
9
|
+
Requires-Dist: watchdog>=6.0.0
|
|
10
|
+
Dynamic: license-file
|
|
11
|
+
|
|
12
|
+
# yom
|
|
13
|
+
|
|
14
|
+
`yom` is a local web viewer for Markdown trees. It scans a directory, renders `.md` files, and serves them in a sidebar-based browser UI with live reload.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- Recursively discovers Markdown files
|
|
19
|
+
- Shows a file tree in the sidebar
|
|
20
|
+
- Renders Markdown as HTML
|
|
21
|
+
- Resolves relative links and image paths inside Markdown
|
|
22
|
+
- Watches for file changes and updates the browser automatically
|
|
23
|
+
- Starts a local server with a single command
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
Install from PyPI:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install yom
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you use `uv`, you can also run it without a manual virtual environment step:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv tool install yom
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
Serve the current directory:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yom .
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Serve a specific directory:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
yom /path/to/docs
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
By default, `yom` starts a local server on `http://127.0.0.1:8000` and opens it in your browser.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
yom /path/to/docs --host 127.0.0.1 --port 8000 --interval 0.7 --title "My docs"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Options available through `yom --help`:
|
|
62
|
+
|
|
63
|
+
- `root`: directory to scan
|
|
64
|
+
- `--host`: bind host
|
|
65
|
+
- `--port`: bind port
|
|
66
|
+
- `--interval`: polling interval for change detection, in seconds
|
|
67
|
+
- `--no-watch`: disable file watching
|
|
68
|
+
- `--watch-mode {auto,poll,watchdog}`: choose the watch backend
|
|
69
|
+
- `--title`: browser window title
|
|
70
|
+
- `--no-open`: disable automatic browser launch on startup
|
|
71
|
+
- `--markdown-extension NAME`: enable an additional Markdown extension
|
|
72
|
+
- `--no-default-extensions`: disable the built-in Markdown extensions
|
|
73
|
+
|
|
74
|
+
Enable an extra Markdown extension:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
yom /path/to/docs --markdown-extension admonition
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`--markdown-extension` does not enable a yom-specific feature. It passes an additional
|
|
81
|
+
extension name through to the underlying Python-Markdown renderer. For example,
|
|
82
|
+
`admonition` enables admonition block syntax supported by Python-Markdown.
|
|
83
|
+
|
|
84
|
+
By default, yom enables `fenced_code`, `tables`, `toc`, and `sane_lists`. Use
|
|
85
|
+
`--no-default-extensions` if you want to start from an empty extension set and opt in
|
|
86
|
+
only to the extensions you need.
|
|
87
|
+
|
|
88
|
+
Run with the minimal Markdown configuration:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
yom /path/to/docs --no-default-extensions
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Relative Paths
|
|
95
|
+
|
|
96
|
+
- Markdown links such as `./other.md` and `../guide.md` are converted into in-app navigation
|
|
97
|
+
- Image paths such as `./image.png` are served as local assets
|
|
98
|
+
- References that point outside the scanned directory tree are left unresolved
|
|
99
|
+
|
|
100
|
+
## Watch Behavior
|
|
101
|
+
|
|
102
|
+
To disable file watching:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
yom /path/to/docs --no-watch
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
To force the `watchdog` backend:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
yom /path/to/docs --watch-mode watchdog
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
To disable automatic browser opening:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
yom /path/to/docs --no-open
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Development
|
|
121
|
+
|
|
122
|
+
For local development with the repository checked out:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
uv sync --group dev
|
|
126
|
+
make test
|
|
127
|
+
make ci-check
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The Japanese translation is available at [README.ja.md](README.ja.md).
|
yom-0.1.0a0/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# yom
|
|
2
|
+
|
|
3
|
+
`yom` is a local web viewer for Markdown trees. It scans a directory, renders `.md` files, and serves them in a sidebar-based browser UI with live reload.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Recursively discovers Markdown files
|
|
8
|
+
- Shows a file tree in the sidebar
|
|
9
|
+
- Renders Markdown as HTML
|
|
10
|
+
- Resolves relative links and image paths inside Markdown
|
|
11
|
+
- Watches for file changes and updates the browser automatically
|
|
12
|
+
- Starts a local server with a single command
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install from PyPI:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install yom
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If you use `uv`, you can also run it without a manual virtual environment step:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv tool install yom
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
Serve the current directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yom .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Serve a specific directory:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
yom /path/to/docs
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
By default, `yom` starts a local server on `http://127.0.0.1:8000` and opens it in your browser.
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yom /path/to/docs --host 127.0.0.1 --port 8000 --interval 0.7 --title "My docs"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Options available through `yom --help`:
|
|
51
|
+
|
|
52
|
+
- `root`: directory to scan
|
|
53
|
+
- `--host`: bind host
|
|
54
|
+
- `--port`: bind port
|
|
55
|
+
- `--interval`: polling interval for change detection, in seconds
|
|
56
|
+
- `--no-watch`: disable file watching
|
|
57
|
+
- `--watch-mode {auto,poll,watchdog}`: choose the watch backend
|
|
58
|
+
- `--title`: browser window title
|
|
59
|
+
- `--no-open`: disable automatic browser launch on startup
|
|
60
|
+
- `--markdown-extension NAME`: enable an additional Markdown extension
|
|
61
|
+
- `--no-default-extensions`: disable the built-in Markdown extensions
|
|
62
|
+
|
|
63
|
+
Enable an extra Markdown extension:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
yom /path/to/docs --markdown-extension admonition
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`--markdown-extension` does not enable a yom-specific feature. It passes an additional
|
|
70
|
+
extension name through to the underlying Python-Markdown renderer. For example,
|
|
71
|
+
`admonition` enables admonition block syntax supported by Python-Markdown.
|
|
72
|
+
|
|
73
|
+
By default, yom enables `fenced_code`, `tables`, `toc`, and `sane_lists`. Use
|
|
74
|
+
`--no-default-extensions` if you want to start from an empty extension set and opt in
|
|
75
|
+
only to the extensions you need.
|
|
76
|
+
|
|
77
|
+
Run with the minimal Markdown configuration:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
yom /path/to/docs --no-default-extensions
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Relative Paths
|
|
84
|
+
|
|
85
|
+
- Markdown links such as `./other.md` and `../guide.md` are converted into in-app navigation
|
|
86
|
+
- Image paths such as `./image.png` are served as local assets
|
|
87
|
+
- References that point outside the scanned directory tree are left unresolved
|
|
88
|
+
|
|
89
|
+
## Watch Behavior
|
|
90
|
+
|
|
91
|
+
To disable file watching:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
yom /path/to/docs --no-watch
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To force the `watchdog` backend:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
yom /path/to/docs --watch-mode watchdog
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
To disable automatic browser opening:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
yom /path/to/docs --no-open
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
For local development with the repository checked out:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv sync --group dev
|
|
115
|
+
make test
|
|
116
|
+
make ci-check
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The Japanese translation is available at [README.ja.md](README.ja.md).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "yom"
|
|
7
|
+
version = "0.1.0a0"
|
|
8
|
+
description = "Markdown tree web server with live updates"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"Markdown>=3.6",
|
|
13
|
+
"watchdog>=6.0.0",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[dependency-groups]
|
|
17
|
+
dev = [
|
|
18
|
+
"pytest>=8.3.0",
|
|
19
|
+
"ruff>=0.11.0",
|
|
20
|
+
"ty>=0.0.1a14",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
yom = "yom.cli:main"
|
|
25
|
+
|
|
26
|
+
[tool.setuptools]
|
|
27
|
+
package-dir = {"" = "src"}
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["src"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.package-data]
|
|
33
|
+
yom = ["assets/*.html", "assets/*.css", "assets/*.js"]
|
|
34
|
+
|
|
35
|
+
[tool.pytest.ini_options]
|
|
36
|
+
testpaths = ["tests"]
|
|
37
|
+
|
|
38
|
+
[tool.ruff]
|
|
39
|
+
line-length = 100
|
|
40
|
+
target-version = "py311"
|
|
41
|
+
|
|
42
|
+
[tool.ruff.lint]
|
|
43
|
+
select = ["E", "F", "I"]
|
yom-0.1.0a0/setup.cfg
ADDED