comark-ui 0.7.1 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +2 -2
  2. package/dist/client-Bjd6VcGQ.mjs +241 -0
  3. package/dist/client.d.mts +11 -1
  4. package/dist/client.mjs +3 -26
  5. package/dist/{editor-BAdok66p.mjs → editor-DmxNPK7K.mjs} +522 -68
  6. package/dist/{editor-CNivEuMH.d.mts → editor-KD97dL_1.d.mts} +21 -3
  7. package/dist/editor-vue.d.mts +1 -1
  8. package/dist/editor-vue.mjs +1 -1
  9. package/dist/editor.d.mts +2 -2
  10. package/dist/editor.mjs +1 -1
  11. package/dist/html.d.mts +7 -1
  12. package/dist/html.mjs +29 -9
  13. package/dist/{index-B0YvApci.d.mts → index-BUDHsvnm.d.mts} +11 -2
  14. package/dist/index.d.mts +1 -1
  15. package/dist/index.mjs +2 -2
  16. package/dist/react.d.mts +2 -2
  17. package/dist/react.mjs +20 -6
  18. package/dist/skills/before-after-evidence/SKILL.md +72 -0
  19. package/dist/skills/before-after-evidence/agents/openai.yaml +3 -0
  20. package/dist/skills/before-after-evidence/references/blocks.md +54 -0
  21. package/dist/skills/before-after-evidence/references/example.md +37 -0
  22. package/dist/skills/before-after-evidence/references/measuring.md +50 -0
  23. package/dist/skills/comark-ui/SKILL.md +9 -2
  24. package/dist/skills/comark-ui/references/annotate.md +4 -2
  25. package/dist/skills/comark-ui/references/comments.md +43 -0
  26. package/dist/skills/comark-ui/references/diagrams.md +7 -1
  27. package/dist/skills/comark-ui/references/lint.md +1 -1
  28. package/dist/skills/comark-ui/references/outline.md +9 -1
  29. package/dist/skills/comark-ui/references/quiz.md +1 -1
  30. package/dist/skills/comark-ui/references/ui.md +1 -1
  31. package/dist/skills/review-document/SKILL.md +64 -0
  32. package/dist/skills/review-document/agents/openai.yaml +3 -0
  33. package/dist/skills/review-document/references/blocks.md +69 -0
  34. package/dist/skills/review-document/references/example.md +51 -0
  35. package/dist/skills/teach-lesson/SKILL.md +78 -0
  36. package/dist/skills/teach-lesson/agents/openai.yaml +3 -0
  37. package/dist/skills/teach-lesson/references/blocks.md +91 -0
  38. package/dist/skills/teach-lesson/references/example.md +70 -0
  39. package/dist/skills/visual-explanation/SKILL.md +67 -0
  40. package/dist/skills/visual-explanation/agents/openai.yaml +3 -0
  41. package/dist/skills/visual-explanation/references/blocks.md +89 -0
  42. package/dist/skills/visual-explanation/references/example.md +25 -0
  43. package/dist/skills.d.mts +18 -0
  44. package/dist/skills.mjs +326 -0
  45. package/dist/{src-DROB05U6.mjs → src-PkmYCSNu.mjs} +1 -0
  46. package/dist/svelte/Mermaid.svelte +16 -0
  47. package/dist/svelte/index.d.ts +1 -1
  48. package/dist/svelte/index.js +4 -8
  49. package/dist/{typeset-css-DPB0S1bV.mjs → typeset-css-5aJ7cSmh.mjs} +14 -0
  50. package/dist/vue.d.mts +2 -2
  51. package/dist/vue.mjs +33 -6
  52. package/package.json +46 -44
@@ -0,0 +1,25 @@
1
+ # How a Comark document becomes HTML
2
+
3
+ Parsing and rendering are two separate calls, and the plugins do their work in the first. That's why a block's problems are known before any HTML exists.
4
+
5
+ ```mermaid
6
+ flowchart LR
7
+ md[Markdown] --> tokens[Tokens]
8
+ tokens --> tree[Node tree]
9
+ tree --> doc[Nodes and issues]
10
+ doc --> html[HTML]
11
+ ```
12
+
13
+ A plugin can join at three points: its Markdown rules while the text becomes tokens, `markdownItPost` on the tokens, and `post` on the tree. The last arrow is the renderer, which only maps each node to a component.
14
+
15
+ In code, the diagram is three lines:
16
+
17
+ ```ts
18
+ const document = await parseMarkdown(source, { plugins }); // <1>
19
+ if (document.meta.issues.length) refuse(document.meta.issues); // <2>
20
+ const html = await renderHtmlFromDocument(document, { components }); // <3>
21
+ ```
22
+
23
+ 1. Every plugin runs here, in the order of `plugins`.
24
+ 2. Each issue is one sentence naming the block and the fix, so a host can refuse a document before it renders.
25
+ 3. Components only draw: `screenshot` maps to the figure's HTML, and nothing is parsed again.
@@ -0,0 +1,18 @@
1
+ //#region src/skills.d.ts
2
+ /** One file of a skill, at its path from the skill's folder, such as `SKILL.md` or `references/example.md`. */
3
+ export interface SkillFile {
4
+ path: string;
5
+ text: string;
6
+ }
7
+ /** An Agent Skill: its folder's name, its frontmatter, and every file in it, `SKILL.md` first. */
8
+ export interface Skill {
9
+ name: string;
10
+ description: string;
11
+ frontmatter: Record<string, unknown>;
12
+ files: SkillFile[];
13
+ }
14
+ /** Every agent skill this version of comark-ui ships, in the order of their names. */
15
+ export declare const skills: Skill[];
16
+ /** The comark-ui version the skills come from, for a host's cache key or a digest. */
17
+ export declare const version: string;
18
+ //#endregion