inkflow 0.1.0.dev0__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.
Files changed (48) hide show
  1. inkflow/__init__.py +31 -0
  2. inkflow/cli.py +266 -0
  3. inkflow/content.py +227 -0
  4. inkflow/export.py +123 -0
  5. inkflow/layout.py +279 -0
  6. inkflow/manifest.py +145 -0
  7. inkflow/markdown.py +158 -0
  8. inkflow/ns.py +9 -0
  9. inkflow/pdf.html +19 -0
  10. inkflow/pipeline.py +244 -0
  11. inkflow/presenter.css +196 -0
  12. inkflow/presenter.html +50 -0
  13. inkflow/presenter.js +400 -0
  14. inkflow/server.py +380 -0
  15. inkflow/theme/layouts/center.svg +3 -0
  16. inkflow/theme/layouts/cover.svg +5 -0
  17. inkflow/theme/layouts/default.svg +4 -0
  18. inkflow/theme/layouts/end.svg +4 -0
  19. inkflow/theme/layouts/fact.svg +4 -0
  20. inkflow/theme/layouts/media-left.svg +5 -0
  21. inkflow/theme/layouts/media-right.svg +5 -0
  22. inkflow/theme/layouts/quote.svg +4 -0
  23. inkflow/theme/layouts/section.svg +4 -0
  24. inkflow/theme/layouts/statement.svg +3 -0
  25. inkflow/theme/layouts/two-cols-header.svg +5 -0
  26. inkflow/theme/layouts/two-cols.svg +5 -0
  27. inkflow/theme/main.svg +3 -0
  28. inkflow/theme/numbered-main.svg +6 -0
  29. inkflow/theme/showcase/deck.py +18 -0
  30. inkflow/theme/showcase/slides/01-cover.md +7 -0
  31. inkflow/theme/showcase/slides/02-section.md +7 -0
  32. inkflow/theme/showcase/slides/03-default.md +11 -0
  33. inkflow/theme/showcase/slides/04-center.md +8 -0
  34. inkflow/theme/showcase/slides/05-two-cols.md +17 -0
  35. inkflow/theme/showcase/slides/06-two-cols-header.md +13 -0
  36. inkflow/theme/showcase/slides/07-fact.md +7 -0
  37. inkflow/theme/showcase/slides/08-quote.md +7 -0
  38. inkflow/theme/showcase/slides/09-statement.md +3 -0
  39. inkflow/theme/showcase/slides/10-media-left.md +15 -0
  40. inkflow/theme/showcase/slides/11-media-right.md +16 -0
  41. inkflow/theme/showcase/slides/12-end.md +3 -0
  42. inkflow/theme/styles.css +55 -0
  43. inkflow/tui.py +128 -0
  44. inkflow-0.1.0.dev0.dist-info/METADATA +12 -0
  45. inkflow-0.1.0.dev0.dist-info/RECORD +48 -0
  46. inkflow-0.1.0.dev0.dist-info/WHEEL +4 -0
  47. inkflow-0.1.0.dev0.dist-info/entry_points.txt +2 -0
  48. inkflow-0.1.0.dev0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,55 @@
