md2ui 0.1.0a1__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.
- md2ui-0.1.0a1/.gitignore +48 -0
- md2ui-0.1.0a1/LICENSE +21 -0
- md2ui-0.1.0a1/MEANINGS.md +99 -0
- md2ui-0.1.0a1/PKG-INFO +395 -0
- md2ui-0.1.0a1/README.md +360 -0
- md2ui-0.1.0a1/THEME.md +1030 -0
- md2ui-0.1.0a1/assets/app/icon.png +0 -0
- md2ui-0.1.0a1/assets/demo/working.webp +0 -0
- md2ui-0.1.0a1/assets/fonts.lock +537 -0
- md2ui-0.1.0a1/assets/icons/LICENSE +202 -0
- md2ui-0.1.0a1/assets/icons/NOTICE +13 -0
- md2ui-0.1.0a1/assets/icons/material-design-icons-md2ui.ttf +0 -0
- md2ui-0.1.0a1/data/images/image-broken-placeholder.png +0 -0
- md2ui-0.1.0a1/data/images/image-placeholder.png +0 -0
- md2ui-0.1.0a1/data/vectors/image-placeholder.svg +1 -0
- md2ui-0.1.0a1/patterns/bank-card.md +23 -0
- md2ui-0.1.0a1/patterns/framed-picture.md +20 -0
- md2ui-0.1.0a1/patterns/live-card.md +27 -0
- md2ui-0.1.0a1/patterns/month-calendar.md +40 -0
- md2ui-0.1.0a1/patterns/music-player.md +26 -0
- md2ui-0.1.0a1/pyproject.toml +511 -0
- md2ui-0.1.0a1/skills/README.md +204 -0
- md2ui-0.1.0a1/skills/banking-example.md +72 -0
- md2ui-0.1.0a1/skills/code-blocks.md +80 -0
- md2ui-0.1.0a1/skills/colour.md +41 -0
- md2ui-0.1.0a1/skills/dashboards.md +437 -0
- md2ui-0.1.0a1/skills/elements.md +450 -0
- md2ui-0.1.0a1/skills/images.md +592 -0
- md2ui-0.1.0a1/skills/includes.md +39 -0
- md2ui-0.1.0a1/skills/lookup.md +90 -0
- md2ui-0.1.0a1/skills/opened.md +43 -0
- md2ui-0.1.0a1/skills/pages/api-reference.md +287 -0
- md2ui-0.1.0a1/skills/pages/artist-page.md +110 -0
- md2ui-0.1.0a1/skills/pages/current-conditions.md +89 -0
- md2ui-0.1.0a1/skills/pages/dish-grid.md +61 -0
- md2ui-0.1.0a1/skills/pages/garment-detail.md +122 -0
- md2ui-0.1.0a1/skills/pages/home-board.md +140 -0
- md2ui-0.1.0a1/skills/pages/hours-ahead.md +46 -0
- md2ui-0.1.0a1/skills/pages/money-dashboard.md +93 -0
- md2ui-0.1.0a1/skills/pages/places.md +33 -0
- md2ui-0.1.0a1/skills/pages/publisher-console.md +186 -0
- md2ui-0.1.0a1/skills/pages/shelves.md +73 -0
- md2ui-0.1.0a1/skills/pages/stay-detail.md +284 -0
- md2ui-0.1.0a1/skills/pages/wallet-overview.md +49 -0
- md2ui-0.1.0a1/skills/pages/watchlist.md +32 -0
- md2ui-0.1.0a1/skills/pages/widget-board.md +144 -0
- md2ui-0.1.0a1/skills/pages/workspace-landing.md +299 -0
- md2ui-0.1.0a1/skills/pages.md +71 -0
- md2ui-0.1.0a1/skills/patterns/agenda.md +28 -0
- md2ui-0.1.0a1/skills/patterns/article.md +32 -0
- md2ui-0.1.0a1/skills/patterns/buy-box.md +32 -0
- md2ui-0.1.0a1/skills/patterns/call-to-action.md +21 -0
- md2ui-0.1.0a1/skills/patterns/chart-card.md +24 -0
- md2ui-0.1.0a1/skills/patterns/choices.md +37 -0
- md2ui-0.1.0a1/skills/patterns/code-sample.md +30 -0
- md2ui-0.1.0a1/skills/patterns/comparison.md +28 -0
- md2ui-0.1.0a1/skills/patterns/confirm.md +23 -0
- md2ui-0.1.0a1/skills/patterns/connect-account.md +23 -0
- md2ui-0.1.0a1/skills/patterns/directory.md +35 -0
- md2ui-0.1.0a1/skills/patterns/empty-state.md +32 -0
- md2ui-0.1.0a1/skills/patterns/features.md +30 -0
- md2ui-0.1.0a1/skills/patterns/feed.md +33 -0
- md2ui-0.1.0a1/skills/patterns/figure-tiles.md +35 -0
- md2ui-0.1.0a1/skills/patterns/gallery.md +23 -0
- md2ui-0.1.0a1/skills/patterns/goodbye.md +27 -0
- md2ui-0.1.0a1/skills/patterns/guide.md +30 -0
- md2ui-0.1.0a1/skills/patterns/hero-figure.md +23 -0
- md2ui-0.1.0a1/skills/patterns/hero.md +24 -0
- md2ui-0.1.0a1/skills/patterns/inbox.md +24 -0
- md2ui-0.1.0a1/skills/patterns/itinerary.md +24 -0
- md2ui-0.1.0a1/skills/patterns/kpis.md +27 -0
- md2ui-0.1.0a1/skills/patterns/listing.md +39 -0
- md2ui-0.1.0a1/skills/patterns/month-calendar.md +38 -0
- md2ui-0.1.0a1/skills/patterns/now-playing.md +25 -0
- md2ui-0.1.0a1/skills/patterns/offer.md +20 -0
- md2ui-0.1.0a1/skills/patterns/people.md +23 -0
- md2ui-0.1.0a1/skills/patterns/photo-card.md +25 -0
- md2ui-0.1.0a1/skills/patterns/picture-rows.md +32 -0
- md2ui-0.1.0a1/skills/patterns/profile.md +21 -0
- md2ui-0.1.0a1/skills/patterns/progress.md +21 -0
- md2ui-0.1.0a1/skills/patterns/quick-actions.md +23 -0
- md2ui-0.1.0a1/skills/patterns/reference-list.md +35 -0
- md2ui-0.1.0a1/skills/patterns/result.md +25 -0
- md2ui-0.1.0a1/skills/patterns/reviews.md +34 -0
- md2ui-0.1.0a1/skills/patterns/services.md +27 -0
- md2ui-0.1.0a1/skills/patterns/shelf.md +40 -0
- md2ui-0.1.0a1/skills/patterns/shortcuts.md +36 -0
- md2ui-0.1.0a1/skills/patterns/specs.md +33 -0
- md2ui-0.1.0a1/skills/patterns/split.md +27 -0
- md2ui-0.1.0a1/skills/patterns/status-list.md +25 -0
- md2ui-0.1.0a1/skills/patterns/steps.md +24 -0
- md2ui-0.1.0a1/skills/patterns/suggestions.md +19 -0
- md2ui-0.1.0a1/skills/patterns/task-list.md +25 -0
- md2ui-0.1.0a1/skills/patterns/testimonials.md +30 -0
- md2ui-0.1.0a1/skills/patterns/ticker-rows.md +22 -0
- md2ui-0.1.0a1/skills/repetition.md +296 -0
- md2ui-0.1.0a1/skills/structure.md +827 -0
- md2ui-0.1.0a1/skills/text.md +195 -0
- md2ui-0.1.0a1/skills/verifying.md +82 -0
- md2ui-0.1.0a1/src/md2ui/__init__.py +0 -0
- md2ui-0.1.0a1/src/md2ui/advice.py +468 -0
- md2ui-0.1.0a1/src/md2ui/advice_forms.py +273 -0
- md2ui-0.1.0a1/src/md2ui/advice_patterns.py +249 -0
- md2ui-0.1.0a1/src/md2ui/app.py +1049 -0
- md2ui-0.1.0a1/src/md2ui/app_capture.py +193 -0
- md2ui-0.1.0a1/src/md2ui/app_chrome.py +134 -0
- md2ui-0.1.0a1/src/md2ui/app_icon.py +88 -0
- md2ui-0.1.0a1/src/md2ui/app_native_field.py +217 -0
- md2ui-0.1.0a1/src/md2ui/app_prompt.py +468 -0
- md2ui-0.1.0a1/src/md2ui/app_surface.py +49 -0
- md2ui-0.1.0a1/src/md2ui/check.py +873 -0
- md2ui-0.1.0a1/src/md2ui/check_charts.py +383 -0
- md2ui-0.1.0a1/src/md2ui/check_choices.py +205 -0
- md2ui-0.1.0a1/src/md2ui/check_feeds.py +206 -0
- md2ui-0.1.0a1/src/md2ui/check_placeholders.py +127 -0
- md2ui-0.1.0a1/src/md2ui/digest.py +402 -0
- md2ui-0.1.0a1/src/md2ui/includes.py +527 -0
- md2ui-0.1.0a1/src/md2ui/main.py +216 -0
- md2ui-0.1.0a1/src/md2ui/mcp_demo.py +1033 -0
- md2ui-0.1.0a1/src/md2ui/mcp_demo_activity.py +155 -0
- md2ui-0.1.0a1/src/md2ui/mcp_demo_records.py +157 -0
- md2ui-0.1.0a1/src/md2ui/mcp_demo_told.py +115 -0
- md2ui-0.1.0a1/src/md2ui/mcp_server.py +563 -0
- md2ui-0.1.0a1/src/md2ui/meanings.py +592 -0
- md2ui-0.1.0a1/src/md2ui/notes.py +61 -0
- md2ui-0.1.0a1/src/md2ui/pattern_respell.py +128 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/__init__.py +0 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/data_point_detector.py +1165 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/data_point_types.py +45 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/detector_guards.py +124 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/detector_parsers.py +1645 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/detector_scope.py +97 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/detector_signs.py +73 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/detector_vocabulary.py +190 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_column_cuts.py +91 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_displays.py +361 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_fit_votes.py +276 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_markers.py +149 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_spacers.py +389 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_spring_wrap.py +62 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/generator_units.py +798 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_annotate.py +567 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_block_splits.py +758 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_charts.py +547 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_choices.py +36 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_code_blocks.py +208 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_column_rows.py +552 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_content_edits.py +104 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_display_vocab.py +82 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_displays.py +339 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_drawing_elements.py +403 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_element_splits.py +389 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_escapes.py +234 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_feed_slots.py +298 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_glue.py +516 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_ids.py +105 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_inline_marks.py +682 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_kinds.py +718 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_line_flow.py +245 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_memo.py +124 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_node_reads.py +317 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_pairs.py +133 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_ranges.py +272 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_separate.py +453 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_separator_splits.py +332 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_sliders.py +343 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_spacers.py +451 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_split_apply.py +386 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_split_criteria.py +320 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_text_lengths.py +41 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_types.py +1059 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/grouper_value_splits.py +229 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/layout_auto.py +108 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/layout_generator.py +4042 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/layout_render.py +2920 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/layout_script_parser.py +443 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/markdown_grouper.py +2638 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_actions.py +592 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_backgrounds.py +569 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_bars.py +201 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_card_label.py +55 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_chart.py +748 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_choices.py +117 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_code_blocks.py +422 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_colors.py +545 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_counts.py +195 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_drawing_elements.py +516 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_element_paint.py +103 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_fills.py +204 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_glyph_faces.py +261 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_hints.py +278 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_image_placeholder.py +149 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_line_chart.py +304 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_list_surfaces.py +183 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_measure.py +2629 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_metrics.py +565 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_picture.py +192 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_pill_paint.py +81 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_place.py +1220 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_placeholders.py +161 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_ring_text.py +189 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_scroll_overlay.py +140 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_segmented.py +159 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_settings.py +105 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_shadows.py +327 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_shaping.py +130 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_slots.py +118 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_spacing.py +488 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_style.py +763 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_text.py +553 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_text_paint.py +220 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/render_text_scopes.py +446 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/theme.py +2642 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/theme_assets.py +98 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/theme_model.py +1697 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/theme_placeholders.py +154 -0
- md2ui-0.1.0a1/src/md2ui/pipeline/value_format.py +50 -0
- md2ui-0.1.0a1/src/md2ui/session.py +623 -0
- md2ui-0.1.0a1/src/md2ui/stale_code.py +80 -0
- md2ui-0.1.0a1/src/md2ui/theme_lint.py +521 -0
- md2ui-0.1.0a1/src/md2ui/utils/__init__.py +0 -0
- md2ui-0.1.0a1/src/md2ui/utils/fetch_policy.py +43 -0
- md2ui-0.1.0a1/src/md2ui/utils/font_loader.py +426 -0
- md2ui-0.1.0a1/src/md2ui/utils/font_lock.py +128 -0
- md2ui-0.1.0a1/src/md2ui/utils/image_cache.py +641 -0
- md2ui-0.1.0a1/src/md2ui/utils/image_params.py +163 -0
- md2ui-0.1.0a1/src/md2ui/utils/photo_decoder.py +236 -0
- md2ui-0.1.0a1/src/md2ui/utils/png.py +115 -0
- md2ui-0.1.0a1/src/md2ui/utils/scroll_state.py +168 -0
- md2ui-0.1.0a1/src/md2ui/wire.py +561 -0
- md2ui-0.1.0a1/src/md2ui/wire_bars.py +268 -0
- md2ui-0.1.0a1/src/md2ui/wire_client.py +408 -0
- md2ui-0.1.0a1/src/md2ui/wire_edits.py +244 -0
- md2ui-0.1.0a1/src/md2ui/wire_feed_posts.py +149 -0
- md2ui-0.1.0a1/src/md2ui/wire_feeds.py +555 -0
- md2ui-0.1.0a1/src/md2ui/wire_frames.py +268 -0
- md2ui-0.1.0a1/src/md2ui/wire_includes.py +232 -0
- md2ui-0.1.0a1/src/md2ui/wire_patch.py +437 -0
- md2ui-0.1.0a1/src/md2ui/wire_records.py +144 -0
- md2ui-0.1.0a1/src/md2ui/wire_sections.py +218 -0
- md2ui-0.1.0a1/src/md2ui/wire_server.py +810 -0
- md2ui-0.1.0a1/src/md2ui/wire_texts.py +255 -0
md2ui-0.1.0a1/.gitignore
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv
|
|
11
|
+
.zed
|
|
12
|
+
|
|
13
|
+
.DS_Store
|
|
14
|
+
|
|
15
|
+
screenshots/
|
|
16
|
+
|
|
17
|
+
assets/fonts/
|
|
18
|
+
|
|
19
|
+
# The icon font's large source: scripts/build_icon_font.py pins its hash and says
|
|
20
|
+
# where to download it. Its .codepoints file is small and tracked.
|
|
21
|
+
assets/icons/source/*.ttf
|
|
22
|
+
|
|
23
|
+
.codex/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# What `md2ui group` writes beside a document, at any depth.
|
|
27
|
+
**/grouping-ast.json
|
|
28
|
+
|
|
29
|
+
eval-runs/
|
|
30
|
+
|
|
31
|
+
# Private working folders, kept in the md2ui-private repository. Only each folder's
|
|
32
|
+
# procedure README (and the public example suite) is published.
|
|
33
|
+
/findings/*
|
|
34
|
+
!/findings/README.md
|
|
35
|
+
/proposals/*
|
|
36
|
+
!/proposals/README.md
|
|
37
|
+
/evals/*
|
|
38
|
+
!/evals/README.md
|
|
39
|
+
!/evals/example/
|
|
40
|
+
/plans/
|
|
41
|
+
/scripts/eval_live*.py
|
|
42
|
+
/scripts/eval_fidelity.py
|
|
43
|
+
/tests/eval_live*_tests.py
|
|
44
|
+
# The private repository's own notes, when it is mounted here.
|
|
45
|
+
/PRIVATE.md
|
|
46
|
+
|
|
47
|
+
# Agent worktrees: local checkouts of a branch, never part of the repository.
|
|
48
|
+
/.claude/worktrees/
|
md2ui-0.1.0a1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 alexrvarela
|
|
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.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Meanings
|
|
2
|
+
|
|
3
|
+
What each spelling means with this theme.
|
|
4
|
+
|
|
5
|
+
- Write only the spellings listed here. Anything not listed, write bare: `` `Tag` ``, `⭐`, `[Label](/x)`.
|
|
6
|
+
- A role or a place no row names takes the bare spelling: the primary one.
|
|
7
|
+
- `~~…~~` around any listed spelling is its muted state: inactive, unavailable, past.
|
|
8
|
+
- A fixed colour belongs to its token everywhere it appears. Never use one to mark a single item.
|
|
9
|
+
- A pattern may declare a spelling its own shape needs; one meant everywhere is declared here.
|
|
10
|
+
- A month calendar's days take their states from `patterns/month-calendar`: weekday, weekend, event, today, outside the month.
|
|
11
|
+
|
|
12
|
+
<!-- For theme authors. *Means* says what a spelling is for and where it goes, in words an
|
|
13
|
+
agent acts on: never a colour, a size or a measurement. *Size*, where a row has one, is how
|
|
14
|
+
the theme should draw it: the theme lint compares it with what THEME.md draws, and agents
|
|
15
|
+
never see it. A fixed colour whose *Means* is `decoration` is not shown to agents. -->
|
|
16
|
+
|
|
17
|
+
## Icons
|
|
18
|
+
|
|
19
|
+
| Write | Means | Size | Slot |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `⭐` | an icon in a label or a list item, or leading a row: who or what it is | standard | icon-label |
|
|
22
|
+
| `*⭐*` | the icon a feature, an empty state or a headline is about | large | icon-subject |
|
|
23
|
+
| `**⭐**` | an icon in a dense row, beside a caption | small | icon-dense |
|
|
24
|
+
| `***⭐***` | an icon inside a compact element | extra small | compact |
|
|
25
|
+
| `"⭐"` | the glyph alone, as part of the text around it | | inline |
|
|
26
|
+
|
|
27
|
+
## Chips
|
|
28
|
+
|
|
29
|
+
| Write | Means | Size |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `` `Tag` `` | a tag or a status | |
|
|
32
|
+
| `` *`Tag`* `` | a second kind of tag on the same item | |
|
|
33
|
+
| `` _`Tag`_ `` | a tag in a compact row | small |
|
|
34
|
+
|
|
35
|
+
## Buttons
|
|
36
|
+
|
|
37
|
+
| Write | Means | Size | Slot |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| `[Label](/x)` | the main action, at the foot of a flow, a section or a dialog | | foot-main |
|
|
40
|
+
| `*[Label](/x)*` | a quieter action there: an alternative to the main one, or one the page is not for | | foot-quieter |
|
|
41
|
+
| `**[Label](/x)**` | the main action inside a card: the one the card is for, on each item of a run (reserve it, add it, join it); a card on its own takes the section's spellings | medium | card-main |
|
|
42
|
+
| `***[Label](/x)***` | a quieter action inside a card | medium | card-quieter |
|
|
43
|
+
| `_[Label](/x)_` | the main action at the edge of a row in a list | small | row-main |
|
|
44
|
+
| `__[Label](/x)__` | a quieter action at the edge of a row | small | row-quieter |
|
|
45
|
+
| `___[Label](/x)___` | an action inside a compact element | extra small | compact |
|
|
46
|
+
| `` [`Label`](/x) `` | a way in that repeats on every card (details, read more); at the edge of a section's title; a link to another place, in a site map, a footer or a list of links; a minor action | | card-way-in, title-edge, nav, minor |
|
|
47
|
+
| `"[Label](/x)"` | a link inside a sentence | | inline |
|
|
48
|
+
|
|
49
|
+
## Icon buttons
|
|
50
|
+
|
|
51
|
+
| Write | Means | Size | Slot |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `[▶️](/x)` | the main icon action | | foot-main |
|
|
54
|
+
| `*[📞](/x)*` | an icon action | | foot-quieter |
|
|
55
|
+
| `**[💬](/x)**` | the main icon action inside a card | medium | card-main |
|
|
56
|
+
| `***[❤️](/x)***` | an icon action inside a card | medium | card-quieter |
|
|
57
|
+
| `_[▶️](/x)_` | the main icon action at the edge of a row | small | row-main |
|
|
58
|
+
|
|
59
|
+
## Sections
|
|
60
|
+
|
|
61
|
+
| Write | Means |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `## {#card-1}` | one object the answer is about, shown as a card of its own: a bank card, a pass, a ticket; on a `###` too; number each one: `{#card-2}`, `{#card-3}`; `patterns/bank-card` shows it |
|
|
64
|
+
| `## Title {#green-1}` | a section in the brand colour instead of the plain one: the headline figures, an offer, a tip or a call to act |
|
|
65
|
+
| `## Title {#dark-1}` | a section in the dark style instead of the plain one: a player, a live status |
|
|
66
|
+
| `## {#music-player-1}` | the track playing now, with its controls; `patterns/music-player` shows it |
|
|
67
|
+
| `## Title {#reset-1}` | a pause the answer suggests: a break, a breath, a step away |
|
|
68
|
+
| `## Title {#learning-1}` | something to learn on the side: a definition, a short lesson, how something works |
|
|
69
|
+
| `## Title {#afternoon-1}` | the later part of a day plan: the afternoon or the evening |
|
|
70
|
+
| `### {#framed-1}` | a picture shown as a print: a photo the user keeps, pinned or shared; `patterns/framed-picture` shows it |
|
|
71
|
+
|
|
72
|
+
## Placeholders
|
|
73
|
+
|
|
74
|
+
| Write | Means |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `` | a person or an account that has no photo: their initials, up to three letters |
|
|
77
|
+
| `` | a company, a service or an app that has no logo: its initial |
|
|
78
|
+
| `` | a product, a place or a post that has no photo yet |
|
|
79
|
+
|
|
80
|
+
## Fixed colours
|
|
81
|
+
|
|
82
|
+
| Token | Means |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `▲` in a chip | a rise, good |
|
|
85
|
+
| `▼` in a chip | a fall, bad |
|
|
86
|
+
| `🔄` in a chip | in progress |
|
|
87
|
+
| `⏳` in a chip | pending |
|
|
88
|
+
| `✕` in a chip | cancelled |
|
|
89
|
+
| `🟢` | a good status: running, online, healthy |
|
|
90
|
+
| `🔴` | a bad status: down, offline, failing |
|
|
91
|
+
| `✅` | success |
|
|
92
|
+
| `⚠️` | a warning |
|
|
93
|
+
| `❌` `🛑` | a failure, stop |
|
|
94
|
+
| `☀️` `🌤️` `⛅` `🌥️` `☁️` `🌫️` `🌦️` `🌧️` `⛈️` `🌩️` `🌨️` `❄️` `🌬️` `💨` `🌪️` `🌈` `🌙` `🌡️` `☔` `💧` | weather: the condition, temperature or rain it stands for |
|
|
95
|
+
| `✓` | done, complete; in a chip too |
|
|
96
|
+
| `❤️` on an icon button | a like or a favourite |
|
|
97
|
+
| `🚶` | decoration |
|
|
98
|
+
| a button whose whole label is `OK`, or whose label contains `Accept` or `Approve` | drawn as confirming |
|
|
99
|
+
| a button whose whole label is `Cancel`, or whose label contains `Delete` | drawn as destructive |
|
md2ui-0.1.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: md2ui
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Experimental: turns an ordinary Markdown document, such as an LLM's answer, into a rendered UI
|
|
5
|
+
Project-URL: Homepage, https://md2ui.org
|
|
6
|
+
Project-URL: Repository, https://github.com/md2ui/md2ui
|
|
7
|
+
Project-URL: Issues, https://github.com/md2ui/md2ui/issues
|
|
8
|
+
Author: alexrvarela
|
|
9
|
+
License-Expression: MIT AND Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: assets/icons/LICENSE
|
|
12
|
+
License-File: assets/icons/NOTICE
|
|
13
|
+
Keywords: layout,llm,markdown,mcp,rendering,skia,ui
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
21
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
22
|
+
Requires-Python: >=3.13
|
|
23
|
+
Requires-Dist: diskcache>=5.6.3
|
|
24
|
+
Requires-Dist: glfw>=2.10.0
|
|
25
|
+
Requires-Dist: mcp>=2.2.0
|
|
26
|
+
Requires-Dist: numpy>=2.4.4
|
|
27
|
+
Requires-Dist: pygments<2.21,>=2.20.0
|
|
28
|
+
Requires-Dist: pyobjc-framework-cocoa>=12.2.2; sys_platform == 'darwin'
|
|
29
|
+
Requires-Dist: skia-python<145,>=144.1
|
|
30
|
+
Requires-Dist: starlette>=1.10.0
|
|
31
|
+
Requires-Dist: uharfbuzz>=0.56.3
|
|
32
|
+
Requires-Dist: uvicorn>=0.54.0
|
|
33
|
+
Requires-Dist: websockets>=17.1
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<img src="https://raw.githubusercontent.com/md2ui/md2ui/main/assets/images/md2ui-logo.png" alt="md2ui" width="160">
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
# md2ui
|
|
41
|
+
|
|
42
|
+
> **md2ui is experimental.** Its Markdown conventions, `THEME.md` keys, CLI, MCP tools and
|
|
43
|
+
> Python API can change between any two releases. It is tested on macOS only.
|
|
44
|
+
|
|
45
|
+
**md2ui turns an ordinary Markdown document, such as an LLM's answer, into a rendered UI.**
|
|
46
|
+
|
|
47
|
+
## What it is for
|
|
48
|
+
|
|
49
|
+
An agent writes its reply as plain Markdown; md2ui groups it, lays it out and draws it as
|
|
50
|
+
UI, styled by a `THEME.md` that belongs to the app showing it. Clicks on the buttons the
|
|
51
|
+
agent wrote come back to the agent as sentences built from its own Markdown. The questions
|
|
52
|
+
behind it: can plain Markdown carry enough to generate a good UI, can that UI couple with an
|
|
53
|
+
existing front end's design system, and how cheap and compact can it be for the model that
|
|
54
|
+
writes it?
|
|
55
|
+
|
|
56
|
+
The design comes from patterns observed in real LLM answers, from UI design samples and from
|
|
57
|
+
several Gestalt principles, not from a spec: "what should this do?" is answered by looking at
|
|
58
|
+
documents and designs.
|
|
59
|
+
|
|
60
|
+
## Install
|
|
61
|
+
|
|
62
|
+
md2ui needs Python 3.13 or later. It depends on `skia-python` and `glfw`, and is tested on
|
|
63
|
+
macOS. Only pre-releases exist: pip needs `--pre`, or pin the version.
|
|
64
|
+
|
|
65
|
+
**The CLI, the app and the MCP servers**, as commands on your `PATH`:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
uv tool install md2ui # or: pip install --pre md2ui
|
|
69
|
+
uvx --from md2ui==0.1.0a1 md2ui render path/to/content.md # one command, nothing installed
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**The library, for a backend** that sends md2ui Markdown to its frontends:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
uv add md2ui # or: pip install --pre md2ui, or pin md2ui==0.1.0a1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**The frontend** runs the same pipeline in the browser or a webview: md2ui-ts, on npm as
|
|
79
|
+
`@md2ui/dom`, `@md2ui/react`, `@md2ui/vue` and `@md2ui/wire` under the `alpha` dist-tag
|
|
80
|
+
(`npm install @md2ui/dom@alpha`). Its README is at
|
|
81
|
+
[github.com/md2ui/md2ui-ts](https://github.com/md2ui/md2ui-ts).
|
|
82
|
+
|
|
83
|
+
| Command | Is |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `md2ui` | The CLI: `render`, `layout`, `group`, `check`. See [The CLI](#the-cli-md2ui) |
|
|
86
|
+
| `md2ui-app` | The window, with live reload. See [The app](#the-app-md2ui-app) |
|
|
87
|
+
| `md2ui-mcp` | The authoring MCP server (stdio). See [The MCP authoring server](#the-mcp-authoring-server-md2ui-mcp) |
|
|
88
|
+
| `md2ui-mcp-demo` | The live demo's MCP server, which opens the window. See [Live demo with Claude](#live-demo-with-claude) |
|
|
89
|
+
| `md2ui-wire` | The wire's reference server, which serves one document. See [The wire reference server](#the-wire-reference-server) |
|
|
90
|
+
| `md2ui-demo-activity` | The Claude Code hook the md2ui plugins run, so the demo's window says what Claude is doing. Not run by hand |
|
|
91
|
+
|
|
92
|
+
To work on md2ui itself, from a checkout, see
|
|
93
|
+
[CONTRIBUTING.md](https://github.com/md2ui/md2ui/blob/main/CONTRIBUTING.md).
|
|
94
|
+
|
|
95
|
+
## Files md2ui reads at run time
|
|
96
|
+
|
|
97
|
+
**The theme.** `md2ui` and `md2ui-app` render a document with the first `THEME.md` they find:
|
|
98
|
+
|
|
99
|
+
1. the one passed with `--theme`;
|
|
100
|
+
2. `THEME.md` beside the document;
|
|
101
|
+
3. `THEME.md` in the working directory;
|
|
102
|
+
4. md2ui's default theme, shipped in the package.
|
|
103
|
+
|
|
104
|
+
Both print the one they used (`[theme] …`). `md2ui-mcp` and `md2ui-mcp-demo` use the theme
|
|
105
|
+
passed with `--theme`. A `MEANINGS.md` beside `THEME.md` says what each of the theme's
|
|
106
|
+
spellings is for; agents read it through `guide`. Every key of both files is in
|
|
107
|
+
[`THEME_GUIDE.md`](https://github.com/md2ui/md2ui/blob/main/THEME_GUIDE.md).
|
|
108
|
+
|
|
109
|
+
**What the package ships.** The authoring notes an agent reads (`skills/`), the section
|
|
110
|
+
patterns (`patterns/`), the default `THEME.md` and `MEANINGS.md`, the font lock
|
|
111
|
+
(`assets/fonts.lock`), the icon font, the window's working animation and the image
|
|
112
|
+
placeholders are inside the installed package, in `md2ui/shipped/`. To print where:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
python -c "from md2ui import session; print(session.resource_root())"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Fonts.** The package ships no text font. A font file a theme names is looked for beside
|
|
119
|
+
the `THEME.md`, then in the working directory, then among md2ui's own files (the icon font).
|
|
120
|
+
When `assets/fonts.lock` locks a file of that name (Inter, IBM Plex Mono and the other fonts
|
|
121
|
+
of md2ui's themes), md2ui downloads it on first use into `~/.cache/md2ui/fonts`
|
|
122
|
+
(`$XDG_CACHE_HOME/md2ui/fonts` when that is set) and checks it against the locked SHA-256. A
|
|
123
|
+
font named by an `http(s)` URL is downloaded as written. A font that cannot be found is
|
|
124
|
+
logged under `[fonts]`, and its text falls back to a system face.
|
|
125
|
+
|
|
126
|
+
**Fetching.** Fonts, pictures in the document and theme backgrounds are downloaded only
|
|
127
|
+
where fetching is on:
|
|
128
|
+
|
|
129
|
+
| Where | Fetches |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `md2ui`, `md2ui-app` | Always |
|
|
132
|
+
| `md2ui-mcp`, `md2ui-mcp-demo` | Only with `--fetch`; without it, pictures draw as placeholders |
|
|
133
|
+
| `md2ui.mcp_server.build_server()` in your own process | Only with `fetch=True` |
|
|
134
|
+
|
|
135
|
+
A hosted server keeps fetching off, so a URL a model wrote never becomes a request from
|
|
136
|
+
inside its network. Put the fonts its theme needs beside its `THEME.md`.
|
|
137
|
+
|
|
138
|
+
**A frontend's fonts.** md2ui-ts measures and draws text only with the fonts its host gives
|
|
139
|
+
it, so a backend serves `THEME.md` and every font file it names, for example beside its
|
|
140
|
+
WebSocket with `build_app(..., routes=[...])`
|
|
141
|
+
([`protocol/server-guide.md`](https://github.com/md2ui/md2ui/blob/main/protocol/server-guide.md),
|
|
142
|
+
*The theme, to the client*).
|
|
143
|
+
|
|
144
|
+
## Render a document
|
|
145
|
+
|
|
146
|
+
Both `md2ui` and `md2ui-app` take the Markdown document itself and run the whole pipeline.
|
|
147
|
+
[`skills/`](https://github.com/md2ui/md2ui/tree/main/skills) says how to write Markdown that
|
|
148
|
+
renders well; it is written for the LLM that writes it.
|
|
149
|
+
|
|
150
|
+
### The app: `md2ui-app`
|
|
151
|
+
|
|
152
|
+
A window that stays in step with the document: save the Markdown and it re-renders.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
md2ui-app path/to/content.md
|
|
156
|
+
md2ui-app path/to/content.md --width 1280 --wireframe
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
| Option | Does |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| `--theme PATH` | Use this `THEME.md` |
|
|
162
|
+
| `--width N` | Initial layout width; resizing the window lays it out again |
|
|
163
|
+
| `--bento` | Start in the bento mosaic layout |
|
|
164
|
+
| `--wireframe` `--debug` `--debug-padding` `--text-boxes` | Start with that overlay on: layout wireframe, spacing gaps, padding rings, text boxes |
|
|
165
|
+
| `--connect URL` | Show a wire server's messages (`ws://…/ws`) instead of a file; clicks go back to it. Sends the secret in `MD2UI_WIRE_BEARER`, when set, as the server's bearer |
|
|
166
|
+
| `--working-animation PATH` | With `--connect`: the animated WebP or GIF played while the agent works (default: the one shipped in the package) |
|
|
167
|
+
| `--capture-requests DIR` | Answer screenshot requests written into `DIR`, so the agent driving the wire can see what the user sees |
|
|
168
|
+
|
|
169
|
+
| Key | Does |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| `R` / `T` | Reload the document / reload the theme |
|
|
172
|
+
| `S` | Save the whole layout as a PNG in `screenshots/` under the working directory, named after the document |
|
|
173
|
+
| `E` | Save the layout tree as JSON beside the document |
|
|
174
|
+
| `C` / `Shift+C` | Copy the Markdown on screen to the clipboard / save it as a timestamped `.md` beside the document |
|
|
175
|
+
| `W` `D` `P` `B` | Overlays: wireframe, spacing gaps, padding rings, text boxes |
|
|
176
|
+
| `I` | Force image placeholders |
|
|
177
|
+
| `F` | Show or hide the frame (title, path and key hints); the window opens without it |
|
|
178
|
+
| `G` / `K` | Toggle bento / section stacking |
|
|
179
|
+
| Arrows, `PgUp` `PgDn` `Home`, wheel | Scroll; a code block wider than its box scrolls sideways under the pointer (Shift+wheel) |
|
|
180
|
+
| Click | A web or mail link opens the browser, an `#anchor` scrolls, and `agent:` links and task boxes print their event as JSON; with `--connect` they go back to the server |
|
|
181
|
+
| `Esc` | Quit. A `--connect` window closes only with ⌘Q or its close button |
|
|
182
|
+
|
|
183
|
+
Drop another `.md` file onto the window to switch to it.
|
|
184
|
+
|
|
185
|
+
### The CLI: `md2ui`
|
|
186
|
+
|
|
187
|
+
Every command runs once and exits: no window, no watcher, no prompt. It prints the path of
|
|
188
|
+
what it wrote.
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
md2ui render path/to/content.md --width 1280 --out out.png
|
|
192
|
+
md2ui layout path/to/content.md --width 1280
|
|
193
|
+
md2ui group path/to/content.md
|
|
194
|
+
md2ui check path/to/content.md # the document's authoring issues
|
|
195
|
+
md2ui check --theme path/to/THEME.md # the theme against its MEANINGS.md
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
| Command | Does | Writes, beside the document unless `--out` |
|
|
199
|
+
| --- | --- | --- |
|
|
200
|
+
| `render` | Renders the page | `render-<width>w.png` |
|
|
201
|
+
| `layout` | Lays it out | `layout-dump-<width>.json`, the layout tree |
|
|
202
|
+
| `group` | Groups it | `grouping-ast.json`, the grouper's tree |
|
|
203
|
+
| `check` | Prints the document's authoring issues, the ones the MCP `check` tool returns; with `--theme` and no document, lints the theme against its `MEANINGS.md` and patterns | Nothing |
|
|
204
|
+
|
|
205
|
+
| Option | Applies to | Does |
|
|
206
|
+
| --- | --- | --- |
|
|
207
|
+
| `--out PATH` | `render`, `layout`, `group` | Where to write |
|
|
208
|
+
| `--width N` | `render`, `layout` | Layout width, default 1024; a document that needs more gets its own minimum |
|
|
209
|
+
| `--theme PATH` | `render`, `layout`, `check` | Use this `THEME.md` |
|
|
210
|
+
| `--bento` | `render`, `layout` | Force the bento mosaic layout |
|
|
211
|
+
| `--scale F` | `render` | Pixel scale, e.g. `2` for retina |
|
|
212
|
+
| `--wireframe` `--debug` `--debug-padding` `--text-boxes` | `render` | Draw that overlay |
|
|
213
|
+
|
|
214
|
+
| Exit status | Means |
|
|
215
|
+
| --- | --- |
|
|
216
|
+
| 0 | Written; for `check`, no error-level issue (a theme lint always exits 0) |
|
|
217
|
+
| 1 | Nothing written: the grouper produced no tree, the page is too big for one bitmap, or the PNG did not encode; for `check`, the document has an error-level issue |
|
|
218
|
+
| 2 | Bad arguments |
|
|
219
|
+
|
|
220
|
+
`md2ui <command> --help` lists the same.
|
|
221
|
+
|
|
222
|
+
## Connect md2ui to an agent
|
|
223
|
+
|
|
224
|
+
The agent writes Markdown, following the notes in
|
|
225
|
+
[`skills/`](https://github.com/md2ui/md2ui/tree/main/skills). Its backend sends that plain
|
|
226
|
+
Markdown to the frontend, which runs the pipeline with its own theme, fonts and assets. A
|
|
227
|
+
click comes back as a small event naming the target; the backend verifies it against its
|
|
228
|
+
own copy of the page and hands it to the agent as a sentence.
|
|
229
|
+
|
|
230
|
+
### Your own backend
|
|
231
|
+
|
|
232
|
+
The library holds the wire's codec and verifier, and a WebSocket binding you can serve as
|
|
233
|
+
is. A taste:
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
from md2ui.wire_server import Conversation, Served
|
|
237
|
+
|
|
238
|
+
conversation = Conversation()
|
|
239
|
+
served = Served(conversation, port=8765) # ws://127.0.0.1:8765/ws
|
|
240
|
+
served.call(conversation.send("# Hello\n\n[Say hi](agent:greet?to=you)\n"))
|
|
241
|
+
served.call(conversation.set_state("l")) # listening
|
|
242
|
+
print(served.next_event(timeout=60).agent_text()) # User chose "Say hi": greet {to: you} (message c1)
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
- [`protocol/server-guide.md`](https://github.com/md2ui/md2ui/blob/main/protocol/server-guide.md):
|
|
246
|
+
a complete backend, with or without the WebSocket, and what to call when.
|
|
247
|
+
- [`protocol/backend.md`](https://github.com/md2ui/md2ui/blob/main/protocol/backend.md): your
|
|
248
|
+
agent's send tool, authentication, includes and feeds.
|
|
249
|
+
- [`protocol/README.md`](https://github.com/md2ui/md2ui/blob/main/protocol/README.md): the wire
|
|
250
|
+
protocol, its JSON Schemas, golden frames and gRPC `.proto`.
|
|
251
|
+
- [md2ui-ts](https://github.com/md2ui/md2ui-ts): the frontend.
|
|
252
|
+
|
|
253
|
+
### The MCP authoring server: `md2ui-mcp`
|
|
254
|
+
|
|
255
|
+
An MCP server (stdio) an agent uses to check the Markdown it wrote before its backend
|
|
256
|
+
delivers it. Each call runs once, like the CLI. Register it with your agent's host; in
|
|
257
|
+
Claude Code:
|
|
258
|
+
|
|
259
|
+
```
|
|
260
|
+
claude mcp add md2ui -- uvx --from md2ui==0.1.0a1 md2ui-mcp --theme /path/to/THEME.md
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
| Option | Does |
|
|
264
|
+
| --- | --- |
|
|
265
|
+
| `--theme PATH` | The `THEME.md`, and the `MEANINGS.md` beside it, it checks and previews with |
|
|
266
|
+
| `--fetch` | Load pictures, theme fonts and backgrounds as the window does. For a local install only, never a hosted server |
|
|
267
|
+
|
|
268
|
+
| Tool | Returns |
|
|
269
|
+
| --- | --- |
|
|
270
|
+
| `check` | Authoring issues, as errors, warnings and notes, each with its fix |
|
|
271
|
+
| `actions` | What the answer offers the user, numbered by the wire's ordinal `x`, and which clicks come back to the agent |
|
|
272
|
+
| `outline` / `layout` | The grouped structure / the layout shape at a width, compact |
|
|
273
|
+
| `preview` | A PNG at a width |
|
|
274
|
+
| `guide` | The `skills/` notes by name; with no name, the core note to read first |
|
|
275
|
+
|
|
276
|
+
The notes are also resources (`md2ui://skills/<file>`, and the server's theme as
|
|
277
|
+
`md2ui://theme`). `guide("patterns")` lists short section patterns, and `guide("pages")`
|
|
278
|
+
whole example pages.
|
|
279
|
+
|
|
280
|
+
### The wire reference server
|
|
281
|
+
|
|
282
|
+
Serves one document over the wire, prints the sentence each click would hand an agent, and
|
|
283
|
+
ticks task boxes itself, so the round trip can be seen:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
md2ui-wire path/to/content.md --port 8765
|
|
287
|
+
md2ui-app --connect ws://127.0.0.1:8765/ws
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Where md2ui is not installed in an environment, run it with
|
|
291
|
+
`uvx --from md2ui==0.1.0a1 md2ui-wire path/to/content.md`.
|
|
292
|
+
|
|
293
|
+
| Option | Does |
|
|
294
|
+
| --- | --- |
|
|
295
|
+
| `--host HOST` | The address to listen on, default `127.0.0.1` |
|
|
296
|
+
| `--port PORT` | The port, default `8765` |
|
|
297
|
+
|
|
298
|
+
### Live demo with Claude
|
|
299
|
+
|
|
300
|
+
Claude answers in md2ui Markdown, the answer opens in md2ui's window, and your clicks come
|
|
301
|
+
back to Claude. The demo is local only.
|
|
302
|
+
|
|
303
|
+
**Install it with a plugin.** [github.com/md2ui/plugins](https://github.com/md2ui/plugins)
|
|
304
|
+
holds the host packages: the Claude Code plugins, the Claude Desktop extension, and a local
|
|
305
|
+
plugin for ChatGPT Desktop and Codex. Its README has the steps.
|
|
306
|
+
|
|
307
|
+
**Or register it by hand.** Claude Code:
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
claude mcp add md2ui-demo -- uvx --from md2ui==0.1.0a1 md2ui-mcp-demo --fetch --theme /path/to/THEME.md
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Claude Desktop, in `claude_desktop_config.json` (give the full path of `uvx` if Claude
|
|
314
|
+
Desktop does not find it):
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"mcpServers": {
|
|
319
|
+
"md2ui-demo": {
|
|
320
|
+
"command": "uvx",
|
|
321
|
+
"args": ["--from", "md2ui==0.1.0a1", "md2ui-mcp-demo", "--fetch"]
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
| Option | Does |
|
|
328
|
+
| --- | --- |
|
|
329
|
+
| `--theme PATH` | The `THEME.md` the window and previews use |
|
|
330
|
+
| `--fetch` | Load pictures, theme fonts and backgrounds, as a local install should |
|
|
331
|
+
| `--working-animation PATH` | The animated WebP or GIF the window plays while Claude works |
|
|
332
|
+
| `--no-window` | Open no window: connect a client of your own |
|
|
333
|
+
| `--port PORT` | Serve the conversation at `ws://127.0.0.1:PORT/ws` from launch; by default, a free port once the first answer is shown. A taken port stops the launch |
|
|
334
|
+
|
|
335
|
+
The demo adds these tools to the authoring ones:
|
|
336
|
+
|
|
337
|
+
| Tool | Does |
|
|
338
|
+
| --- | --- |
|
|
339
|
+
| `show` | Puts an answer in the window and returns what it offers and its authoring issues; given an earlier `message_id`, puts that page back. `ask` names the question Claude is waiting on, shown as the prompt bar's placeholder |
|
|
340
|
+
| `wait_for_event` | Returns everything the user did since the last call: clicks as sentences, or what they typed into the window |
|
|
341
|
+
| `mark` | Ticks, unticks or disables a target, or sets a slider, in place; takes `ask` as `show` does |
|
|
342
|
+
| `showing` | What the window holds, as data: the live Markdown, its offers, and what the user asked for that is not answered yet |
|
|
343
|
+
| `screenshot` | A PNG of the window as the user sees it, or of the whole answer |
|
|
344
|
+
| `status` | The state the window was last told, and whether a window is connected |
|
|
345
|
+
| `patch` | Adds, removes or replaces sections of a page already shown, and checks that nothing outside the edit moved |
|
|
346
|
+
| `history` | The pages shown in this session, newest first |
|
|
347
|
+
| `feed` | Lets a process Claude runs move the bars and marked values (`[3:53 PM](feed:arrives)`) of a shown page, without a turn of Claude's |
|
|
348
|
+
|
|
349
|
+
**How a session runs.** Claude hears the window only while a wait is open, and nothing can
|
|
350
|
+
wake it once its turn ends. So `show` and `mark` listen after replying, and Claude keeps
|
|
351
|
+
waiting until you close the window or tell it in the chat to stop. What you do in the window
|
|
352
|
+
while nobody listens waits in a queue, and the window says so: say "check md2ui" in the chat
|
|
353
|
+
and Claude picks it all up. The window's prompt bar sends what you type to Claude (Enter or
|
|
354
|
+
Send); its placeholder says whether Claude is listening, working or not listening. In Claude
|
|
355
|
+
Desktop, allow `show`, `wait_for_event` and `mark` always, or every step asks. To step away,
|
|
356
|
+
minimise (⌘M) or hide (⌘H) the window; closing it (⌘Q or its close button) ends the session.
|
|
357
|
+
|
|
358
|
+
**Your own client.** With `--no-window --port 8765`, the demo serves the conversation at
|
|
359
|
+
`ws://127.0.0.1:8765/ws` and opens no window; `status` returns the address as `url`. The demo
|
|
360
|
+
authenticates every client with a bearer secret: the one in `MD2UI_WIRE_BEARER` in its
|
|
361
|
+
environment (at least 32 characters; a shorter one is ignored), else one it mints per run and
|
|
362
|
+
gives only to the window it opens. A client sends `Authorization: Bearer <that value>` on the
|
|
363
|
+
WebSocket upgrade; one without it is refused with a 403. `md2ui-app --connect` sends the same
|
|
364
|
+
variable. A browser page cannot set that header, so it cannot connect to the demo.
|
|
365
|
+
`screenshot` needs md2ui's own window.
|
|
366
|
+
|
|
367
|
+
**After upgrading md2ui** (a new pin in `uvx --from`, or `uv tool upgrade md2ui`), the demo
|
|
368
|
+
server and its window keep running the code they started with:
|
|
369
|
+
|
|
370
|
+
- Claude Code: `/reload-plugins` does not restart the server. Use `/mcp`, choose md2ui-demo
|
|
371
|
+
and reconnect, or restart Claude Code.
|
|
372
|
+
- Claude Desktop: restart it, or turn the extension off and on under Settings → Extensions.
|
|
373
|
+
- Either: close the open md2ui window, so the next `show` opens one with the new code.
|
|
374
|
+
|
|
375
|
+
## Links
|
|
376
|
+
|
|
377
|
+
- Home page: [md2ui.org](https://md2ui.org)
|
|
378
|
+
- Source and issues: [github.com/md2ui/md2ui](https://github.com/md2ui/md2ui)
|
|
379
|
+
- Frontend library: [github.com/md2ui/md2ui-ts](https://github.com/md2ui/md2ui-ts)
|
|
380
|
+
- Host plugins: [github.com/md2ui/plugins](https://github.com/md2ui/plugins)
|
|
381
|
+
- The decisions behind the design: [`decisions/`](https://github.com/md2ui/md2ui/tree/main/decisions)
|
|
382
|
+
|
|
383
|
+
## License
|
|
384
|
+
|
|
385
|
+
md2ui's own code is under the MIT License
|
|
386
|
+
([`LICENSE`](https://github.com/md2ui/md2ui/blob/main/LICENSE)).
|
|
387
|
+
|
|
388
|
+
The package also ships one file that is not md2ui's: the icon font
|
|
389
|
+
`assets/icons/material-design-icons-md2ui.ttf`, built from Google's Material Symbols, which is
|
|
390
|
+
under the Apache License 2.0 (`assets/icons/LICENSE`); `assets/icons/NOTICE` says how it was
|
|
391
|
+
modified. Both licenses apply to what you install, so the package declares `MIT AND Apache-2.0`.
|
|
392
|
+
|
|
393
|
+
The fonts md2ui downloads on first use (those in `assets/fonts.lock`) are not part of the
|
|
394
|
+
package. Each keeps its own license, recorded beside it in the lock: OFL-1.1, or CC BY-SA 4.0
|
|
395
|
+
for OpenMoji.
|