Repository navigation
Add opt-in structural devices and an iconic device demo - #97
Conversation
RenderOptions.modules (YAML: format.modules) lets an opt-in module register Markdown syntax on the per-render parser, record usage facts from parsed syntax, add trusted markup after sanitization, and contribute page-scoped assets only to documents that used it. With no modules, or an enabled module a document does not use, output is byte-identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
Labeled structural blocks (::: device <kind> [title]) with a general kind catalog, vetted Lucide icons as CSS masks, a fixed tone palette, host kinds as data, host data attributes, diagnostics, and device_markdown for dialect adapters. Assets load only on pages that render a device. The alpha surface is pinned in kpress.devices.contract and documented in docs/modules/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
Pitfall, worked example, definition, notation, and key point join the built-in catalog, each with a distinct Lucide glyph vendored from the same pinned commit (28 icons in all; device-icons.css stays under 3 KB compressed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
A heading token whose meta carries kpress_heading_id keeps that id, and every authored id is reserved before slugging, so an ordinary heading with the same text gets a numbered suffix instead of a duplicate id. Definitions entries use this to keep published glossary anchors on their headings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
From the ojoshe adoption: - Sanitizer: a data-* name a host also lists in extra_attributes was stripped from standard tags (device aside/div) in sanitized mode. data-* names stay allowed by prefix, matching the sanitizer audit. - device_markdown takes anchor, classes, and host data-* attrs and validates the attribute line (device_attribute_line), raising instead of emitting a line the attrs syntax cannot parse. - An unparsable attribute line before a device fence reports invalid_device_attributes instead of silently rendering as text. - device_blocks(markdown) lists the devices KPress would render, so adapters can skip them without parsing Markdown themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
…butes Flowmark joins a device fence with adjacent lines and an attribute line onto the fence. The guide now shows blank lines around fences and between the attribute line and the fence (which attrs already accepts), and invalid_device_attributes also covers an attribute line one blank line above the fence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
From the Paper 1 adoption: a title replaced the kind's label, so the passage's role was lost in print and to screen readers once the decorative icon was gone. The label now always shows the kind, then ': ' and the title in sentence case (new hooks kpress-device-kind, -separator, -title). Titles wrap under the kind on narrow screens, and the icon stays on the first line instead of centering on the block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
…m/jlevy/kpress into claude/kpress-v040-devices
…m/jlevy/kpress into claude/kpress-v040-devices
- '::: device note- Title' starts closed and 'note+' starts open. The server renders
every device expanded (no-JS, print, PDF); modules/devices/fold.js, loaded only on
pages with a folded device, moves the label into a native toggle button with
aria-expanded/aria-controls and hides a closed body. Print shows it again.
- '[text]{device=tip}' renders an inline device, such as a callout in a list item:
an icon in the tone's accent before the text and a visually hidden kind label, with
the span's inline Markdown kept. Plain attribute spans are unaffected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
…m/jlevy/kpress into claude/kpress-v040-devices
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5kBhCB4ov4f4pDq8Am3VT
jlevy
left a comment
There was a problem hiding this comment.
Review A (senior engineering review, round 1) · head de875ee · base claude/pensive-brahmagupta-wfm2xu at 56d4bbb
Reviewer: strong tier, requested gpt-6-astra at xhigh · Channel: formal review
Coverage: 65-file layer. 55 files inspected or audited; peripheral files inventoried.
Tests run: Reviewed 55 of 65 changed files or their machine checks. The device test file was sampled and peripheral docs were inventoried. Icon generator check passed.
- A1 · Low — An interrupted icon CSS regeneration can truncate the previous complete file. Use the existing atomic output helper. Generator
jlevy
left a comment
There was a problem hiding this comment.
Review B (security review, round 1) · head de875ee · base claude/pensive-brahmagupta-wfm2xu at 56d4bbb
Reviewer: strong tier, requested gpt-6-astra at xhigh · Channel: formal review
Coverage: 65-file layer. 55 files inspected or audited; peripheral files inventoried.
Tests run: Read-only inspection of trust handling, reserved attributes, fold DOM, and all 28 SVGs.
No security findings. Style and icon choices stay within the catalog and authored HTML goes through the configured sanitizer.
jlevy
left a comment
There was a problem hiding this comment.
Review C (correctness review, round 1) · head de875ee · base claude/pensive-brahmagupta-wfm2xu at 56d4bbb
Reviewer: strong tier, requested gpt-6-astra at xhigh · Channel: formal review
Coverage: 65-file layer. 55 files inspected or audited; peripheral files inventoried.
Tests run: Pinned-object rendering probes reproduced unresolved title footnotes. Existing tests protect fold semantics and native anchor navigation.
- C1 · Medium — Device titles are parsed during HTML rendering, after footnote finalization. The title note stays literal in this layer, then becomes a broken footnote link in the shared paired-tag layer. Parse title inlines with the surrounding document before footnote collection. Title renderer
|
Dispositions for review A at
|
|
Dispositions for review C at
|
KPress stack #100 · Layer 2 of 8
Previous layer #96 · Next layer #98 · Whole-stack guide and latest build
KPress renders labeled blocks and inline devices, with decorative Lucide masks, native folds, and page-scoped assets. The demo has structural, iconic, and plain Markdown pages. The browser check builds and serves that example and exercises a mask and native fold at a narrow width.
The final review added regressions for generator-backed sanitization allowlists, catalog-owned inline markup, linked fold labels, and fragment navigation into closed folds.
PR #98 replaces the intermediate authoring syntax with paired
<k-block>tags and keeps the final module designs beside their packages.