pocket-press 0.1.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,2 @@
1
+ """Markdown in, print-and-fold pocket books and card decks out."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())
pocket_press/chrome.py ADDED
@@ -0,0 +1,157 @@
1
+ """Headless Chrome: HTML file to PDF, and an overflow check.
2
+
3
+ The browser is found in this order:
4
+ 1. the CHROME environment variable,
5
+ 2. Chrome, Chromium or Edge installed on the system,
6
+ 3. the Chromium that Playwright downloads (``pip install "pocket-press[full]"``,
7
+ then ``pocket-press setup``).
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import functools
12
+ import os
13
+ import re
14
+ import shutil
15
+ import subprocess
16
+ import sys
17
+ from pathlib import Path
18
+
19
+ SYSTEM = [
20
+ # macOS
21
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
22
+ "/Applications/Chromium.app/Contents/MacOS/Chromium",
23
+ "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
24
+ # Windows
25
+ r"C:\Program Files\Google\Chrome\Application\chrome.exe",
26
+ r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
27
+ r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
28
+ # on PATH (Linux and others)
29
+ "google-chrome", "google-chrome-stable", "chromium", "chromium-browser", "chrome",
30
+ "microsoft-edge", "msedge",
31
+ ]
32
+
33
+ INSTALL_HELP = """\
34
+ pocket-press needs Google Chrome, Chromium or Microsoft Edge to make PDFs,
35
+ and none was found. Pick one:
36
+
37
+ 1. Install Google Chrome: https://www.google.com/chrome/
38
+
39
+ 2. Let pocket-press download its own Chromium (about 150 MB), via Playwright:
40
+ uv tool install "pocket-press[full]" or: pipx install "pocket-press[full]"
41
+ pocket-press setup
42
+
43
+ 3. Use a browser you already have:
44
+ CHROME=/path/to/chrome pocket-press build mybook.md
45
+ """
46
+
47
+ NEEDS_DOWNLOAD = """\
48
+ No Chrome found. Playwright is installed, but its Chromium isn't downloaded yet.
49
+ Run: pocket-press setup
50
+ """
51
+
52
+
53
+ class BrowserNotFound(RuntimeError):
54
+ pass
55
+
56
+
57
+ def has_playwright() -> bool:
58
+ try:
59
+ import playwright # noqa: F401
60
+ except ImportError:
61
+ return False
62
+ return True
63
+
64
+
65
+ def system_browser() -> str | None:
66
+ env = os.environ.get("CHROME")
67
+ if env:
68
+ return env
69
+ for c in SYSTEM:
70
+ if os.path.isabs(c):
71
+ if os.path.exists(c):
72
+ return c
73
+ else:
74
+ found = shutil.which(c)
75
+ if found:
76
+ return found
77
+ return None
78
+
79
+
80
+ def playwright_browser() -> str | None:
81
+ """Path to Playwright's Chromium if the package is installed and the browser downloaded."""
82
+ if not has_playwright():
83
+ return None
84
+ try:
85
+ from playwright.sync_api import sync_playwright
86
+ with sync_playwright() as p:
87
+ path = p.chromium.executable_path
88
+ except Exception:
89
+ return None
90
+ return path if path and os.path.exists(path) else None
91
+
92
+
93
+ def install_playwright_chromium() -> bool:
94
+ """Download Playwright's Chromium. Returns True on success."""
95
+ r = subprocess.run([sys.executable, "-m", "playwright", "install", "--no-shell", "chromium"])
96
+ playwright_browser_cached.cache_clear()
97
+ return r.returncode == 0 and playwright_browser_cached() is not None
98
+
99
+
100
+ @functools.lru_cache(maxsize=None)
101
+ def playwright_browser_cached() -> str | None:
102
+ return playwright_browser()
103
+
104
+
105
+ def locate() -> tuple[str | None, str]:
106
+ """(path, where) for the browser that would be used; path is None if there is none."""
107
+ path = system_browser()
108
+ if path:
109
+ return path, "CHROME" if os.environ.get("CHROME") else "system"
110
+ path = playwright_browser_cached()
111
+ if path:
112
+ return path, "playwright"
113
+ return None, "none"
114
+
115
+
116
+ def _ask(question: str) -> bool:
117
+ if not (sys.stdin.isatty() and sys.stdout.isatty()):
118
+ return False
119
+ try:
120
+ return input(question).strip().lower() in ("y", "yes")
121
+ except EOFError:
122
+ return False
123
+
124
+
125
+ @functools.lru_cache(maxsize=None)
126
+ def find_chrome() -> str:
127
+ path, _ = locate()
128
+ if path:
129
+ return path
130
+ if has_playwright():
131
+ if _ask("No Chrome found. Download Chromium for pocket-press now (about 150 MB)? [y/N] "):
132
+ if install_playwright_chromium():
133
+ return playwright_browser_cached() # type: ignore[return-value]
134
+ raise BrowserNotFound(NEEDS_DOWNLOAD)
135
+ raise BrowserNotFound(INSTALL_HELP)
136
+
137
+
138
+ def _run(args: list[str]) -> str:
139
+ base = [find_chrome(), "--headless=new", "--disable-gpu", "--hide-scrollbars",
140
+ "--no-pdf-header-footer", "--virtual-time-budget=10000"]
141
+ if hasattr(os, "geteuid") and os.geteuid() == 0:
142
+ base.append("--no-sandbox") # Chrome refuses to run as root (e.g. in Docker) without it
143
+ r = subprocess.run(base + args, capture_output=True, text=True, timeout=180)
144
+ return r.stdout
145
+
146
+
147
+ def to_pdf(html_path: Path, pdf_path: Path) -> None:
148
+ _run([f"--print-to-pdf={pdf_path}", html_path.resolve().as_uri()])
149
+ if not pdf_path.exists():
150
+ raise RuntimeError(f"Chrome did not write {pdf_path}")
151
+
152
+
153
+ def overflowing(html_path: Path) -> list[str]:
154
+ """Titles of pages/cards whose content does not fit."""
155
+ dom = _run(["--dump-dom", html_path.resolve().as_uri()])
156
+ return re.findall(r'data-overflow="1"[^>]*data-title="([^"]*)"', dom) + \
157
+ re.findall(r'data-title="([^"]*)"[^>]*data-overflow="1"', dom)
pocket_press/cli.py ADDED
@@ -0,0 +1,198 @@
1
+ """pocket-press: Markdown in, print-and-fold pocket books and card decks out."""
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import shutil
6
+ import sys
7
+ import tempfile
8
+ from pathlib import Path
9
+
10
+ from . import __version__, chrome, impose, render
11
+ from .source import load
12
+
13
+ FORMATS = ("cards", "a7", "a6", "zine")
14
+
15
+ HOW = {
16
+ "cards": "Print single-sided at 100%. Cut along the dashed lines. The first card is the cover.",
17
+ "a7": ("Print double-sided, flip on LONG edge, at 100%. Cut each sheet into quarters on the dashed lines. "
18
+ "Stack the pieces by the small numbers (1 outside), fold in half on the marks, staple twice on the fold."),
19
+ "a6": ("Print double-sided, flip on LONG edge, at 100%. Cut each sheet in half on the dashed line. "
20
+ "Stack the halves by the small numbers (1 outside), fold in half, staple twice on the fold."),
21
+ "zine": ("Print single-sided at 100%. Crease into eighths, cut the dashed slit in the middle, "
22
+ "fold long-ways and push the ends together into a book."),
23
+ }
24
+
25
+
26
+ def _render(html: str, work: Path, name: str, check: bool = True) -> Path:
27
+ src = work / f"{name}.html"
28
+ src.write_text(html, encoding="utf-8")
29
+ pdf = work / f"{name}.pdf"
30
+ chrome.to_pdf(src, pdf)
31
+ if check:
32
+ over = chrome.overflowing(src)
33
+ if over:
34
+ print(f" warning: text does not fit on: {', '.join(dict.fromkeys(over))}", file=sys.stderr)
35
+ return pdf
36
+
37
+
38
+ def _booklet_guides(sheets: int, folded: int, size: str) -> str:
39
+ items = []
40
+ for k in range(sheets):
41
+ g = []
42
+ slots = range(k * (2 if size == "a6" else 4), min(folded, (k + 1) * (2 if size == "a6" else 4)))
43
+ if size == "a6":
44
+ g.append(render.hline("cut", 148.5, 0, 210))
45
+ for i, s in enumerate(slots):
46
+ top = 0 if i == 0 else 148.5
47
+ g.append(render.vline("fold", 105, top, 4))
48
+ g.append(render.vline("fold", 105, top + 144.5, 4))
49
+ g.append(render.label(f"{s + 1}/{folded}", 106, top + 140))
50
+ else:
51
+ g.append(render.vline("cut", 105, 0, 297))
52
+ g.append(render.hline("cut", 148.5, 0, 210))
53
+ for i, s in enumerate(slots):
54
+ left = [0, 105, 0, 105][i]
55
+ top = [0, 0, 148.5, 148.5][i]
56
+ mid = top + 74.25
57
+ g.append(render.hline("fold", mid, left, 4))
58
+ g.append(render.hline("fold", mid, left + 101, 4))
59
+ g.append(render.label(f"{s + 1}/{folded}", left + 5, mid - 0.2, -90))
60
+ items.append("".join(g))
61
+ return render.guides_html(items, landscape=False)
62
+
63
+
64
+ def build(source: Path, out: Path, formats: list[str]) -> list[Path]:
65
+ book = load(source)
66
+ chrome.find_chrome() # fail early, with install help, if there is no browser
67
+ t = render.theme(book)
68
+ out.mkdir(parents=True, exist_ok=True)
69
+ made: list[Path] = []
70
+ with tempfile.TemporaryDirectory(prefix="pocket-press-") as tmp:
71
+ work = Path(tmp)
72
+ for fmt in formats:
73
+ target = out / f"{book.slug}-{'booklet-' + fmt if fmt in ('a6', 'a7') else fmt}.pdf"
74
+ if fmt != "zine":
75
+ print(f"{fmt}: {target}")
76
+ if fmt == "cards":
77
+ pdf = _render(render.cards_html(book, t), work, "cards")
78
+ shutil.copy(pdf, target)
79
+ elif fmt in ("a6", "a7"):
80
+ items = render.faces(book, t, multiple=4)
81
+ pages = _render(render.pages_html(book, t, fmt, items), work, f"pages-{fmt}")
82
+ folded = len(items) // 4
83
+ per = 2 if fmt == "a6" else 4
84
+ sheets = (folded + per - 1) // per
85
+ guides = _render(_booklet_guides(sheets, folded, fmt), work, f"guides-{fmt}", check=False)
86
+ impose.booklet(str(pages), str(target), fmt, str(guides))
87
+ print(f" {len(items)} pages, {sheets} A4 sheet(s), {folded} folded piece(s)")
88
+ elif fmt == "zine":
89
+ try:
90
+ items = render.faces(book, t, multiple=8, max_pages=8)
91
+ except ValueError as e:
92
+ print(f"zine: skipped, {e}. Use a7 or a6 for longer books.")
93
+ continue
94
+ print(f"zine: {target}")
95
+ pages = _render(render.pages_html(book, t, "a7", items), work, "pages-zine")
96
+ g = (render.hline("cut", 105, 74.25, 148.5)
97
+ + "".join(render.vline("fold", x, 0, 210) for x in (74.25, 148.5, 222.75))
98
+ + render.label("cut", 146, 103))
99
+ guides = _render(render.guides_html([g], landscape=True), work, "guides-zine", check=False)
100
+ impose.zine(str(pages), str(target), str(guides))
101
+ print(f" {HOW[fmt]}")
102
+ made.append(target)
103
+ return made
104
+
105
+
106
+ TEMPLATE = """---
107
+ title: My Pocket Book
108
+ subtitle: One line about what this is for.
109
+ kicker: Pocket book
110
+ author: Your name
111
+ tagline: The one line you want to remember.
112
+ licence: Your licence, if you share it.
113
+ colophon: |
114
+ Where the ideas came from. Credit your sources here.
115
+ ---
116
+
117
+ Text up here, before the first section, becomes a "How to use this book" page.
118
+
119
+ # First section
120
+
121
+ Text here becomes a divider page in the booklets. Leave it out if you don't want one.
122
+
123
+ ## A page title
124
+
125
+ Write the page in Markdown. Keep it short: an A7 page holds about 80 words.
126
+
127
+ > A closing quote becomes the line at the foot of the page or card.
128
+
129
+ ## Another page
130
+
131
+ - Lists work
132
+ - So does **bold** and *italic*
133
+
134
+ > One line to carry.
135
+ """
136
+
137
+
138
+ def setup() -> int:
139
+ """Report the browser in use, or download Playwright's Chromium if there is none."""
140
+ path, where = chrome.locate()
141
+ if path:
142
+ label = {"CHROME": "from $CHROME", "system": "installed on this computer",
143
+ "playwright": "downloaded by Playwright"}[where]
144
+ print(f"Ready. Using the browser {label}:\n {path}")
145
+ return 0
146
+ if not chrome.has_playwright():
147
+ print(chrome.INSTALL_HELP, file=sys.stderr)
148
+ return 1
149
+ print("No Chrome found. Downloading Chromium with Playwright (about 150 MB)...")
150
+ if chrome.install_playwright_chromium():
151
+ print(f"Ready. Using:\n {chrome.playwright_browser_cached()}")
152
+ return 0
153
+ print("The download failed. See the messages above.", file=sys.stderr)
154
+ return 1
155
+
156
+
157
+ def main(argv: list[str] | None = None) -> int:
158
+ ap = argparse.ArgumentParser(prog="pocket-press", description=__doc__)
159
+ ap.add_argument("--version", action="version", version=f"pocket-press {__version__}")
160
+ sub = ap.add_subparsers(dest="cmd", required=True)
161
+ b = sub.add_parser("build", help="build printable PDFs from a Markdown source")
162
+ b.add_argument("source", type=Path)
163
+ b.add_argument("-f", "--format", action="append", choices=FORMATS + ("all",),
164
+ help="cards, a7, a6, zine or all (default: all). Repeat for several.")
165
+ b.add_argument("-o", "--out", type=Path, help="output folder (default: dist/ next to the source)")
166
+ n = sub.add_parser("new", help="write a starter Markdown source")
167
+ n.add_argument("path", type=Path)
168
+ sub.add_parser("setup", help="check for Chrome, or download Chromium if there is none")
169
+ args = ap.parse_args(argv)
170
+
171
+ if args.cmd == "setup":
172
+ return setup()
173
+
174
+ if args.cmd == "new":
175
+ if args.path.exists():
176
+ ap.error(f"{args.path} already exists")
177
+ args.path.write_text(TEMPLATE, encoding="utf-8")
178
+ print(f"wrote {args.path}. Edit it, then: pocket-press build {args.path}")
179
+ return 0
180
+
181
+ fmts = args.format or ["all"]
182
+ formats = list(FORMATS) if "all" in fmts else list(dict.fromkeys(fmts))
183
+ out = args.out or args.source.parent / "dist"
184
+ if not args.source.exists():
185
+ ap.error(f"{args.source} not found")
186
+ try:
187
+ build(args.source, out, formats)
188
+ except chrome.BrowserNotFound as e:
189
+ print(e, file=sys.stderr)
190
+ return 1
191
+ except RuntimeError as e:
192
+ print(f"error: {e}", file=sys.stderr)
193
+ return 1
194
+ return 0
195
+
196
+
197
+ if __name__ == "__main__":
198
+ sys.exit(main())
pocket_press/impose.py ADDED
@@ -0,0 +1,112 @@
1
+ """Put rendered pages onto A4 sheets in fold order (imposition)."""
2
+ from __future__ import annotations
3
+
4
+ from pypdf import PageObject, PdfReader, PdfWriter, Transformation
5
+
6
+ MM = 72 / 25.4
7
+ A4 = (210 * MM, 297 * MM)
8
+
9
+
10
+ def place(sheet: PageObject, src: PageObject, x: float, y: float, w: float, h: float, rot: int = 0) -> None:
11
+ """Draw `src` into the box (x, y, w, h), in points, rotated by `rot` degrees (CCW positive)."""
12
+ pw, ph = float(src.mediabox.width), float(src.mediabox.height)
13
+ if rot in (0, 180):
14
+ s = min(w / pw, h / ph)
15
+ else:
16
+ s = min(h / pw, w / ph)
17
+ sw, sh = pw * s, ph * s
18
+ t = Transformation().scale(s, s)
19
+ if rot == 0:
20
+ t = t.translate(x, y)
21
+ elif rot == 180:
22
+ t = t.rotate(180).translate(x + sw, y + sh)
23
+ elif rot == -90: # clockwise: page head points right
24
+ t = t.rotate(-90).translate(x, y + sw)
25
+ elif rot == 90: # anticlockwise: page head points left
26
+ t = t.rotate(90).translate(x + sh, y)
27
+ else:
28
+ raise ValueError(rot)
29
+ sheet.merge_transformed_page(src, t)
30
+
31
+
32
+ def saddle_order(n: int) -> list[tuple[tuple[int, int], tuple[int, int]]]:
33
+ """For n pages (a multiple of 4), each folded sheet's (front L, R) and (back L, R), 1-based."""
34
+ assert n % 4 == 0
35
+ out = []
36
+ for s in range(n // 4):
37
+ out.append(((n - 2 * s, 1 + 2 * s), (2 + 2 * s, n - 1 - 2 * s)))
38
+ return out
39
+
40
+
41
+ def booklet(pages_pdf: str, out_pdf: str, size: str, guides_pdf: str | None = None) -> int:
42
+ """Duplex A4 sheets (flip on long edge). Returns the number of A4 sheets.
43
+
44
+ a6: each A4 side holds 2 folded sheets (top and bottom halves), 2 A6 pages each.
45
+ a7: each A4 side holds 4 folded sheets (quadrants), 2 A7 pages each, turned 90 degrees.
46
+ """
47
+ src = PdfReader(pages_pdf).pages
48
+ n = len(src)
49
+ order = saddle_order(n)
50
+ per = 2 if size == "a6" else 4
51
+ guides = PdfReader(guides_pdf).pages if guides_pdf else None
52
+ W, H = A4
53
+ out = PdfWriter()
54
+ sheets = (len(order) + per - 1) // per
55
+
56
+ for k in range(sheets):
57
+ front = PageObject.create_blank_page(width=W, height=H)
58
+ back = PageObject.create_blank_page(width=W, height=H)
59
+ for slot in range(per):
60
+ idx = k * per + slot
61
+ if idx >= len(order):
62
+ break
63
+ (fl, fr), (bl, br) = order[idx]
64
+ if size == "a6":
65
+ y = H / 2 if slot == 0 else 0
66
+ pw, ph = W / 2, H / 2
67
+ place(front, src[fl - 1], 0, y, pw, ph)
68
+ place(front, src[fr - 1], pw, y, pw, ph)
69
+ place(back, src[bl - 1], 0, y, pw, ph)
70
+ place(back, src[br - 1], pw, y, pw, ph)
71
+ else:
72
+ qw, qh = W / 2, H / 2
73
+ fx = [0, qw, 0, qw][slot]
74
+ bx = [qw, 0, qw, 0][slot] # long-edge flip mirrors left and right
75
+ qy = [qh, qh, 0, 0][slot]
76
+ half = qh / 2
77
+ # front: left page on top, right page below, heads to the right
78
+ place(front, src[fl - 1], fx, qy + half, qw, half, -90)
79
+ place(front, src[fr - 1], fx, qy, qw, half, -90)
80
+ # back: heads to the left; the page behind each front page
81
+ place(back, src[br - 1], bx, qy + half, qw, half, 90)
82
+ place(back, src[bl - 1], bx, qy, qw, half, 90)
83
+ if guides is not None:
84
+ front.merge_page(guides[k])
85
+ out.add_page(front)
86
+ out.add_page(back)
87
+ with open(out_pdf, "wb") as f:
88
+ out.write(f)
89
+ return sheets
90
+
91
+
92
+ def zine(pages_pdf: str, out_pdf: str, guides_pdf: str | None = None) -> None:
93
+ """One-sheet 8-page zine, single-sided, A4 landscape.
94
+
95
+ Bottom row left to right: 6 7 8 1. Top row (upside down): 5 4 3 2.
96
+ """
97
+ src = PdfReader(pages_pdf).pages
98
+ if len(src) != 8:
99
+ raise ValueError("a zine needs exactly 8 pages")
100
+ W, H = A4[1], A4[0]
101
+ cw, rh = W / 4, H / 2
102
+ sheet = PageObject.create_blank_page(width=W, height=H)
103
+ for col, p in enumerate([6, 7, 8, 1]):
104
+ place(sheet, src[p - 1], col * cw, 0, cw, rh)
105
+ for col, p in enumerate([5, 4, 3, 2]):
106
+ place(sheet, src[p - 1], col * cw, rh, cw, rh, 180)
107
+ if guides_pdf:
108
+ sheet.merge_page(PdfReader(guides_pdf).pages[0])
109
+ out = PdfWriter()
110
+ out.add_page(sheet)
111
+ with open(out_pdf, "wb") as f:
112
+ out.write(f)
pocket_press/render.py ADDED
@@ -0,0 +1,218 @@
1
+ """HTML for pages, cards and print guides."""
2
+ from __future__ import annotations
3
+
4
+ import html
5
+ import markdown as md
6
+
7
+ from .source import Book, Page
8
+
9
+ E = html.escape
10
+ PALETTE = ["#2F6F55", "#8A6A1F", "#2F5D6B", "#6B3F5A", "#1B2A57", "#7A3B4A"]
11
+ GOOGLE = ('<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;600;700;800'
12
+ '&family=Kalam:wght@400;700&display=swap" rel="stylesheet">')
13
+
14
+ # page sizes in mm (portrait) and a type scale
15
+ SIZES = {"a7": (74.25, 105.0, 1.0), "a6": (105.0, 148.5, 1.32)}
16
+
17
+ CHECK = """<script>
18
+ window.addEventListener('load', function () {
19
+ (document.fonts ? document.fonts.ready : Promise.resolve()).then(function () {
20
+ document.querySelectorAll('[data-title]').forEach(function (e) {
21
+ if (e.scrollHeight > e.clientHeight + 2) e.setAttribute('data-overflow', '1');
22
+ });
23
+ });
24
+ });
25
+ </script>"""
26
+
27
+
28
+ def theme(book: Book) -> dict:
29
+ m = book.meta
30
+ colours = dict(m.get("colours") or m.get("colors") or {})
31
+ for i, s in enumerate(book.sections):
32
+ colours.setdefault(s, PALETTE[i % len(PALETTE)])
33
+ return {
34
+ "accent": m.get("accent", "#2F6F55"),
35
+ "ink": m.get("ink", "#1B2A57"),
36
+ "colours": colours,
37
+ "fonts": GOOGLE if m.get("fonts", "google") == "google" else "",
38
+ "footer": m.get("footer", m.get("title", "")),
39
+ }
40
+
41
+
42
+ def _root_css(t: dict) -> str:
43
+ return (f":root{{--ink:{t['ink']};--accent:{t['accent']};--text:#17211E;--muted:#5A6763;"
44
+ "--paper:#F6F8F3;--dot:#C9D3CB;--hl:#F4DC6B;"
45
+ "--hand:'Kalam','Bradley Hand','Segoe Print',cursive;"
46
+ "--sans:'Public Sans','Helvetica Neue',Helvetica,Arial,sans-serif}"
47
+ "*{box-sizing:border-box}html,body{margin:0;padding:0}"
48
+ "html{-webkit-print-color-adjust:exact;print-color-adjust:exact}"
49
+ "body{font-family:var(--sans);color:var(--text);background:#fff}")
50
+
51
+
52
+ def _colour(t: dict, page: Page) -> str:
53
+ return t["colours"].get(page.section, t["accent"])
54
+
55
+
56
+ # ---------------------------------------------------------------- pages
57
+
58
+ PAGE_CSS = """
59
+ @page{size:%(w)smm %(h)smm;margin:0}
60
+ .pg{--s:%(s)s;width:%(w)smm;height:%(h)smm;overflow:hidden;break-after:page;position:relative;
61
+ padding:calc(6mm*var(--s)) calc(5.5mm*var(--s)) calc(4.5mm*var(--s));display:flex;flex-direction:column}
62
+ .pg:last-child{break-after:auto}
63
+ .chip{font-size:calc(5.2pt*var(--s));font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--c)}
64
+ .pg h2{font-family:var(--hand);font-weight:700;font-size:calc(15pt*var(--s));line-height:1.05;color:var(--ink);margin:calc(1mm*var(--s)) 0 calc(2.2mm*var(--s))}
65
+ .body{flex:1 1 auto;font-size:calc(7.5pt*var(--s));line-height:1.42}
66
+ .body p{margin:0 0 .55em}.body ul,.body ol{margin:0 0 .55em;padding-left:1.2em}.body li{margin:.1em 0}
67
+ .body h3{font-size:1em;margin:.6em 0 .2em;color:var(--c)}
68
+ .line{margin:0;padding-top:calc(1.6mm*var(--s));border-top:.3mm solid rgba(27,42,87,.16);
69
+ font-family:var(--hand);font-size:calc(9.6pt*var(--s));line-height:1.22;color:var(--c)}
70
+ .foot{display:flex;justify-content:space-between;font-size:calc(5pt*var(--s));color:var(--muted);
71
+ margin-top:calc(2mm*var(--s));letter-spacing:.04em}
72
+ .nofoot .foot{display:none}
73
+ .paper{background-color:var(--paper);background-image:radial-gradient(var(--dot) .3mm,transparent .4mm);
74
+ background-size:calc(4.2mm*var(--s)) calc(4.2mm*var(--s))}
75
+ .cover{justify-content:space-between}
76
+ .cover .kicker{font-size:calc(5.6pt*var(--s));font-weight:800;letter-spacing:.18em;text-transform:uppercase;color:var(--accent)}
77
+ .cover h1{font-family:var(--hand);font-weight:700;font-size:calc(26pt*var(--s));line-height:.98;color:var(--ink);margin:calc(1.5mm*var(--s)) 0 0}
78
+ .cover .sub{font-size:calc(7pt*var(--s));line-height:1.4;color:var(--muted);margin-top:calc(2mm*var(--s))}
79
+ .cover .tag{font-family:var(--hand);font-weight:700;font-size:calc(11pt*var(--s));line-height:1.25;color:var(--ink);
80
+ border:.45mm solid var(--ink);border-radius:1mm;padding:calc(2mm*var(--s)) calc(2.5mm*var(--s));transform:rotate(-1.2deg)}
81
+ .cover .by{font-size:calc(5.6pt*var(--s));color:var(--muted)}
82
+ .divider h2{margin-top:auto}
83
+ .divider h2{font-size:calc(21pt*var(--s));color:var(--c)}
84
+ .notes h2{color:var(--muted)}
85
+ .notes .rules{flex:1;background-image:linear-gradient(to top,#CFD7D2 .25mm,transparent .25mm);background-size:100%% calc(5.6mm*var(--s))}
86
+ .colophon .body{font-size:calc(6.4pt*var(--s));color:var(--muted)}
87
+ """
88
+
89
+
90
+ def _foot(t: dict, n: int) -> str:
91
+ return f'<div class="foot"><span>{E(str(t["footer"]))}</span><span>{n}</span></div>'
92
+
93
+
94
+ def face_cover(book: Book, t: dict) -> str:
95
+ m = book.meta
96
+ tag = f'<div class="tag">{E(str(m["tagline"]))}</div>' if m.get("tagline") else "<div></div>"
97
+ kicker = E(str(m.get("kicker", "Pocket book")))
98
+ sub = f'<div class="sub">{E(str(m["subtitle"]))}</div>' if m.get("subtitle") else ""
99
+ by = E(str(m.get("author", "")))
100
+ return (f'<section class="pg cover paper" data-title="cover"><div><div class="kicker">{kicker}</div>'
101
+ f'<h1>{E(str(m.get("title", "")))}</h1>{sub}</div>{tag}<div class="by">{by}</div></section>')
102
+
103
+
104
+ def face_page(p: Page, t: dict, n: int) -> str:
105
+ c = _colour(t, p)
106
+ chip = f'<div class="chip">{E(p.section)}</div>' if p.section and p.kind == "content" else ""
107
+ line = f'<p class="line">{E(p.line)}</p>' if p.line else ""
108
+ cls = {"content": "", "intro": "", "divider": " divider paper"}[p.kind]
109
+ return (f'<section class="pg{cls}" style="--c:{c}" data-title="{E(p.title)}">{chip}<h2>{E(p.title)}</h2>'
110
+ f'<div class="body">{p.body_html}</div>{line}{_foot(t, n)}</section>')
111
+
112
+
113
+ def face_notes(t: dict, n: int) -> str:
114
+ return (f'<section class="pg notes" data-title="notes"><h2>Notes</h2><div class="rules"></div>'
115
+ f'{_foot(t, n)}</section>')
116
+
117
+
118
+ def face_colophon(book: Book, t: dict) -> str:
119
+ m = book.meta
120
+ body = md.markdown(str(m.get("colophon", "")).strip()) if m.get("colophon") else ""
121
+ lic = f'<p>{E(str(m["licence"]))}</p>' if m.get("licence") else ""
122
+ return (f'<section class="pg colophon" data-title="colophon"><h2>{E(str(m.get("colophon_title", "About this book")))}</h2>'
123
+ f'<div class="body">{body}{lic}<p>Made with pocket-press.</p></div>'
124
+ f'<p class="line" style="--c:var(--accent)">{E(str(m.get("tagline", "")))}</p></section>')
125
+
126
+
127
+ def faces(book: Book, t: dict, multiple: int, max_pages: int | None = None) -> list[str]:
128
+ """Cover, intro/dividers/pages, notes padding, colophon last. Length is a multiple of `multiple`."""
129
+ body = [p for p in book.pages]
130
+ out = [face_cover(book, t)]
131
+ for p in body:
132
+ out.append(face_page(p, t, len(out) + 1))
133
+ total = len(out) + 1
134
+ pad = (-total) % multiple
135
+ for _ in range(pad):
136
+ out.append(face_notes(t, len(out) + 1))
137
+ out.append(face_colophon(book, t))
138
+ if max_pages and len(out) > max_pages:
139
+ raise ValueError(f"{len(out)} pages; this format holds {max_pages}")
140
+ return out
141
+
142
+
143
+ def pages_html(book: Book, t: dict, size: str, items: list[str]) -> str:
144
+ w, h, s = SIZES[size]
145
+ css = _root_css(t) + PAGE_CSS % {"w": w, "h": h, "s": s}
146
+ return (f"<!doctype html><html lang='en'><head><meta charset='utf-8'>{t['fonts']}<style>{css}</style></head>"
147
+ f"<body>{''.join(items)}{CHECK}</body></html>")
148
+
149
+
150
+ # ---------------------------------------------------------------- cards
151
+
152
+ CARD_CSS = """
153
+ @page{size:A4;margin:9mm}
154
+ .sheet{width:192mm;display:grid;grid-template-columns:repeat(2,93mm);grid-auto-rows:67mm;gap:3mm 6mm;break-after:page}
155
+ .sheet:last-child{break-after:auto}
156
+ .card{border:.4mm dashed #B9C2BD;border-radius:3mm;padding:3.5mm 4mm;overflow:hidden;display:flex;flex-direction:column}
157
+ .top{display:flex;align-items:center;justify-content:space-between}
158
+ .chip{display:inline-block;padding:1mm 2.8mm;border-radius:5mm;background:var(--c);color:#fff;font-size:6.2pt;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
159
+ .num{font-size:6.3pt;color:#8A948F;letter-spacing:.06em;font-weight:600}
160
+ .title{font-family:var(--hand);font-size:16pt;font-weight:700;line-height:1.05;margin:1.6mm 0 1.2mm;color:var(--ink)}
161
+ .body{font-size:8pt;line-height:1.36;color:#2E3A36}.body p{margin:0 0 .45em}.body ul,.body ol{margin:0 0 .45em;padding-left:1.1em}
162
+ .line{margin-top:auto;padding-top:1.4mm;border-top:.3mm solid rgba(27,42,87,.15);font-family:var(--hand);font-size:10pt;line-height:1.2;color:var(--c)}
163
+ .card.cover{border-style:solid;border-color:var(--ink);background-color:var(--paper);
164
+ background-image:radial-gradient(var(--dot) .35mm,transparent .45mm);background-size:4.2mm 4.2mm;padding:5mm 6mm}
165
+ .cover .kicker{font-size:6.3pt;font-weight:800;letter-spacing:.18em;color:var(--accent);text-transform:uppercase}
166
+ .cover h1{font-family:var(--hand);font-size:24pt;line-height:1;color:var(--ink);margin:1.5mm 0 0}
167
+ .cover .sub{font-size:7.6pt;line-height:1.4;color:var(--muted);margin-top:1.5mm}
168
+ .cover .tag{margin-top:auto;font-family:var(--hand);font-size:12pt;font-weight:700;color:var(--ink)}
169
+ .cover .tag span{background:linear-gradient(transparent 14%,var(--hl) 14% 86%,transparent 86%);padding:0 1mm}
170
+ """
171
+
172
+
173
+ def cards_html(book: Book, t: dict) -> str:
174
+ m = book.meta
175
+ cards = book.content
176
+ n = len(cards)
177
+ tag = f'<div class="tag"><span>{E(str(m["tagline"]))}</span></div>' if m.get("tagline") else ""
178
+ sub = f'<div class="sub">{E(str(m["subtitle"]))}</div>' if m.get("subtitle") else ""
179
+ cells = [f'<div class="card cover" data-title="cover"><div class="kicker">{E(str(m.get("deck_kicker", "Deck")))} &middot; {n} cards</div>'
180
+ f'<h1>{E(str(m.get("title", "")))}</h1>{sub}{tag}</div>']
181
+ for i, p in enumerate(cards, 1):
182
+ line = f'<p class="line">{E(p.line)}</p>' if p.line else ""
183
+ chip = f'<span class="chip">{E(p.section)}</span>' if p.section else "<span></span>"
184
+ cells.append(f'<div class="card" style="--c:{_colour(t, p)}" data-title="{E(p.title)}">'
185
+ f'<div class="top">{chip}<span class="num">{i:02d} / {n}</span></div>'
186
+ f'<h2 class="title">{E(p.title)}</h2><div class="body">{p.body_html}</div>{line}</div>')
187
+ sheets = "".join('<div class="sheet">' + "".join(cells[i:i + 8]) + "</div>" for i in range(0, len(cells), 8))
188
+ return (f"<!doctype html><html lang='en'><head><meta charset='utf-8'>{t['fonts']}"
189
+ f"<style>{_root_css(t)}{CARD_CSS}</style></head><body>{sheets}{CHECK}</body></html>")
190
+
191
+
192
+ # ---------------------------------------------------------------- guides
193
+
194
+ def guides_html(sheets: list[str], landscape: bool) -> str:
195
+ """One A4 page per item; each item is absolutely positioned guide markup."""
196
+ size = "297mm 210mm" if landscape else "210mm 297mm"
197
+ w, h = ("297mm", "210mm") if landscape else ("210mm", "297mm")
198
+ css = (f"@page{{size:{size};margin:0}}html,body{{margin:0;padding:0}}"
199
+ f".a4{{position:relative;width:{w};height:{h};break-after:page;overflow:hidden}}"
200
+ ".a4:last-child{break-after:auto}"
201
+ ".cut{position:absolute;border:0 dashed #9AA7A1}.fold{position:absolute;border:0 dotted #B5C0BA}"
202
+ ".lab{position:absolute;font:600 5.5pt/1 Helvetica,Arial,sans-serif;color:#7C8984;letter-spacing:.06em;"
203
+ "background:#fff;padding:.3mm .8mm;white-space:nowrap}")
204
+ pages = "".join(f'<div class="a4">{s}</div>' for s in sheets)
205
+ return f"<!doctype html><html><head><meta charset='utf-8'><style>{css}</style></head><body>{pages}</body></html>"
206
+
207
+
208
+ def hline(cls: str, top: float, left: float, width: float) -> str:
209
+ return f'<div class="{cls}" style="top:{top}mm;left:{left}mm;width:{width}mm;border-top-width:.3mm"></div>'
210
+
211
+
212
+ def vline(cls: str, left: float, top: float, height: float) -> str:
213
+ return f'<div class="{cls}" style="left:{left}mm;top:{top}mm;height:{height}mm;border-left-width:.3mm"></div>'
214
+
215
+
216
+ def label(text: str, left: float, top: float, rotate: int = 0) -> str:
217
+ tr = f"transform:rotate({rotate}deg);transform-origin:0 0;" if rotate else ""
218
+ return f'<span class="lab" style="left:{left}mm;top:{top}mm;{tr}">{E(text)}</span>'
pocket_press/source.py ADDED
@@ -0,0 +1,111 @@
1
+ """Read a pocket-press Markdown source into a Book.
2
+
3
+ Format:
4
+
5
+ ---
6
+ title: Principles
7
+ subtitle: ...
8
+ ---
9
+ Text before the first "# " heading becomes the intro page.
10
+
11
+ # Section name
12
+ Optional text here becomes a section divider page (booklets only).
13
+
14
+ ## Page title
15
+ Body in Markdown.
16
+
17
+ > A closing quote block becomes the page's "line".
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import re
22
+ from dataclasses import dataclass, field
23
+ from pathlib import Path
24
+
25
+ import markdown as md
26
+ import yaml
27
+
28
+
29
+ @dataclass
30
+ class Page:
31
+ kind: str # "content", "intro", "divider"
32
+ title: str
33
+ section: str = ""
34
+ body_html: str = ""
35
+ line: str = ""
36
+
37
+
38
+ @dataclass
39
+ class Book:
40
+ meta: dict
41
+ pages: list[Page] = field(default_factory=list)
42
+ sections: list[str] = field(default_factory=list)
43
+
44
+ @property
45
+ def content(self) -> list[Page]:
46
+ return [p for p in self.pages if p.kind == "content"]
47
+
48
+ @property
49
+ def slug(self) -> str:
50
+ s = self.meta.get("slug") or self.meta.get("title", "book")
51
+ return re.sub(r"[^a-z0-9]+", "-", str(s).lower()).strip("-") or "book"
52
+
53
+
54
+ def _md(text: str) -> str:
55
+ return md.markdown(text.strip(), extensions=["sane_lists"]) if text.strip() else ""
56
+
57
+
58
+ def _split_line(lines: list[str]) -> tuple[str, str]:
59
+ """Pull a trailing blockquote off the body; return (body, line)."""
60
+ while lines and not lines[-1].strip():
61
+ lines.pop()
62
+ quote = []
63
+ while lines and lines[-1].lstrip().startswith(">"):
64
+ quote.insert(0, lines.pop().lstrip()[1:].strip())
65
+ return "\n".join(lines), " ".join(q for q in quote if q)
66
+
67
+
68
+ def load(path: str | Path) -> Book:
69
+ text = Path(path).read_text(encoding="utf-8")
70
+ meta: dict = {}
71
+ m = re.match(r"^---\s*\n(.*?)\n---\s*\n", text, re.S)
72
+ if m:
73
+ meta = yaml.safe_load(m.group(1)) or {}
74
+ text = text[m.end():]
75
+
76
+ book = Book(meta=meta)
77
+ section = ""
78
+ buf: list[str] = []
79
+ current: tuple[str, str] | None = ("intro", "") # (kind, title)
80
+
81
+ def flush():
82
+ nonlocal buf
83
+ if current is None:
84
+ buf = []
85
+ return
86
+ kind, title = current
87
+ body, line = _split_line(list(buf))
88
+ if kind == "content":
89
+ book.pages.append(Page("content", title, section, _md(body), line))
90
+ elif body.strip() or line:
91
+ if kind == "intro":
92
+ title = meta.get("intro_title", "How to use this book")
93
+ book.pages.append(Page(kind, title, section, _md(body), line))
94
+ buf = []
95
+
96
+ for raw in text.splitlines():
97
+ if raw.startswith("## "):
98
+ flush()
99
+ current = ("content", raw[3:].strip())
100
+ elif raw.startswith("# "):
101
+ flush()
102
+ section = raw[2:].strip()
103
+ book.sections.append(section)
104
+ current = ("divider", section)
105
+ else:
106
+ buf.append(raw)
107
+ flush()
108
+
109
+ if not book.content:
110
+ raise SystemExit(f"{path}: no pages found. Each page starts with a '## ' heading.")
111
+ return book
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.5
2
+ Name: pocket-press
3
+ Version: 0.1.0
4
+ Summary: Markdown in, print-and-fold pocket books and card decks out.
5
+ Project-URL: Homepage, https://michael-borck.github.io/pocket-press/
6
+ Project-URL: Source, https://github.com/michael-borck/pocket-press
7
+ Project-URL: Issues, https://github.com/michael-borck/pocket-press/issues
8
+ Author: Michael Borck
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: booklet,flashcards,imposition,markdown,pdf,pocket book,print,zine
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Topic :: Printing
19
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
20
+ Requires-Python: >=3.9
21
+ Requires-Dist: markdown>=3.4
22
+ Requires-Dist: pypdf>=4
23
+ Requires-Dist: pyyaml>=6
24
+ Provides-Extra: full
25
+ Requires-Dist: playwright>=1.49; extra == 'full'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # pocket-press
29
+
30
+ Markdown in, print-and-fold pocket books and card decks out.
31
+
32
+ Write one Markdown file. pocket-press turns it into PDFs you print on an
33
+ ordinary A4 printer, then cut and fold into something that fits in a pocket:
34
+
35
+ | Format | Pages | How you make it |
36
+ |---|---|---|
37
+ | **A7 book** (`a7`) | any length, in fours | Print double-sided. Cut each sheet into quarters, stack by the printed numbers, fold, staple. 16 pages per A4 sheet. |
38
+ | **A6 book** (`a6`) | any length, in fours | Print double-sided. Cut each sheet in half, stack, fold, staple. 8 pages per A4 sheet. Easier to read. |
39
+ | **Zine** (`zine`) | exactly 8 | Print one side. One cut, fold into a booklet. No staples. |
40
+ | **Card deck** (`cards`) | one card per page | Print one side, 8 cards (93 × 67 mm) per sheet, cut out. Cover card first. |
41
+
42
+ The same source builds all four, so a book and its deck never drift apart.
43
+
44
+ ## Install
45
+
46
+ Needs Python 3.9+.
47
+
48
+ ```sh
49
+ uv tool install pocket-press # or: pipx install pocket-press
50
+ ```
51
+
52
+ pocket-press uses a Chrome-family browser, headless, to make the PDFs. If you
53
+ have Google Chrome, Chromium or Microsoft Edge installed, that's all you need.
54
+ Check with:
55
+
56
+ ```sh
57
+ pocket-press setup
58
+ ```
59
+
60
+ **No Chrome?** Install the full version, which lets pocket-press download its
61
+ own copy of Chromium (about 150 MB) through Playwright:
62
+
63
+ ```sh
64
+ uv tool install "pocket-press[full]" # or: pipx install "pocket-press[full]"
65
+ pocket-press setup # downloads Chromium once
66
+ ```
67
+
68
+ pocket-press looks for a browser in this order: the `CHROME` environment
69
+ variable, a browser installed on the computer, then Playwright's Chromium. To
70
+ use a particular browser, set `CHROME=/path/to/chrome`.
71
+
72
+ Try it without installing: `uvx pocket-press new mybook.md`.
73
+
74
+ ## Use
75
+
76
+ ```sh
77
+ pocket-press new mybook.md # starter file
78
+ pocket-press build mybook.md # every format, into dist/
79
+ pocket-press build mybook.md -f a7 # one format
80
+ pocket-press build mybook.md -f cards -f a6 -o print/
81
+ ```
82
+
83
+ The tool warns you when a page's text doesn't fit.
84
+
85
+ ## The source format
86
+
87
+ ```markdown
88
+ ---
89
+ title: Principles
90
+ subtitle: One line under the title.
91
+ tagline: The line on the cover.
92
+ author: Your name
93
+ colophon: |
94
+ Credits and sources, shown on the last page.
95
+ ---
96
+
97
+ Text before the first section becomes a "How to use this book" page.
98
+
99
+ # Section
100
+
101
+ Text here becomes a divider page in the books (cards skip it).
102
+
103
+ ## Page title
104
+
105
+ The page, in Markdown. An A7 page holds about 80 words.
106
+
107
+ > A closing quote becomes the page's line, at the foot in handwriting.
108
+ ```
109
+
110
+ - `# ` starts a section. Its name and colour run along the top of each page and card.
111
+ - `## ` starts a page in the books and a card in the deck.
112
+ - The cover and the back page come from the settings at the top. Blank pages
113
+ needed to make up the count become lined Notes pages.
114
+
115
+ Optional settings: `kicker` (small label above the title), `deck_kicker`,
116
+ `footer`, `accent`, `ink`, `colours` (a colour per section name), `licence`,
117
+ `intro_title`, `colophon_title`, and `fonts: system` to avoid loading Google Fonts.
118
+
119
+ ## Printing and folding
120
+
121
+ **Always print at 100% / Actual size**, with "Fit to page" off.
122
+
123
+ **Books.** Print double-sided, flip on the **long edge**.
124
+ - A7: cut each sheet into quarters along the dashed lines. Each piece carries a
125
+ small number such as `1/7`. Stack them in order with 1 on the outside, fold in
126
+ half at the marks, and staple twice through the fold.
127
+ - A6: the same, but cut each sheet in half.
128
+
129
+ Your printer may shift the back side by a millimetre or two. The page margins
130
+ allow for it.
131
+
132
+ **Zine.** Print one side. Crease the sheet into eighths, cut the dashed slit
133
+ across the middle two panels, fold it in half the long way, and push the ends
134
+ together until it folds into a booklet.
135
+
136
+ **Cards.** Print one side and cut along the dashed lines.
137
+
138
+ ## Examples
139
+
140
+ - [`examples/principles`](examples/principles): nine personal principles and
141
+ Benjamin Franklin's thirteen virtues, as an A7 book, an A6 book and a deck.
142
+ - [`examples/quickstart`](examples/quickstart): this README as an 8-page zine.
143
+
144
+ Built PDFs are in each example's `dist/` folder.
145
+
146
+ ## How it works
147
+
148
+ Pages are laid out in HTML and CSS and printed to PDF by headless Chrome. The
149
+ imposition (placing pages on the sheet in fold order, turned the right way for
150
+ double-sided printing) is done with [pypdf](https://pypi.org/project/pypdf/).
151
+
152
+ ## Licence
153
+
154
+ Code: MIT. See `LICENSE`. Example content has its own licence, stated in each
155
+ example.
@@ -0,0 +1,12 @@
1
+ pocket_press/__init__.py,sha256=CysUdMAGgy5qqNpi7yvDvx_bxJ0dNiOJxkbETGhO830,89
2
+ pocket_press/__main__.py,sha256=E6Gls0DNz8GQK2K-kOUIx8cYhgANW_CH54VKrfCfs14,52
3
+ pocket_press/chrome.py,sha256=YHdicQYNayMmo-Cu4xs9dPFmCgWoFzM80q9DWBtowgE,5061
4
+ pocket_press/cli.py,sha256=ErqnThoHynxEk8Y2y2cuEySAfdJt-YWY6Szp9YTRaXo,8099
5
+ pocket_press/impose.py,sha256=kbtRH3FxsQxpy2jnk8iss4Z9llAOf5IFgrVcR2t4FHs,4424
6
+ pocket_press/render.py,sha256=_cb6KKIHfyhgrGgF4xuGhLWPscvPQFIXVaMksLFBgKw,12069
7
+ pocket_press/source.py,sha256=oNKN9KM3LcQSzRPL_dyYM6FKkMINZzRx-tU2EYfP5go,3050
8
+ pocket_press-0.1.0.dist-info/METADATA,sha256=7dMrgZ2zRhiLof-cfhHU_5hOZRXFrkNlCgKI7gz0yuA,5521
9
+ pocket_press-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
10
+ pocket_press-0.1.0.dist-info/entry_points.txt,sha256=aew6fA5FiheF1XJOGFHturFQXQShRk1CYxdLxLZ4e98,55
11
+ pocket_press-0.1.0.dist-info/licenses/LICENSE,sha256=tP28nznO05HKBQN8uZ9NSvmcpzCWMj4P8e6F7IDj24Q,1070
12
+ pocket_press-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pocket-press = pocket_press.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael Borck
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.