1
+ /* ── CSS variable defaults (dark mode) ───────────────────────────────────── */
2
+
3
+ :root {
4
+ --inkflow-bg: #1a1a2e;
5
+ --inkflow-surface: #16213e;
6
+ --inkflow-border: #0f3460;
7
+ --inkflow-text: #e0e0e0;
8
+ --inkflow-text-muted: #a0a0b0;
9
+ --inkflow-accent: #7c83fd;
10
+ --inkflow-accent-fg: #ffffff;
11
+ --inkflow-code-bg: #0d0d1a;
12
+ --inkflow-code-text: #c9d1d9;
13
+ }
14
+
15
+ :root[data-theme="light"] {
16
+ --inkflow-bg: #ffffff;
17
+ --inkflow-surface: #f5f5f5;
18
+ --inkflow-border: #e0e0e0;
19
+ --inkflow-text: #1a1a2e;
20
+ --inkflow-text-muted: #666680;
21
+ --inkflow-accent: #5c63d8;
22
+ --inkflow-accent-fg: #ffffff;
23
+ --inkflow-code-bg: #f0f0f0;
24
+ --inkflow-code-text: #1a1a2e;
25
+ }
26
+
27
+ /* ── SVG element semantic classes ────────────────────────────────────────── */
28
+
29
+ .slide-bg { fill: var(--inkflow-bg); }
30
+ .theme-surface { fill: var(--inkflow-surface); }
31
+ .theme-accent { fill: var(--inkflow-accent); }
32
+ .theme-border { fill: var(--inkflow-border); }
33
+ .theme-text { fill: var(--inkflow-text); }
34
+ .theme-text-muted { fill: var(--inkflow-text-muted); }
35
+
36
+ /* ── .inkflow-content typography ─────────────────────────────────────────── */
37
+
38
+ .inkflow-content {
39
+ font-family: sans-serif;
40
+ font-size: 1em;
41
+ color: var(--inkflow-text);
42
+ box-sizing: border-box;
43
+ overflow: hidden;
44
+ line-height: 1.4;
45
+ }
46
+ .inkflow-content p { margin-bottom: 0.5em; }
47
+ .inkflow-content ul { list-style-type: disc; padding-left: 1.5em; margin-bottom: 0.5em; }
48
+ .inkflow-content ol { list-style-type: decimal; padding-left: 1.5em; margin-bottom: 0.5em; }
49
+ .inkflow-content li { display: list-item; margin-bottom: 0.3em; }
50
+ .inkflow-content h1 { font-size: 2em; font-weight: bold; line-height: 1; margin-bottom: 0.2em; color: var(--inkflow-text); }
51
+ .inkflow-content h2 { font-size: 1.3em; line-height: 1.2; margin-bottom: 0.3em; color: var(--inkflow-text); }
52
+ .inkflow-content h3 { margin-bottom: 0.4em; color: var(--inkflow-text); }
53
+ .inkflow-content code { font-family: monospace; background: var(--inkflow-code-bg); color: var(--inkflow-code-text); padding: 0.1em 0.3em; border-radius: 3px; }
54
+ .inkflow-content pre { overflow: auto; background: var(--inkflow-code-bg); color: var(--inkflow-code-text); padding: 0.5em; border-radius: 4px; }
55
+ .inkflow-content pre code { background: none; padding: 0; }
inkflow/tui.py ADDED
@@ -0,0 +1,128 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Callable
4
+ from datetime import datetime
5
+ from pathlib import Path
6
+
7
+ from rich.console import Group, RenderableType
8
+ from rich.live import Live
9
+ from rich.panel import Panel
10
+ from rich.spinner import Spinner
11
+ from rich.text import Text
12
+
13
+
14
+ class LiveUI:
15
+ """Owns the entire terminal UI: header panel + status line."""
16
+
17
+ def __init__(
18
+ self,
19
+ live: Live,
20
+ http_port: int,
21
+ watch_path: Path,
22
+ get_clients: Callable[[], int],
23
+ ) -> None:
24
+ self._live: Live = live
25
+ self._http_port: int = http_port
26
+ self._watch_path: Path = watch_path
27
+ self._get_clients: Callable[[], int] = get_clients
28
+ self._phase: str = "idle"
29
+ self._slides: int = 0
30
+ self._elapsed: float = 0.0
31
+ self._built_at: str = ""
32
+ self._error_trace: str | None = None
33
+ self._show_trace: bool = False
34
+
35
+ def _header(self) -> RenderableType:
36
+ clients = self._get_clients()
37
+ client_str = f"{clients} client{'s' if clients != 1 else ''}"
38
+
39
+ title = Text()
40
+ title.append("ink", style="bold white")
41
+ title.append("flow", style="bold blue")
42
+
43
+ content = Group(
44
+ Text.assemble(
45
+ (f"http://localhost:{self._http_port}", "bold"),
46
+ (" · ", "dim"),
47
+ (client_str, "dim"),
48
+ ),
49
+ Text.assemble(
50
+ (str(self._watch_path), "dim"),
51
+ overflow="ellipsis",
52
+ no_wrap=True,
53
+ ),
54
+ Text(""),
55
+ Text.assemble(
56
+ ("o", "bold"),
57
+ (" open", "dim"),
58
+ (" · ", "dim"),
59
+ ("r", "bold"),
60
+ (" rebuild", "dim"),
61
+ (" · ", "dim"),
62
+ ("q", "bold"),
63
+ (" quit", "dim"),
64
+ ),
65
+ )
66
+ return Panel(
67
+ content, title=title, title_align="left", expand=False, padding=(0, 2)
68
+ )
69
+
70
+ def _renderable(self) -> RenderableType:
71
+ parts: list[RenderableType] = [Text(""), self._header(), Text("")]
72
+
73
+ if self._phase == "building":
74
+ parts.append(Spinner("dots", text=" Building…"))
75
+ elif self._phase == "ok":
76
+ slide_word = "slide" if self._slides == 1 else "slides"
77
+ summary = f" ✓ built {self._slides} {slide_word} in {self._elapsed:.2f}s"
78
+ parts.append(
79
+ Text.assemble(
80
+ (summary, "bold green"),
81
+ (" · ", "white"),
82
+ (self._built_at, "white"),
83
+ )
84
+ )
85
+ elif self._phase == "error":
86
+ tb = self._error_trace or ""
87
+ last_line = next(
88
+ (line for line in reversed(tb.splitlines()) if line.strip()),
89
+ "unknown error",
90
+ )
91
+ parts.append(Text(f" ✗ {last_line}", style="bold red", no_wrap=True))
92
+ if self._show_trace:
93
+ for line in tb.rstrip().splitlines():
94
+ parts.append(Text(line, style="dim red"))
95
+ parts.append(Text("[t] hide trace", style="dim"))
96
+ else:
97
+ parts.append(Text("[t] show trace", style="dim"))
98
+
99
+ return Group(*parts)
100
+
101
+ def refresh(self) -> None:
102
+ self._live.update(self._renderable())
103
+ self._live.refresh()
104
+
105
+ def set_building(self) -> None:
106
+ self._phase = "building"
107
+ self.refresh()
108
+
109
+ def set_ok(self, slides: int, elapsed: float) -> None:
110
+ self._phase = "ok"
111
+ self._slides = slides
112
+ self._elapsed = elapsed
113
+ self._built_at = datetime.now().strftime("%H:%M:%S")
114
+ self._error_trace = None
115
+ self._show_trace = False
116
+ self.refresh()
117
+
118
+ def set_error(self, error_trace: str) -> None:
119
+ self._phase = "error"
120
+ self._error_trace = error_trace
121
+ self._show_trace = False
122
+ self.refresh()
123
+
124
+ def toggle_trace(self) -> None:
125
+ if self._phase != "error":
126
+ return
127
+ self._show_trace = not self._show_trace
128
+ self.refresh()
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: inkflow
3
+ Version: 0.1.0.dev0
4
+ Summary: Beautiful slides from SVG. Your editor, your style.
5
+ License-File: LICENSE
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: click>=8.0
8
+ Requires-Dist: lxml>=5.0
9
+ Requires-Dist: markdown-it-py>=3.0
10
+ Requires-Dist: rich>=15.0.0
11
+ Requires-Dist: watchfiles>=0.21
12
+ Requires-Dist: websockets>=12.0
@@ -0,0 +1,48 @@
1
+ inkflow/__init__.py,sha256=yjsIqQukKy6y3YmMvPF5_ou-7DSj33oSiRF3MQqmbLs,408
2
+ inkflow/cli.py,sha256=WLOOTO6o3riz3qw34jtPk38YA0Ol06fMKT6PfSc3yQg,8784
3
+ inkflow/content.py,sha256=hBmg1LURnBRNcvnNfa7YCaYi0g6n2L9dZsYxNVXBsdg,6489
4
+ inkflow/export.py,sha256=wmGCfeBSRzyxtTWc2eBexnX96ccRrQPWnk9VxOfrf6E,4093
5
+ inkflow/layout.py,sha256=qC48H8QW7chJp6TgRm3YXLEleZvyDBP_sAaD79Ik-Dc,10076
6
+ inkflow/manifest.py,sha256=0vLq7qfYg-ya1hwdtJUIyRcAo-4Fi5SSBZ7ZLQMoiho,3389
7
+ inkflow/markdown.py,sha256=DCtEoJIncgzL7im7A9Uzvg2HKFJZkcDtQoPA1ObJJ2g,4451
8
+ inkflow/ns.py,sha256=JAj8NwUy6l9_ujbm-0oYr76eq71tEpXeO--w1sKCFBw,358
9
+ inkflow/pdf.html,sha256=XgYYqpJZsn1Arr_Q_61QGZrQUYpQpjADSUIFEL1PHtI,573
10
+ inkflow/pipeline.py,sha256=0D-deQQwv8iCkA61pnwviEmOdGo0auxYROe16caDcJA,7774
11
+ inkflow/presenter.css,sha256=Q7vt0osj4LP7M7kgBbYUJ-_4Lnoszq2DbyiTp-pdfNs,3692
12
+ inkflow/presenter.html,sha256=O1fS_QY_5uiXNyWr7nTur0y3dKdEeThN0i5uNQkspz0,1732
13
+ inkflow/presenter.js,sha256=RdVMbH7HZzU5FAKdkaCt0PCa_ooPSQWstcpDrNWELE4,14152
14
+ inkflow/server.py,sha256=u8ypRqFzFsnCNmQxw5A8M4cm2IpZH7m4T4gCZIIeisE,13668
15
+ inkflow/tui.py,sha256=hzmkNasVkN-8tdjYlz3lPJDgbpaei50OI8RJT3phUxk,4137
16
+ inkflow/theme/main.svg,sha256=llGCofiMiAsGhIDfniFbfHcv8zxDMZrXkAFNclx2KN8,153
17
+ inkflow/theme/numbered-main.svg,sha256=qfJnk5NZANIcOOcBU2xi0UjVTKaJ_yZncQCmfKAkgKQ,586
18
+ inkflow/theme/styles.css,sha256=aNiriEoxnalnZ97qdZrL6FT5UEMCArAvHqWEeS5ZQDE,2506
19
+ inkflow/theme/layouts/center.svg,sha256=I0hVWm5QhhJDDSqrJ-PD8NW0G7LXR9Mtlb0D0FHR9wU,233
20
+ inkflow/theme/layouts/cover.svg,sha256=P500SJiZzMGeer1RbDZc8lMTVpbTrynHcOk6DdSjBqU,362
21
+ inkflow/theme/layouts/default.svg,sha256=_U8QAFOVXq95lopPR-yeVtKcl63WWEtgnQ5jEI5u9dc,300
22
+ inkflow/theme/layouts/end.svg,sha256=iI-S_vmS_o4RTB2BVGsxPog8iCBEGzELP396zyM6VGk,295
23
+ inkflow/theme/layouts/fact.svg,sha256=zcLqCOJzdjrkzlnRhzhHgEtGS7xLx7M-6u_Y5MhbA-Q,300
24
+ inkflow/theme/layouts/media-left.svg,sha256=qa1JDQE_HQ11GL9SCZu9x93Nz9SkvxSaepjM39fYRQM,367
25
+ inkflow/theme/layouts/media-right.svg,sha256=NitoKd7bj1aQExXUk2KKg0gNFYzdtOrYfsPxAze8Ico,367
26
+ inkflow/theme/layouts/quote.svg,sha256=CQCt9_oG9OKth9o82-f7U4KFzxTQHh2nUgas9QP-TK4,307
27
+ inkflow/theme/layouts/section.svg,sha256=lRuzpNKUwOK7N1X7WbPqQW1s2ETqRjqHf7N1lEOkuFc,309
28
+ inkflow/theme/layouts/statement.svg,sha256=fPxatXrDCInOL9vF8urE-c90eAGabhy6MvgZRoYGrrY,236
29
+ inkflow/theme/layouts/two-cols-header.svg,sha256=gZXj5nzNGnQ52PY56LSSErAPqytP0pIWo5ht4K__h_s,365
30
+ inkflow/theme/layouts/two-cols.svg,sha256=GppIYP3YFIIdva2GKnJ1r2w7p6xby6w73TMQI46sywA,364
31
+ inkflow/theme/showcase/deck.py,sha256=-NpOVjeZwTQrexH7O99uVhDYPndA4KT_8Ph8NWCuI24,755
32
+ inkflow/theme/showcase/slides/01-cover.md,sha256=mrBJGy5XwftwkgSq5U2ETz4yWTkKiGDiH1LiDgUF7F0,99
33
+ inkflow/theme/showcase/slides/02-section.md,sha256=JSpDv0GhkXuV6ajX_vloG79FNvA2AntjKykIx6GpIDs,99
34
+ inkflow/theme/showcase/slides/03-default.md,sha256=O_WR4b0yV-GaRwESilsIx_AM0as94SZSaBZKMXJmHBs,285
35
+ inkflow/theme/showcase/slides/04-center.md,sha256=D5n_lEmeUFmlbWt54dXh6xXnur8sa42obZ24HnFHO1c,171
36
+ inkflow/theme/showcase/slides/05-two-cols.md,sha256=JEwDPSB8evUsYzX5MVHZB3C_FYIqLZOa2nXRodfydbY,289
37
+ inkflow/theme/showcase/slides/06-two-cols-header.md,sha256=EXKzX9Pnn4JlCd5PCKbGHvwcE2nh-R6LX2mCgFTuMgs,315
38
+ inkflow/theme/showcase/slides/07-fact.md,sha256=C5bDxQ6bJlZtg29O6FxES_fiaAqQIp55kwxZtHqIdck,118
39
+ inkflow/theme/showcase/slides/08-quote.md,sha256=blAqUY5QpLLlVmYWCIa7ewGgFFd03DJQ-l0L8h3Ug1g,111
40
+ inkflow/theme/showcase/slides/09-statement.md,sha256=7gI9Tg_tAuTo7AiFhS0xVmqUimfa6_fxd5EOx0v6ov8,38
41
+ inkflow/theme/showcase/slides/10-media-left.md,sha256=D1PKOTnhHZTbfSe5jetHk9FTC2uZI_e4ZSP1eaZZgxU,282
42
+ inkflow/theme/showcase/slides/11-media-right.md,sha256=QXsXhgLIo5TYy-FUaPDJSlM3GhzGndYKiymEPrT7Z-M,332
43
+ inkflow/theme/showcase/slides/12-end.md,sha256=2MjhdzEcGw5O9Ak0bI4WejBs5l-X2xSasfh1MqNFaig,91
44
+ inkflow-0.1.0.dev0.dist-info/METADATA,sha256=Jw9ONwg98HAH8HFNZr9djLe3gXxtFjGqNz-e6c7hiN0,341
45
+ inkflow-0.1.0.dev0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
46
+ inkflow-0.1.0.dev0.dist-info/entry_points.txt,sha256=rg59G9K-FvIq8sWkI_9FPWc5zMW81YxF8r1q1DlTKwk,45
47
+ inkflow-0.1.0.dev0.dist-info/licenses/LICENSE,sha256=b7TT4hr5WxzznOZtpfWFAsjpqJWSNdQQbGS0tqYuu6k,1070
48
+ inkflow-0.1.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ inkflow = inkflow.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nick Le Large
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.