egatari 0.6.18 → 0.6.19
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.
- package/CHANGELOG.md +33 -1
- package/components.lock.json +34 -9
- package/components2.lock.json +363 -1
- package/kit/build.mjs +1 -1
- package/kit/check-messages.mjs +4 -0
- package/kit/check.mjs +3 -1
- package/kit/core/build-core.mjs +1 -1
- package/kit/core/check-parity.mjs +2 -0
- package/kit/core/check-rules.mjs +1 -1
- package/kit/core/check-source.mjs +4 -1
- package/kit/core/checks.mjs +79 -0
- package/kit/core/find-replace.mjs +170 -0
- package/kit/core/format.mjs +4 -1
- package/kit/core/image-insert.mjs +197 -0
- package/kit/core/image-size.mjs +1 -1
- package/kit/core/layout-scan.mjs +1 -1
- package/kit/core/llm-fix.mjs +1 -1
- package/kit/core/llm-pack-assemble.mjs +3 -1
- package/kit/core/llm-pack-data.mjs +51 -15
- package/kit/core/part-labels.mjs +1 -0
- package/kit/core/portable.mjs +5 -2
- package/kit/core/scorm.mjs +30 -6
- package/kit/core/script-unclosed.mjs +49 -0
- package/kit/core/slide-ops.mjs +5 -1
- package/kit/core/template-text.mjs +2 -0
- package/kit/deck.js +71 -4
- package/kit/instruction-version.json +1 -1
- package/kit/layouts.css +8 -0
- package/kit/panes.js +17 -1
- package/kit/player.json +1 -1
- package/kit/player.lock.json +2 -2
- package/kit/track.js +46 -5
- package/package.json +1 -1
- package/server/editor-ui.js +21 -1
- package/vendor/components/CATALOG.md +3 -2
- package/vendor/components/sha256/15306d854d67d52ca2b1d66135f0d3296882e6b21fd85c029399b8077c8a7f9d/README.en.md +34 -0
- package/vendor/components/sha256/15306d854d67d52ca2b1d66135f0d3296882e6b21fd85c029399b8077c8a7f9d/index.js +398 -0
- package/vendor/components/sha256/277ac772315f93737a094cd0f0842726f2435d352d9a90822aebfe0d5d7e79a1/README.en.md +23 -0
- package/vendor/components/sha256/277ac772315f93737a094cd0f0842726f2435d352d9a90822aebfe0d5d7e79a1/index.js +294 -0
- package/vendor/components/sha256/3be5f64deb1951327b614b29a9b632878fab362687c76e3f48f3af1d1ebbb1cf/README.en.md +47 -0
- package/vendor/components/sha256/3be5f64deb1951327b614b29a9b632878fab362687c76e3f48f3af1d1ebbb1cf/index.js +223 -0
- package/vendor/components/sha256/7c7b0373cfd38fd5ecb4169021e0b908f0a17be1a29b14f85dd89fdb92e7bf81/README.en.md +44 -0
- package/vendor/components/sha256/7c7b0373cfd38fd5ecb4169021e0b908f0a17be1a29b14f85dd89fdb92e7bf81/index.js +306 -0
- package/vendor/components/sha256/939bdae590ebed3d182b0c9940a35b6c03872505bfa242341990a81cae02fd06/README.en.md +34 -0
- package/vendor/components/sha256/939bdae590ebed3d182b0c9940a35b6c03872505bfa242341990a81cae02fd06/index.js +397 -0
- package/vendor/components/sha256/9c5dd0bc0c3279c5f0fea3fdb9d0735870880aef96e8bbf9ecdd77dff0f5ddc8/README.en.md +44 -0
- package/vendor/components/sha256/9c5dd0bc0c3279c5f0fea3fdb9d0735870880aef96e8bbf9ecdd77dff0f5ddc8/index.js +551 -0
- package/vendor/components/sha256/a5b032657720d3beb64f0b3699954e13b0eb985f36161b9ae046c83fd6048ff5/README.en.md +18 -0
- package/vendor/components/sha256/a5b032657720d3beb64f0b3699954e13b0eb985f36161b9ae046c83fd6048ff5/index.js +382 -0
- package/vendor/components-2/manifest-2.20.0.json +3217 -0
- package/vendor/components-2/manifest-2.21.0.json +3220 -0
- package/vendor/egatari-spec/SOURCE.json +2 -2
- package/vendor/egatari-spec/schema/deck-meta.schema.json +3 -0
- package/vendor/egatari-spec/schema/egatari-metadata.schema.json +6 -0
|
@@ -464,6 +464,10 @@ export const PACK = {
|
|
|
464
464
|
"m-contour": [
|
|
465
465
|
"change"
|
|
466
466
|
],
|
|
467
|
+
"m-contrast": [
|
|
468
|
+
"compare",
|
|
469
|
+
"position"
|
|
470
|
+
],
|
|
467
471
|
"m-ctable": [
|
|
468
472
|
"part-whole",
|
|
469
473
|
"cause-effect"
|
|
@@ -570,6 +574,7 @@ export const PACK = {
|
|
|
570
574
|
"reveal"
|
|
571
575
|
],
|
|
572
576
|
"m-contour": [],
|
|
577
|
+
"m-contrast": [],
|
|
573
578
|
"m-ctable": [],
|
|
574
579
|
"m-curves": [],
|
|
575
580
|
"m-cycle": [
|
|
@@ -728,6 +733,10 @@ export const PACK = {
|
|
|
728
733
|
"tag": "m-contour",
|
|
729
734
|
"set": "ml"
|
|
730
735
|
},
|
|
736
|
+
{
|
|
737
|
+
"tag": "m-contrast",
|
|
738
|
+
"set": "standard"
|
|
739
|
+
},
|
|
731
740
|
{
|
|
732
741
|
"tag": "m-ctable",
|
|
733
742
|
"set": "standard"
|
|
@@ -902,9 +911,9 @@ export const PACK = {
|
|
|
902
911
|
"m-collect",
|
|
903
912
|
"m-kakijun"
|
|
904
913
|
],
|
|
905
|
-
"partsSrc": "https://github.com/egatari/components/blob/v2.
|
|
914
|
+
"partsSrc": "https://github.com/egatari/components/blob/v2.21.0/components/",
|
|
906
915
|
"en": {
|
|
907
|
-
"common": "# Instructions for the AI\n\nPack version: `2a06805c`\n\nYou will write one short **Egatari file**: HTML slides with step-by-step reveals (`deck.html`) and a spoken script for it (`narration.md`). Both are built and quality-checked automatically; only what is described here is available. Write slides and script in the language the user asks for. Standards have ids such as **R-fit**; a fix request names the standards a draft broke. The user's request is in **What I want** at the end (or in the conversation before it): choose sensibly for any field that is empty or missing, and if both A and B are left, follow the one with content.\n\n**Before you start (the most common failures):**\n\n- **Both code blocks must be complete and closed.** Never stop in the middle of a block (R-output). Without an outline, keep it short (5–8 slides). Given an outline and a range of its slides, write exactly that range (at most 6 slides, so they fit).\n- **Sizes on the 1280×720 slide** (the quality checker measures them, R-fit): the body area is 1184 × 443 px (to 565 px; 1184 × 558 with `noconcl`). Body text is 32 px with 46 px per line, so about **8 lines** fit; every overflowing 46 px is one line to cut. **All text, also inside figures and parts, is at least 24 px.**\n- **Charts and figures:** parts draw their labels at 24–28 px whatever their size (their SVG uses their own pixels), so size the part, not the text. A part of 380 px leaves room for one short line; with two lines, use 330 px.\n- **Inline `<svg>`:** its text is scaled by displayed width ÷ viewBox width, so write the viewBox in the pixels it is shown at, e.g. `<svg viewBox=\"0 0 560 320\" width=\"560\" height=\"320\">`, with `font-size` ≥ 24. Never combine `width:100%` with another viewBox width (a 600-wide viewBox shown 580 px wide turns 24 into 23.2 px). Prefer a part when one fits.\n\n## 1. Output format\n\n- **R-output** Reply with **exactly two fenced code blocks**, in this order, labelled `deck.html` and `narration.md` (the opening lines are ```` ```deck.html ```` and ```` ```narration.md ````). Put nothing between them; a one-line note before or after is fine. Never split a file over several blocks. No files, canvas or attachments: write both blocks in your chat message. Do not reference other files (no images, no `{{FIG:…}}`, no `{{JSON:…}}`, no external URLs, no `<link>`), and never stop in the middle of a block: if the lesson would be too long, make fewer slides (but for a range of an outline, write exactly the requested slides).\n- **R-outline** When the request asks for an **outline only** (a long file made in two passes), reply with exactly one fenced code block labelled `outline` (the opening line is ```` ```outline ````) and no `deck.html` or `narration.md`: a Markdown table (columns `#`, heading, one-line point), one row per slide, all slides in order. Each later request names a range (“slides 7–12 of the outline”): write exactly those slides, following their headings and points.\n- **R-noids** Do **not** write slide ids. Write `<section class=\"slide\">` without `id`, and script headings without `{#…}`. The editor adds ids after import. When you are given slides that already have ids (a fix request), keep every existing `id=\"…\"` and `{#…}` exactly as it is.\n\n## 2. deck.html\n\n### 2.1 Skeleton\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Title</title>\n</head>\n<body>\n<div id=\"stage\">\n <section class=\"slide cover noconcl static\"> … </section>\n <section class=\"slide\"> … </section>\n</div>\n</body>\n</html>\n```\n\n- `lang`: `en`, `ja`, … (the language of the slides and script). `data-theme`: `sumi` for business and pitch decks, `kokugo` for Japanese language arts, otherwise `default`.\n- No `<script>` except part data (§2.6), no `<link>`. A `<style>` block is allowed only for layout (sizes, gaps), never colors.\n\n### 2.2 Slides\n\n- Normal slide: `<h2>` heading, `<div class=\"body\">…</div>`, then `<div class=\"concl\"><span>…</span></div>` (the conclusion line: one short sentence).\n- Optional kicker (a short line above the heading): one `<p class=\"kicker\">` just before the `<h2>` (ordinary slides only, not `layout-tate`); shown at step 0, not part of the heading. Type it normally, not in capitals (the theme capitalizes English).\n- Cover: `<section class=\"slide cover noconcl static\">` with optional `<div class=\"venue\">…</div>`, `<h1>title</h1>`, optional `<div class=\"au\">…</div>`.\n- Chapter divider: `<section class=\"slide sec noconcl static\"><h1>chapter title</h1></section>`.\n- Classes on `<section>`: `noconcl` (no conclusion line), `static` (no steps), `nostep` (all list items visible from the start), `layout-tate` (Japanese vertical writing; only with the kokugo part set, which describes it), and the `data-morph` attribute (§2.5).\n- Inside `.body`: `<p class=\"sub\">` sub-heading, `<div class=\"big\">` main equation, `<p class=\"note\">` note, `<div class=\"thm\">` theorem box, `<div class=\"cols\">` side-by-side columns, ordinary `<p>`, `<ul>`, `<ol>`, `<table>`.\n- **R-caution** In `.body`: `<div class=\"caution\">…</div>` for caution; add `warn` for warning. Labels are automatic.\n- Inline emphasis (the only way to color text): `term` (term or question), `emph` (conclusion, problem, goal), `muted` (known result, de-emphasized), `b` (bold).\n- **R-headings** Every slide heading (`h1` on the cover and dividers, `h2` elsewhere) is **different** from all the others (add a word if two would be the same), and the script section of that slide starts with `## ` followed by **exactly the same heading text** (tags such as `<br>` dropped).\n- **R-colors** Colors only through the theme: the classes above and the math macros `\\hlE` `\\hlT` `\\hlM`; no hex, `rgb()`, named colors, `\\color` or `\\textcolor`. In a part or inline SVG: **Use only the theme's CSS variables for colors**: `var(--fg)` `var(--term)` `var(--emph)` `var(--muted)` `var(--accent2)` `var(--line)`. In SVG write `style=\"stroke:var(--emph)\"` rather than an attribute (`DECK.el` moves `fill` and `stroke` into style automatically when they contain `var(`)\n\n### 2.3 Steps (reveal order = speaking order)\n\n- **R-steps** Step 0 is the slide as it first appears: context only (heading, sub-heading, one framing sentence). An element with `data-step=\"k\"` (k = 1, 2, …) appears at step k; material (list items, equations, table rows, figure parts) appears in the order you talk about it. An equation and the sentence that introduces it share one step (wrap both in `<div data-step=\"k\">`). About 5 steps per slide at most. Choose how a table appears by how it compares. When the script takes items one at a time, show rows in the order spoken. For a matrix (things compared down the side, criteria across) or a table crossing two axes, show the whole table and then mark the column or cell under discussion, or fill it one axis value at a time. In a research-positioning table, write \"This work\" in your own cell (do not mark it by colour or bold alone).\n- The conclusion line automatically becomes the **last step**, `concl`; never put `data-step` on it.\n- If a slide has **no** `data-step` anywhere, its top-level list items (`.body > ul > li`, `.body > ol > li`) are numbered 1, 2, … automatically. As soon as any element has `data-step`, nothing is automatic: give every revealed element its `data-step`.\n- A part adds its own steps (§3), starting at its `data-from` (default 1).\n- So the steps of a slide are `0 … max` plus `concl` if it has a conclusion line. A `static` slide has only step 0.\n\n### 2.4 Math (KaTeX, rendered at build time)\n\n- **R-math** Inline `\\( … \\)`, display `\\[ … \\]`. Write `<` as `\\lt` and `>` as `\\gt` inside math. Allowed macros besides standard KaTeX: `\\hlE{…}` (emph) `\\hlT{…}` (term) `\\hlM{…}` (muted), `\\htmlId{ID}{…}`, `\\htmlData{mark=ID}{…}`, `\\htmlClass{…}{…}`, `\\morph{ID}{…}`. No `\\newcommand`, no `\\color`. To label a term, use `\\underbrace{…}_{\\text{…}}` or `\\overbrace{…}^{…}`. Never `$$`. Define each symbol where it is first used (`\\(\\mu\\)`: the mean).\n\n### 2.5 Attention marks and morphs\n\n- **R-marks** The script’s `{mark:ID}` (§4) marks a target on the **same slide**. Targets: an element in the slide with `id=\"ID\"` or `data-mark=\"ID\"`. For part of an equation, KaTeX's `\\htmlId{ID}{…}` / `\\htmlData{mark=ID}{…}` (the build allows only these two and `\\htmlClass`). If the same ID is used on several slides, use `data-mark` (ids must be unique in the document)\n- Morph (optional): `<section class=\"slide\" data-morph>` slides elements from the previous slide into place; pair elements with the same `data-id=\"…\"` on both slides, or equation parts with `\\morph{ID}{…}` on both. Only elements visible at step 0 move.\n\n### 2.6 Parts\n\n- **R-components** Animated figures are the Web Components `<m-…>` of the catalog (§3), used inside `.body`. Give each a height (`style=\"height:380px\"`) and an `aria-label`. Data goes in **one** child `<script type=\"application/json\">…</script>` written inline (never `{{JSON:…}}`). **Numbers in figures must be correct** (compute them; never invent values for looks; label made-up business figures as fictional). Formulas are arithmetic only (`Math.exp(x)`, `x**2`), never run as code. Use parts only where motion explains something; most slides need none.\n\n### 2.7 Choosing a representation\n\n- **R-purpose** Choose the representation from what the slide must say, not from habit. If the author names a chart type, use it. The table names every part, but use only those described here (§3 and the included part sets). If a part that is not included would fit better, say so in a one-line note.\n\n{{PURPOSES}}\n\n- **R-whole** Lists, KPI cards and pies are shown whole; do not reveal them line by line unless the script discusses each item in turn (for a list, give it one `data-step` or put `nostep` on the slide).\n\n### 2.8 Fitting the slide (1280×720; the quality checker reports errors)\n\n- **R-title** Heading: Japanese at most 26 units (full-width character = 1, ASCII = 0.5); English at most 60 characters. Never ends with a colon.\n- **R-concl** Conclusion line: Japanese at most 35 units; English at most 70 characters. One line.\n- **R-fit** The body must end above 565 px (680 px with `noconcl`): about 8 lines / 100 Japanese characters / 60 English words per slide, or one `big` equation and 3 short bullets, or a part of height ≤ 380 px and one short line (≤ 330 px with two). If it does not fit, split the slide; never shrink text and never set font sizes.\n- **R-style** Japanese slides: plain style (だ・である, 体言止め), no です・ます on slides, one punctuation style in the whole file (`、。` or `,.`). English slides: short phrases, sentence case.\n\n## 3. Part catalog\n\nStandard parts fit any file; a part set after §6 adds the parts for its material. “steps” is how many slide steps a part uses (from `data-from`, default 1). Timing attributes (durations, delays) are not listed; their defaults fit the narration. Attribute values of type json are written as JSON in the attribute (`values=\"[0.1,0.5]\"`). In “data shape”, `?` marks an optional field; where no type is written, label, tex, note and tone are str, step is int and at is num. In a name or label, `*…*` is italic and `_` `^` make only the next character a subscript or superscript; to show the symbol itself, write the full-width _ ^ *.\n\n{{CATALOG}}\n\n## 4. narration.md\n\n```markdown\n# Script: <title>\n\n## The decay law\n[0] Here is the decay law. We follow how many atoms are left.\n[1] The number left is the starting number times a shrinking exponential.\n[2] {mark:n0|circle}{N₀|N naught} is the number at the start, at time zero.\n[concl] The half-life depends only on the decay constant.\n```\n\n- One section per slide, **in slide order, for every slide (cover included)**: `## <slide heading>` (R-headings), no `{#id}` (R-noids).\n- **R-narr-steps** Step labels `[0]`, `[1]`, … and `[concl]`. **Every step of every slide has script lines** (step 0 to max, and `[concl]` if the slide has a conclusion line), and there are **no labels for steps that do not exist** (a `static` cover has only `[0]`; a slide without a conclusion line has no `[concl]`; never `[01]`). Within a step, talk only about what appears at that step.\n- **R-dialogue** **One narrator by default**: write no speaker names. Write a dialogue only when asked (if asked for three or more speakers, keep two roles and say so first): lines start with `Expert:` or `Novice:` (continuation lines indented; a line without a speaker is Expert), shaped as a cognitive apprenticeship:\n - Novice is never a mere backchannel: Novice voices the question a learner is likely to have, or paraphrases (“So …, is that right?”)\n - Expert answers and adds one example or analogy, or confirms (or corrects) the paraphrase and takes one step further\n - Only at a comprehension fork (where learners tend to misunderstand, or a “why” remains): at most one exchange per slide, 2–3 turns. Elsewhere Expert alone\n - Never a turn that is only “I see”, or that repeats the previous turn. Example: `Novice: So a larger rate always gets there faster?` `Expert: Not always. Too large, and each step jumps across the valley, like striding downhill onto the opposite slope.`\n- `{note:…}`: presenter directions.\n- `{cue}`: a sync point inside a step, one per entry of the part’s `cues(k)` (only where a part’s README asks for it; otherwise omit).\n- `{mark:ID}`, `{mark:ID|effect}`, `{mark:ID|effect|hold=seconds}`, `{mark:clear}`: placed **right before** the words about the target; at most 1–2 per step; still say the thing in words. Effects: `underline` (default; a hand-drawn underline from left to right), `circle` (a hand-drawn circle), `box` (a rounded frame), `spot` (dims everything except the area around the target with the background color), `laser` (a dot of light slides to below the target and stays briefly)\n- **R-reading** `{display|reading}` gives the reading of **one symbol or one term**: `{θ|theta}`, `{N₀|N naught}`, `{x̄|x bar}`, `{論語|ろんご}`. One symbol may carry a star, a prime, a subscript or superscript, or a hat/bar/tilde (`{Q*|Q star}`, `{x′|x prime}`, `{θ̂|theta hat}`). Write the display part in plain Unicode, not LaTeX, and never as an expression or several symbols (`{1-η|…}`, `{a*b|…}` and `{θとη|…}` are wrong: give each symbol its own reading and say the relation in words). Give a reading only to a term misread without one, and then everywhere it appears.\n- **R-formula** **Never read an equation aloud**: no LaTeX, no `\\`, `^`, `_`, and no strings such as `a + b = c` in the narration. Say what the equation means (“the number left is the starting number times a shrinking exponential”).\n- Japanese script is polite spoken Japanese (です・ます); English script is plain spoken English. About 5 Japanese characters or 2.5 English words per second; 1–3 sentences per turn.\n\n## 5. Fix requests\n\nWhen the user pastes a **fix request** (a list of findings with the ids of the standards, followed by the current files), fix exactly those findings, keep everything else, keep every `id=\"…\"` and `{#…}` unchanged (R-noids), and reply again with the two blocks (R-output). If the request contains only some slides, return only those `<section>` elements in the `deck.html` block (no `<html>`) and only their sections in the `narration.md` block; the editor puts them back in place by id.\n\n## 6. Worked example\n\nA small example, fictional, showing the structure only (do not copy its content). Note how the steps add up: the list of 2 items gives steps 1–2 and `[concl]`<!--part:m-flow-->; the `m-flow` with 4 boxes gives steps 1–4<!--/part-->. The static cover has `[0]` only. Some part sets end with an example of their own.\n\n### Common (English, default theme, marks<!--part:m-flow-->, m-flow<!--/part-->)\n\n```deck.html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>How a web page arrives</title>\n</head>\n<body>\n<div id=\"stage\">\n\n<section class=\"slide cover noconcl static\">\n <div class=\"venue\">Computing basics, lesson 1 (a fictional course)</div>\n <h1>How a web page arrives</h1>\n</section>\n\n<section class=\"slide\">\n <h2>Two programs take part</h2>\n <div class=\"body\">\n <p>Opening a page is a conversation between two programs.</p>\n <ul>\n <li id=\"browser\">The <span class=\"term\">browser</span> asks for the page and draws it</li>\n <li id=\"server\">The <span class=\"term\">server</span> keeps the page and sends it back</li>\n </ul>\n </div>\n <div class=\"concl\"><span>Every page load is a request and a reply</span></div>\n</section><!--part:m-flow-->\n\n<section class=\"slide\">\n <h2>From the address to the screen</h2>\n <div class=\"body\">\n <m-flow style=\"height:300px\" aria-label=\"Four stages: type the address, send a request, send the page back, draw the page\">\n <script type=\"application/json\">{\"nodes\": [\n {\"id\": \"a\", \"label\": \"Type the\\naddress\", \"x\": 10, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 1},\n {\"id\": \"b\", \"label\": \"Send a\\nrequest\", \"x\": 315, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 2},\n {\"id\": \"c\", \"label\": \"Send the\\npage back\", \"x\": 620, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 3, \"tone\": \"term\"},\n {\"id\": \"d\", \"label\": \"Draw the\\npage\", \"x\": 925, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 4, \"tone\": \"emph\"}\n ], \"edges\": [\n {\"from\": \"a\", \"to\": \"b\"}, {\"from\": \"b\", \"to\": \"c\"}, {\"from\": \"c\", \"to\": \"d\"}\n ]}</script>\n </m-flow>\n </div>\n <div class=\"concl\"><span>A slow page is slow in one of these four stages</span></div>\n</section><!--/part-->\n\n</div>\n</body>\n</html>\n```\n\n```narration.md\n# Narration: How a web page arrives\n\n## How a web page arrives\n[0] Today we follow a web page on its way from a server to your screen.\n\n## Two programs take part\n[0] Opening a page is a conversation between two programs.\n[1] {mark:browser}The browser is the program you look at. It asks for the page and then draws it.\n[2] {mark:server}The server is a program on another computer. It keeps the page and sends it back when asked.\n[concl] Every page load is a request and a reply.<!--part:m-flow-->\n\n## From the address to the screen\n[0] Let us put the steps in order.\n[1] First you type the address of the page.\n[2] The browser turns it into a request and sends it to the server.\n[3] The server finds the page and sends it back.\n[4] The browser draws the page on the screen.\n[concl] When a page is slow, one of these four stages is taking the time.<!--/part-->\n```",
|
|
916
|
+
"common": "# Instructions for the AI\n\nPack version: `027f5293`\n\nYou will write one short **Egatari file**: HTML slides with step-by-step reveals (`deck.html`) and a spoken script for it (`narration.md`). Both are built and quality-checked automatically; only what is described here is available. Write slides and script in the language the user asks for. Standards have ids such as **R-fit**; a fix request names the standards a draft broke. The user's request is in **What I want** at the end (or in the conversation before it): choose sensibly for any field that is empty or missing, and if both A and B are left, follow the one with content.\n\n**Before you start (the most common failures):**\n\n- **Both code blocks must be complete and closed.** Never stop in the middle of a block (R-output). Without an outline, keep it short (5–8 slides). Given an outline and a range of its slides, write exactly that range (at most 6 slides, so they fit).\n- **Sizes on the 1280×720 slide** (the quality checker measures them, R-fit): the body area is 1184 × 443 px (to 565 px; 1184 × 558 with `noconcl`). Body text is 32 px with 46 px per line, so about **8 lines** fit; every overflowing 46 px is one line to cut. **All text, also inside figures and parts, is at least 24 px.**\n- **Charts and figures:** parts draw their labels at 24–28 px whatever their size (their SVG uses their own pixels), so size the part, not the text. A part of 380 px leaves room for one short line; with two lines, use 330 px.\n- **Inline `<svg>`:** its text is scaled by displayed width ÷ viewBox width, so write the viewBox in the pixels it is shown at, e.g. `<svg viewBox=\"0 0 560 320\" width=\"560\" height=\"320\">`, with `font-size` ≥ 24. Never combine `width:100%` with another viewBox width (a 600-wide viewBox shown 580 px wide turns 24 into 23.2 px). Prefer a part when one fits.\n\n## 1. Output format\n\n- **R-output** Reply with **exactly two fenced code blocks**, in this order, labelled `deck.html` and `narration.md` (the opening lines are ```` ```deck.html ```` and ```` ```narration.md ````). Put nothing between them; a one-line note before or after is fine. Never split a file over several blocks. No files, canvas or attachments: write both blocks in your chat message. Do not reference other files (no images, no `{{FIG:…}}`, no `{{JSON:…}}`, no external URLs, no `<link>`), and never stop in the middle of a block: if the lesson would be too long, make fewer slides (but for a range of an outline, write exactly the requested slides).\n- **R-outline** When the request asks for an **outline only** (a long file made in two passes), reply with exactly one fenced code block labelled `outline` (the opening line is ```` ```outline ````) and no `deck.html` or `narration.md`: a Markdown table (columns `#`, heading, one-line point), one row per slide, all slides in order. Each later request names a range (“slides 7–12 of the outline”): write exactly those slides, following their headings and points.\n- **R-noids** Do **not** write slide ids. Write `<section class=\"slide\">` without `id`, and script headings without `{#…}`. The editor adds ids after import. When you are given slides that already have ids (a fix request), keep every existing `id=\"…\"` and `{#…}` exactly as it is.\n\n## 2. deck.html\n\n### 2.1 Skeleton\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Title</title>\n</head>\n<body>\n<div id=\"stage\">\n <section class=\"slide cover noconcl static\"> … </section>\n <section class=\"slide\"> … </section>\n</div>\n</body>\n</html>\n```\n\n- `lang`: `en`, `ja`, … (the language of the slides and script). `data-theme`: `sumi` for business and pitch decks, `kokugo` for Japanese language arts, otherwise `default`.\n- No `<script>` except part data (§2.6), no `<link>`. A `<style>` block is allowed only for layout (sizes, gaps), never colors.\n\n### 2.2 Slides\n\n- Normal slide: `<h2>` heading, `<div class=\"body\">…</div>`, then `<div class=\"concl\"><span>…</span></div>` (the conclusion line: one short sentence).\n<!--paid-->- On a slide that uses numbers, a figure or a quotation, write a source line above the conclusion (`<p class=\"source\">Source: …</p>`)<!--/paid-->\n- Optional kicker (a short line above the heading): one `<p class=\"kicker\">` just before the `<h2>` (ordinary slides only, not `layout-tate`); shown at step 0, not part of the heading. Type it normally, not in capitals (the theme capitalizes English).\n- Cover: `<section class=\"slide cover noconcl static\">` with optional `<div class=\"venue\">…</div>`, `<h1>title</h1>`, optional `<div class=\"au\">…</div>`.\n- Chapter divider: `<section class=\"slide sec noconcl static\"><h1>chapter title</h1></section>`.\n- Classes on `<section>`: `noconcl` (no conclusion line), `static` (no steps), `nostep` (all list items visible from the start), `layout-tate` (Japanese vertical writing; only with the kokugo part set, which describes it), and the `data-morph` attribute (§2.5).\n- Inside `.body`: `<p class=\"sub\">` sub-heading, `<div class=\"big\">` main equation, `<p class=\"note\">` note, `<div class=\"thm\">` theorem box, `<div class=\"cols\">` side-by-side columns, ordinary `<p>`, `<ul>`, `<ol>`, `<table>`.\n- **R-caution** In `.body`: `<div class=\"caution\">…</div>` for caution; add `warn` for warning. Labels are automatic.\n- Inline emphasis (the only way to color text): `term` (term or question), `emph` (conclusion, problem, goal), `muted` (known result, de-emphasized), `b` (bold).\n- **R-headings** Every slide heading (`h1` on the cover and dividers, `h2` elsewhere) is **different** from all the others (add a word if two would be the same), and the script section of that slide starts with `## ` followed by **exactly the same heading text** (tags such as `<br>` dropped).\n- **R-colors** Colors only through the theme: the classes above and the math macros `\\hlE` `\\hlT` `\\hlM`; no hex, `rgb()`, named colors, `\\color` or `\\textcolor`. In a part or inline SVG: **Use only the theme's CSS variables for colors**: `var(--fg)` `var(--term)` `var(--emph)` `var(--muted)` `var(--accent2)` `var(--line)`. In SVG write `style=\"stroke:var(--emph)\"` rather than an attribute (`DECK.el` moves `fill` and `stroke` into style automatically when they contain `var(`)\n\n### 2.3 Steps (reveal order = speaking order)\n\n- **R-steps** Step 0 is the slide as it first appears: context only (heading, sub-heading, one framing sentence). An element with `data-step=\"k\"` (k = 1, 2, …) appears at step k; material (list items, equations, table rows, figure parts) appears in the order you talk about it. An equation and the sentence that introduces it share one step (wrap both in `<div data-step=\"k\">`). About 5 steps per slide at most. Choose how a table appears by how it compares. When the script takes items one at a time, show rows in the order spoken. For a matrix (things compared down the side, criteria across) or a table crossing two axes, show the whole table and then mark the column or cell under discussion, or fill it one axis value at a time. In a research-positioning table, write \"This work\" in your own cell (do not mark it by colour or bold alone).\n- The conclusion line automatically becomes the **last step**, `concl`; never put `data-step` on it.\n- If a slide has **no** `data-step` anywhere, its top-level list items (`.body > ul > li`, `.body > ol > li`) are numbered 1, 2, … automatically. As soon as any element has `data-step`, nothing is automatic: give every revealed element its `data-step`.\n- A part adds its own steps (§3), starting at its `data-from` (default 1).\n- So the steps of a slide are `0 … max` plus `concl` if it has a conclusion line. A `static` slide has only step 0.\n\n### 2.4 Math (KaTeX, rendered at build time)\n\n- **R-math** Inline `\\( … \\)`, display `\\[ … \\]`. Write `<` as `\\lt` and `>` as `\\gt` inside math. Allowed macros besides standard KaTeX: `\\hlE{…}` (emph) `\\hlT{…}` (term) `\\hlM{…}` (muted), `\\htmlId{ID}{…}`, `\\htmlData{mark=ID}{…}`, `\\htmlClass{…}{…}`, `\\morph{ID}{…}`. No `\\newcommand`, no `\\color`. To label a term, use `\\underbrace{…}_{\\text{…}}` or `\\overbrace{…}^{…}`. Never `$$`. Define each symbol where it is first used (`\\(\\mu\\)`: the mean).\n\n### 2.5 Attention marks and morphs\n\n- **R-marks** The script’s `{mark:ID}` (§4) marks a target on the **same slide**. Targets: an element in the slide with `id=\"ID\"` or `data-mark=\"ID\"`. For part of an equation, KaTeX's `\\htmlId{ID}{…}` / `\\htmlData{mark=ID}{…}` (the build allows only these two and `\\htmlClass`). If the same ID is used on several slides, use `data-mark` (ids must be unique in the document)\n- Morph (optional): `<section class=\"slide\" data-morph>` slides elements from the previous slide into place; pair elements with the same `data-id=\"…\"` on both slides, or equation parts with `\\morph{ID}{…}` on both. Only elements visible at step 0 move.\n\n### 2.6 Parts\n\n- **R-components** Animated figures are the Web Components `<m-…>` of the catalog (§3), used inside `.body`. Give each a height (`style=\"height:380px\"`) and an `aria-label`. Data goes in **one** child `<script type=\"application/json\">…</script>` written inline (never `{{JSON:…}}`). **Numbers in figures must be correct** (compute them; never invent values for looks; label made-up business figures as fictional). Formulas are arithmetic only (`Math.exp(x)`, `x**2`), never run as code. Use parts only where motion explains something; most slides need none.\n<!--paid-->- Where a photo is needed, write a figure box (the Figure template) with a description of the photo; the author adds the image later<!--/paid-->\n\n### 2.7 Choosing a representation\n\n- **R-purpose** Choose the representation from what the slide must say, not from habit. If the author names a chart type, use it. The table names every part, but use only those described here (§3 and the included part sets). If a part that is not included would fit better, say so in a one-line note.\n\n{{PURPOSES}}\n\n- **R-whole** Lists, KPI cards and pies are shown whole; do not reveal them line by line unless the script discusses each item in turn (for a list, give it one `data-step` or put `nostep` on the slide).\n\n### 2.8 Fitting the slide (1280×720; the quality checker reports errors)\n\n- **R-title** Heading: Japanese at most 26 units (full-width character = 1, ASCII = 0.5); English at most 60 characters. Never ends with a colon.\n- **R-concl** Conclusion line: Japanese at most 35 units; English at most 70 characters. One line.\n- **R-fit** The body must end above 565 px (680 px with `noconcl`): about 8 lines / 100 Japanese characters / 60 English words per slide, or one `big` equation and 3 short bullets, or a part of height ≤ 380 px and one short line (≤ 330 px with two). If it does not fit, split the slide; never shrink text and never set font sizes.\n- **R-style** Japanese slides: plain style (だ・である, 体言止め), no です・ます on slides, one punctuation style in the whole file (`、。` or `,.`). English slides: short phrases, sentence case.\n\n## 3. Part catalog\n\nStandard parts fit any file; a part set after §6 adds the parts for its material. “steps” is how many slide steps a part uses (from `data-from`, default 1). Timing attributes (durations, delays) are not listed; their defaults fit the narration. Attribute values of type json are written as JSON in the attribute (`values=\"[0.1,0.5]\"`). In “data shape”, `?` marks an optional field; where no type is written, label, tex, note and tone are str, step is int and at is num. In a name or label, `*…*` is italic and `_` `^` make only the next character a subscript or superscript; to show the symbol itself, write the full-width _ ^ *.\n\n{{CATALOG}}\n\n## 4. narration.md\n\n```markdown\n# Script: <title>\n\n## The decay law\n[0] Here is the decay law. We follow how many atoms are left.\n[1] The number left is the starting number times a shrinking exponential.\n[2] {mark:n0|circle}{N₀|N naught} is the number at the start, at time zero.\n[concl] The half-life depends only on the decay constant.\n```\n\n- One section per slide, **in slide order, for every slide (cover included)**: `## <slide heading>` (R-headings), no `{#id}` (R-noids).\n- **R-narr-steps** Step labels `[0]`, `[1]`, … and `[concl]`. **Every step of every slide has script lines** (step 0 to max, and `[concl]` if the slide has a conclusion line), and there are **no labels for steps that do not exist** (a `static` cover has only `[0]`; a slide without a conclusion line has no `[concl]`; never `[01]`). Within a step, talk only about what appears at that step.\n- **R-dialogue** **One narrator by default**: write no speaker names. Write a dialogue only when asked (if asked for three or more speakers, keep two roles and say so first): lines start with `Expert:` or `Novice:` (continuation lines indented; a line without a speaker is Expert), shaped as a cognitive apprenticeship:\n - Novice is never a mere backchannel: Novice voices the question a learner is likely to have, or paraphrases (“So …, is that right?”)\n - Expert answers and adds one example or analogy, or confirms (or corrects) the paraphrase and takes one step further\n - Only at a comprehension fork (where learners tend to misunderstand, or a “why” remains): at most one exchange per slide, 2–3 turns. Elsewhere Expert alone\n - Never a turn that is only “I see”, or that repeats the previous turn. Example: `Novice: So a larger rate always gets there faster?` `Expert: Not always. Too large, and each step jumps across the valley, like striding downhill onto the opposite slope.`\n- `{note:…}`: presenter directions.\n- `{cue}`: a sync point inside a step, one per entry of the part’s `cues(k)` (only where a part’s README asks for it; otherwise omit).\n- `{mark:ID}`, `{mark:ID|effect}`, `{mark:ID|effect|hold=seconds}`, `{mark:clear}`: placed **right before** the words about the target; at most 1–2 per step; still say the thing in words. Effects: `underline` (default; a hand-drawn underline from left to right), `circle` (a hand-drawn circle), `box` (a rounded frame), `spot` (dims everything except the area around the target with the background color), `laser` (a dot of light slides to below the target and stays briefly)\n- **R-reading** `{display|reading}` gives the reading of **one symbol or one term**: `{θ|theta}`, `{N₀|N naught}`, `{x̄|x bar}`, `{論語|ろんご}`. One symbol may carry a star, a prime, a subscript or superscript, or a hat/bar/tilde (`{Q*|Q star}`, `{x′|x prime}`, `{θ̂|theta hat}`). Write the display part in plain Unicode, not LaTeX, and never as an expression or several symbols (`{1-η|…}`, `{a*b|…}` and `{θとη|…}` are wrong: give each symbol its own reading and say the relation in words). Give a reading only to a term misread without one, and then everywhere it appears.\n- **R-formula** **Never read an equation aloud**: no LaTeX, no `\\`, `^`, `_`, and no strings such as `a + b = c` in the narration. Say what the equation means (“the number left is the starting number times a shrinking exponential”).\n- Japanese script is polite spoken Japanese (です・ます); English script is plain spoken English. About 5 Japanese characters or 2.5 English words per second; 1–3 sentences per turn.\n\n## 5. Fix requests\n\nWhen the user pastes a **fix request** (a list of findings with the ids of the standards, followed by the current files), fix exactly those findings, keep everything else, keep every `id=\"…\"` and `{#…}` unchanged (R-noids), and reply again with the two blocks (R-output). If the request contains only some slides, return only those `<section>` elements in the `deck.html` block (no `<html>`) and only their sections in the `narration.md` block; the editor puts them back in place by id.\n\n## 6. Worked example\n\nA small example, fictional, showing the structure only (do not copy its content). Note how the steps add up: the list of 2 items gives steps 1–2 and `[concl]`<!--part:m-flow-->; the `m-flow` with 4 boxes gives steps 1–4<!--/part-->. The static cover has `[0]` only. Some part sets end with an example of their own.\n\n### Common (English, default theme, marks<!--part:m-flow-->, m-flow<!--/part-->)\n\n```deck.html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>How a web page arrives</title>\n</head>\n<body>\n<div id=\"stage\">\n\n<section class=\"slide cover noconcl static\">\n <div class=\"venue\">Computing basics, lesson 1 (a fictional course)</div>\n <h1>How a web page arrives</h1>\n</section>\n\n<section class=\"slide\">\n <h2>Two programs take part</h2>\n <div class=\"body\">\n <p>Opening a page is a conversation between two programs.</p>\n <ul>\n <li id=\"browser\">The <span class=\"term\">browser</span> asks for the page and draws it</li>\n <li id=\"server\">The <span class=\"term\">server</span> keeps the page and sends it back</li>\n </ul>\n </div>\n <div class=\"concl\"><span>Every page load is a request and a reply</span></div>\n</section><!--part:m-flow-->\n\n<section class=\"slide\">\n <h2>From the address to the screen</h2>\n <div class=\"body\">\n <m-flow style=\"height:300px\" aria-label=\"Four stages: type the address, send a request, send the page back, draw the page\">\n <script type=\"application/json\">{\"nodes\": [\n {\"id\": \"a\", \"label\": \"Type the\\naddress\", \"x\": 10, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 1},\n {\"id\": \"b\", \"label\": \"Send a\\nrequest\", \"x\": 315, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 2},\n {\"id\": \"c\", \"label\": \"Send the\\npage back\", \"x\": 620, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 3, \"tone\": \"term\"},\n {\"id\": \"d\", \"label\": \"Draw the\\npage\", \"x\": 925, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 4, \"tone\": \"emph\"}\n ], \"edges\": [\n {\"from\": \"a\", \"to\": \"b\"}, {\"from\": \"b\", \"to\": \"c\"}, {\"from\": \"c\", \"to\": \"d\"}\n ]}</script>\n </m-flow>\n </div>\n <div class=\"concl\"><span>A slow page is slow in one of these four stages</span></div>\n</section><!--/part-->\n\n</div>\n</body>\n</html>\n```\n\n```narration.md\n# Narration: How a web page arrives\n\n## How a web page arrives\n[0] Today we follow a web page on its way from a server to your screen.\n\n## Two programs take part\n[0] Opening a page is a conversation between two programs.\n[1] {mark:browser}The browser is the program you look at. It asks for the page and then draws it.\n[2] {mark:server}The server is a program on another computer. It keeps the page and sends it back when asked.\n[concl] Every page load is a request and a reply.<!--part:m-flow-->\n\n## From the address to the screen\n[0] Let us put the steps in order.\n[1] First you type the address of the page.\n[2] The browser turns it into a request and sends it to the server.\n[3] The server finds the page and sends it back.\n[4] The browser draws the page on the screen.\n[concl] When a page is slow, one of these four stages is taking the time.<!--/part-->\n```",
|
|
908
917
|
"request": "# What I want\n\n*(Fill in A or B and delete the other; delete fields you leave empty.)*\n\n**A. Make a new file**\n\n- Title (used as is on the cover):\n- Audience:\n- Length (slides or minutes):\n- Language:\n- Speakers: one narrator\n- Other wishes:\n\n**B. From the material and discussion in this chat**\n\nMake the slides and script from the material given in this chat and what we have discussed so far.\n\n- Title (used as is on the cover):\n- Audience:\n- Length (slides or minutes):\n- Language:\n- Speakers: one narrator\n- Other wishes:",
|
|
909
918
|
"sets": {
|
|
910
919
|
"stats": "## Part set: stats (statistics charts)\n\nFor classes and talks with data: distributions, box plots, heatmaps, and a distribution updated one observation at a time. Use the `default` theme. Give the source and the size of every data set on the slide or in the script, and never invent data that looks real (R-components).\n\n- **Axis charts** (<!--part:m-hist-->`m-hist`, <!--/part--><!--part:m-boxplot-->`m-boxplot`, <!--/part--><!--part:m-seq-->`m-seq`, <!--/part-->and the like) reserve 86 px at the left and 80 px in all at the top and bottom for ticks and axis names: give them a height of **300–380 px** and a width of **at least 560 px** (in `<div class=\"cols\">`, give the chart column at least 55%).\n- Make the axis ranges contain every plotted value (computed as R-components says).\n\nParts of this set, in addition to those of §3:\n\n{{CATALOG}}\n\n{{EXTENSIONS}}",
|
|
@@ -978,6 +987,12 @@ export const PACK = {
|
|
|
978
987
|
"row": "| `<m-contour>` | Contours of f(x, y) by level, gradient arrows, a descent path by point | levels (all: 1) → gradient → path points | `{f?:str,label?,grid?:{nx:int,ny:int,values:any[]},range:{x:[num,num],y:[num,num]},axes?:{x?:str,y?:str},levels:num[],gradient?:{at:[num,num][],scale?:num,tangent?:bool},path?:[num,num][],monotone?:bool,equal?:bool} (f or grid)` |",
|
|
979
988
|
"entry": "### `<m-contour>`\n\nData example (child `<script type=\"application/json\">`): `{\"f\":\"x**2 + 3*y**2\",\"range\":{\"x\":[-3,3],\"y\":[-2,2]},\"levels\":[1,2,4,8],\"gradient\":{\"at\":[[1,1]]},\"path\":[[2.5,1.5],[1.5,0.3],[0.9,0.06]],\"monotone\":true}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `size` | number | `24` | text px |\n| `by` | enum | `\"level\"` | level or all |\n\n`f` (arithmetic in x, y) or a script's `grid`; `levels` (≤8), `gradient.at`, `path` from a script. Size: with `equal` and a square range, about 740 px wide for 440 px high (a panel on the right); to fill the width, widen x or set `equal: false`."
|
|
980
989
|
},
|
|
990
|
+
"m-contrast": {
|
|
991
|
+
"set": "standard",
|
|
992
|
+
"row": "| `<m-contrast>` | Positioning figure: per question, earlier vs this work's answer (unknown dashed), or assumption chips with this work's dropped and added; by step | answers: questions → earlier answers → arrows and this work (order=\"row\": per row). assumptions: studies → this work kept, dropped → added → yields. order=\"whole\": 1 | `{kind?:\"answers\"\\|\"assumptions\",heads?:[str,str,str],selfLabel?:str,rows?:{q:str,after:str,basis?:str,before:{text?:str,by?:str,unknown?:bool,near?:str}}[],studies?:{label,chips:str[],result:str}[],self?:{dropped?:str[],kept?:str[],added?:str[],result:str}}` — answers: rows [{\"q\", \"before\": {\"text\", \"by\"} or {\"unknown\": true, \"near\"}, \"after\", \"basis\"?}]. assumptions: studies [{\"label\", \"chips\", \"result\"}], self {\"kept\", \"dropped\", \"added\", \"result\"} |",
|
|
993
|
+
"entry": "### `<m-contrast>`\n\nData example (child `<script type=\"application/json\">`): `{\"kind\":\"answers\",\"rows\":[{\"q\":\"Where is the gap?\",\"before\":{\"unknown\":true,\"near\":\"Between countries [2]\"},\"after\":\"70% between schools\",\"basis\":\"3 years, all pupils\"}]}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `order` | string | `\"\"` | build (default), row (answers), whole |\n| `size` | number | `28` | text px (≥ 24) |\n\n<!--part:m-matrix-->Novelty in an answer or a view (not m-matrix). `kind` in the JSON.<!--/part-->\n\n- `answers` (default): `rows` 1–3 `{\"q\", \"before\": {\"text\", \"by\"}, \"after\", \"basis\"}`; no earlier answer: `\"before\": {\"unknown\": true, \"near\"}` (dashed, \"Unknown\")\n- `assumptions`: `studies` 1–3 `{\"label\", \"chips\", \"result\"}`; `self` `{\"kept\", \"dropped\", \"added\", \"result\"}`; dropped struck, added `--emph`, both labelled\n- This work written, framed; `selfLabel`, `heads` (3) rename\n- <!--part:m-tree-->Name the nearest work (`by`, `label`). By premise: m-tree `dash`<!--/part-->",
|
|
994
|
+
"paidOnly": true
|
|
995
|
+
},
|
|
981
996
|
"m-ctable": {
|
|
982
997
|
"set": "standard",
|
|
983
998
|
"row": "| `<m-ctable>` | ANOVA, contingency and potential-outcome tables filled by step; sources, results and a formula line; arithmetic checked | fill stages | `{kind:\"anova\"\\|\"contingency\"\\|\"po\"\\|\"table\",rows?:(object\\|str\\|any[])[],cols?:str[],n?:num[][],margins?:bool,expected?:num[][],chi2?:num,or?:num,units?:{id?:str,t:0\\|1,y0:num,y1:num}[],ate?:num,naive?:num,header?:str[],note?}` |",
|
|
@@ -987,7 +1002,7 @@ export const PACK = {
|
|
|
987
1002
|
"m-curves": {
|
|
988
1003
|
"set": "standard",
|
|
989
1004
|
"row": "| `<m-curves>` | Lines drawn one at a time on shared axes, each named at its end (no legend) | largest step (default: number of series) | `[{label?,f?:str,pts?:[num,num][],tone?,step?,labelAt?:num,color?:str,dash?:bool,xr?:[num,num],area?:any[],areaLabel?:str\\|any[],at?,anchor?:\"right\"\\|\"left\"\\|\"above\"\\|\"below\"\\|\"top\"\\|\"bottom\"\\|\"start\"\\|\"middle\"\\|\"end\",dx?:num,dy?:num,ly?:num} (f or pts),…]` — the data is the array itself, not {\"series\": […]}; axes go in attributes (xr=\"[0,10]\" xl=\"…\"); the expression field is f in x (not fn, not u) |",
|
|
990
|
-
"entry": "### `<m-curves>`\n\nData example (child `<script type=\"application/json\">`): `[{\"label\":\"Demand D\",\"f\":\"10 - x\"},{\"label\":\"Supply S\",\"f\":\"2 + x\"},{\"label\":\"Equilibrium\",\"pts\":[[4,0],[4,6]],\"dash\":true}]`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `xr` | json | `[0, 1]` | x range |\n| `yr` | json | `[0, 1]` | y range |\n| `xt` | json | `[]` | x ticks |\n| `yt` | json | `[]` | y ticks |\n| `xf` | number | | x tick decimals |\n| `yf` | number | | y tick decimals |\n| `xl` | string | `\"\"` | x title |\n| `yl` | string | `\"\"` | y title |\n| `n` | number | `300` | samples |\n| `lw` | number | `3.5` | line width |\n| `size` | number | `0` | text px (≥ 24; 0 = default) |\n\nOne comparison at a time: mean, median, quantiles; losses.\n\nSeries: a JSON array in a child script. One series = one step; same `step` = together.\n\n| Field | Meaning |\n|---|---|\n| `label` | line name |\n| `f` | expression in x (see below) |\n| `pts` | points `[[x, y], …]` |\n| `tone` | `term` `emph` `accent2` `muted` `fg` `series-1..4` |\n| `dash` | dashed |\n| `area` / `areaLabel` | shaded span `[a, b]` (several; null = edge), labels |\n| `labelAt` / `anchor` / `dx` / `dy` / `ly` | name at x = `labelAt` (default: end); `anchor` `right` `left` `above` `below`; `ly` = y |\n\n`f` is arithmetic, not code: numbers, `x`, `Math` functions/constants (`sin(x)`, `PI`; no `random`), `N(x, mean, sd)`, `+ - * / % **`, comparisons, `&& || !`, `? :`. Powers: `**`. An unreadable `f` shows a card."
|
|
1005
|
+
"entry": "### `<m-curves>`\n\nData example (child `<script type=\"application/json\">`): `[{\"label\":\"Demand D\",\"f\":\"10 - x\"},{\"label\":\"Supply S\",\"f\":\"2 + x\"},{\"label\":\"Equilibrium\",\"pts\":[[4,0],[4,6]],\"dash\":true}]`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `xr` | json | `[0, 1]` | x range |\n| `yr` | json | `[0, 1]` | y range |\n| `xt` | json | `[]` | x ticks |\n| `yt` | json | `[]` | y ticks |\n| `xf` | number | | x tick decimals |\n| `yf` | number | | y tick decimals |\n| `xl` | string | `\"\"` | x title |\n| `yl` | string | `\"\"` | y title |\n| `n` | number | `300` | samples |\n| `lw` | number | `3.5` | line width |\n| `size` | number | `0` | text px (≥ 24; 0 = default) |\n\nOne comparison at a time: mean, median, quantiles; losses.\n\nSeries: a JSON array in a child script. One series = one step; same `step` = together.\n\n| Field | Meaning |\n|---|---|\n| `label` | line name |\n| `f` | expression in x (see below) |\n| `pts` | points `[[x, y], …]` |\n| `tone` | `term` `emph` `accent2` `muted` `fg` `series-1..4` |\n| `dash` | dashed |\n| `area` / `areaLabel` | shaded span `[a, b]` (several; null = edge), labels |\n| `labelAt` / `anchor` / `dx` / `dy` / `ly` | name at x = `labelAt` (default: end); `anchor` `right` `left` `above` `below`; `ly` = y |\n\nText ticks: `xt='[\"Apr\",\"May\"]'` (x = 1, 2) or `[[0, \"FY2023\"], …]`.\n\n`f` is arithmetic, not code: numbers, `x`, `Math` functions/constants (`sin(x)`, `PI`; no `random`), `N(x, mean, sd)`, `+ - * / % **`, comparisons, `&& || !`, `? :`. Powers: `**`. An unreadable `f` shows a card."
|
|
991
1006
|
},
|
|
992
1007
|
"m-cycle": {
|
|
993
1008
|
"set": "standard",
|
|
@@ -1080,7 +1095,7 @@ export const PACK = {
|
|
|
1080
1095
|
},
|
|
1081
1096
|
"m-matrix": {
|
|
1082
1097
|
"set": "standard",
|
|
1083
|
-
"row": "| `<m-matrix>` | A positioning table: the cross of two axes (studies in cells, this work framed, empty cells — with a note) or studies × elements (✓ △ × or short text), filled by step | cross: axes → studies → this work → notes (order=\"whole\": 1
|
|
1098
|
+
"row": "| `<m-matrix>` | A positioning table: the cross of two axes (studies in cells, this work framed, empty cells — with a note) or studies × elements (✓ △ × or short text), filled by step | cross: axes (0) → studies (1) → this work (2) → notes (3, only with a none cell); order=\"whole\": 1. attributes: whole 1; col, row: columns, rows + 1 (frame) | `{kind?:\"cross\"\\|\"attributes\",rows?:object\\|any[],cols?:object\\|any[],cells?:(any[]\\|object)[][],marks?:{mark:str,text:str}[],design?:{cols:str[],rows:{label?,self?:bool,cells:str[]}[]},self?:str}` — cross: rows, cols {\"axis\", \"values\"}; cells[r][c] study names, {\"self\": true or \"finding\"} or {\"none\": \"why\"}; design {\"cols\", \"rows\"}. attributes: cols names or {\"name\", \"source\"}, rows {\"label\", \"cells\", \"self\"?} |",
|
|
1084
1099
|
"entry": "### `<m-matrix>`\n\nData example (child `<script type=\"application/json\">`): `{\"kind\":\"cross\",\"rows\":{\"axis\":\"Criterion\",\"values\":[\"Error\",\"Bayes risk\"]},\"cols\":{\"axis\":\"Output\",\"values\":[\"Point\",\"Distribution\"]},\"cells\":[[[\"[1]\",\"[2]\"],[\"[3]\"]],[{\"none\":\"Trivial\"},{\"self\":true}]]}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `order` | string | `\"\"` | cross build\\|whole; attributes whole\\|col\\|row |\n| `size` | number | `28` | text px (≥ 24) |\n\n`kind`: `cross` (default) or `attributes`.\n\n- cross: `rows`, `cols` = `{\"axis\", \"values\"}` (2–4 each). `cells[r][c]`: study names (1–3), `{\"self\": true}` or `{\"none\": \"why\"}` (— and a note). `marks`: `[{\"mark\": \"†\", \"text\"}]`\n- attributes: `cols` names; `rows` `{\"label\", \"cells\", \"self\"}`, this work first\n- This work is written out and framed in `--emph`",
|
|
1085
1100
|
"paidOnly": true
|
|
1086
1101
|
},
|
|
@@ -1137,7 +1152,7 @@ export const PACK = {
|
|
|
1137
1152
|
"m-scatter": {
|
|
1138
1153
|
"set": "standard",
|
|
1139
1154
|
"row": "| `<m-scatter>` | Scatter plot; point series by step, then a trend line (least squares or 2 points) | series + trend (default 1 series = 1 step, lines 1 step) | `{series:{label?,tone?,step?,at?,points:([num,num]\\|{x:num,y:num,label?,anchor?:\"right\"\\|\"left\"\\|\"above\"\\|\"below\"\\|\"top\"\\|\"bottom\",tone?})[]}[],trend?:str\\|{fit?:\"linear\",pts?:[[num,num],[num,num]],series?:int\\|any[],label?,tone?,dash?:bool,step?,at?,digits?:int}\\|[the same {…},…]}` — points are [x, y] or {\"x\", \"y\", \"label\"}; axes go in attributes (xr=\"[0,10]\" xl=\"…\"); trend is \"linear\" or {\"fit\": \"linear\", \"label\": \"…\"} or {\"pts\": [[x0, y0], [x1, y1]]} |",
|
|
1140
|
-
"entry": "### `<m-scatter>`\n\nData example (child `<script type=\"application/json\">`): `{\"series\":[{\"label\":\"Sunny\",\"points\":[[24,210],[28,380],[31,560],{\"x\":34,\"y\":690,\"label\":\"Heatwave\"}]}],\"trend\":\"linear\"}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `xr` | json | `null` | x range |\n| `yr` | json | `null` | y range |\n| `xt` | json | `null` | x ticks |\n| `yt` | json | `null` | y ticks |\n| `xf` | number | | x tick decimals |\n| `yf` | number | | y tick decimals |\n| `xl` | string | `\"\"` | x title |\n| `yl` | string | `\"\"` | y title |\n| `r` | number | `9` | point radius px |\n\nRelation of two quantities (heat vs sales). Points, then trend.\n\n- series: `points` (`[x, y]` or `{\"x\", \"y\", \"label\", \"anchor\", \"tone\"}`), `label` (series name, top with marker), `tone` (`term` `emph` `accent2` `muted` `fg` `series-1..4`), `step` (1 series = 1 step; same = together), `at` (start s)\n - Point `label` placed clear of overlaps (`anchor` = first try: `right` `left` `above` `below`); outliers only\n - Marker shape per series; repeats after 4, so ≤ 4 series\n- trend: `\"linear\"` (least squares on all points), or `{\"fit\": \"linear\", \"series\": 0, \"label\", \"tone\", \"dash\", \"step\", \"at\", \"digits\"}`, or `{\"pts\": [[x0, y0], [x1, y1]]}` (segment; exactly 2 points; vertical OK); several = array\n - `series`: fitted series index from 0, or array (default all)\n - `label`: `{r}` correlation, `{a}` slope, `{b}` intercept (`digits`, default 2), e.g. `\"Trend (r = {r})\"`\n - `step`: default after the last series\n - Clipped to the plot; lines outside reported. Vertical `pts`: `{a}` `{b}` empty; `{r}` only for fits\n- Axes: `xr` `yr` range, `xt` `yt` ticks, `xf` `yf` decimals, `xl` `yl` titles; range/ticks auto if omitted\n- `variant`: `fade
|
|
1155
|
+
"entry": "### `<m-scatter>`\n\nData example (child `<script type=\"application/json\">`): `{\"series\":[{\"label\":\"Sunny\",\"points\":[[24,210],[28,380],[31,560],{\"x\":34,\"y\":690,\"label\":\"Heatwave\"}]}],\"trend\":\"linear\"}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `xr` | json | `null` | x range |\n| `yr` | json | `null` | y range |\n| `xt` | json | `null` | x ticks |\n| `yt` | json | `null` | y ticks |\n| `xf` | number | | x tick decimals |\n| `yf` | number | | y tick decimals |\n| `xl` | string | `\"\"` | x title |\n| `yl` | string | `\"\"` | y title |\n| `r` | number | `9` | point radius px |\n\nRelation of two quantities (heat vs sales). Points, then trend.\n\n- series: `points` (`[x, y]` or `{\"x\", \"y\", \"label\", \"anchor\", \"tone\"}`), `label` (series name, top with marker), `tone` (`term` `emph` `accent2` `muted` `fg` `series-1..4`), `step` (1 series = 1 step; same = together), `at` (start s)\n - Point `label` placed clear of overlaps (`anchor` = first try: `right` `left` `above` `below`); outliers only\n - Marker shape per series; repeats after 4, so ≤ 4 series\n- trend: `\"linear\"` (least squares on all points), or `{\"fit\": \"linear\", \"series\": 0, \"label\", \"tone\", \"dash\", \"step\", \"at\", \"digits\"}`, or `{\"pts\": [[x0, y0], [x1, y1]]}` (segment; exactly 2 points; vertical OK); several = array\n - `series`: fitted series index from 0, or array (default all)\n - `label`: `{r}` correlation, `{a}` slope, `{b}` intercept (`digits`, default 2), e.g. `\"Trend (r = {r})\"`\n - `step`: default after the last series\n - Clipped to the plot; lines outside reported. Vertical `pts`: `{a}` `{b}` empty; `{r}` only for fits\n- Axes: `xr` `yr` range, `xt` `yt` ticks, `xf` `yf` decimals, `xl` `yl` titles; range/ticks auto if omitted\n- `variant`: `fade`, `sweep`, `grow`\n- Show later steps faintly (`ctx.preview`): later points and lines faint"
|
|
1141
1156
|
},
|
|
1142
1157
|
"m-score": {
|
|
1143
1158
|
"set": "music",
|
|
@@ -1183,8 +1198,8 @@ export const PACK = {
|
|
|
1183
1198
|
},
|
|
1184
1199
|
"m-tree": {
|
|
1185
1200
|
"set": "standard",
|
|
1186
|
-
"row": "| `<m-tree>` | Hierarchy tree (org chart, taxonomy), built level by level from the root; auto layout | depth (by=\"level\") or node count (by=\"node\"); or the largest step | `{nodes:{id:str\\|int,label?,tex?,note?,tone?,parent?:str\\|int,branch?:str,step?,at?}[],edges?:{from:str\\|int,to:str\\|int,label?,tone?,dash?:bool,step?,at?}[],path?:(str\\|int)[],pathStep?:int,pathNote?:str}` — exactly one node without parent (the root) |",
|
|
1187
|
-
"entry": "### `<m-tree>`\n\nData example (child `<script type=\"application/json\">`): `{\"nodes\":[{\"id\":\"r\",\"label\":\"Animals\"},{\"id\":\"a\",\"label\":\"Vertebrates\",\"parent\":\"r\"},{\"id\":\"b\",\"label\":\"Invertebrates\",\"parent\":\"r\"}]}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `orient` | string | `\"down\"` | down (default) or right |\n| `by` | string | `\"level\"` | level (default) or node (depth-first) |\n| `link` | string | `\"elbow\"` | elbow (default) or straight |\n| `size` | number | `0` | box text px (0 = 27, shrink to 24) |\n\nParent–child structures (org charts, taxonomies, outlines). No coordinates; laid out without overlaps.\n\n(`edges` optional).\n\n- node: `id`, `label` (`\\n`) or `tex` (KaTeX), `parent` (parent `id`; exactly one root without `parent`), `note` (small, **under** box), `tone` (`term` default, `emph`, `muted`, `accent2`, `series-1..4`), `step`, `at` (start s)\n- Children in array order; parent centred over them\n- edge: extra links (`from` `to` `label` `tone` `dash` `step`), dashed arrow outside the tree; best at same depth; step: later end\n- Child `branch`: line text (e.g. probability). `path`: root-first `id`s highlighted in turn (default 1 step per line, after the tree; `pathStep`: in one step; `pathNote`: end note)\n- `orient=\"right\"` for wide taxonomies. `by=\"node\"`: one at a time, depth-first (to follow a branch). Node `step` wins\n- Lines `--muted`, 3 px; `tone: emph` box: `--emph-tint` fill\n- Fit (~440 px high): ~8 four-character boxes per level (`down`), ~7 (`right`); ~5 levels. More leaves: 2 staggered rows (~16 / ~11), then 2-line names. Text ≥ 24 px; overflow spills, reported. Too many: split\n- `variant`: `fade
|
|
1201
|
+
"row": "| `<m-tree>` | Hierarchy tree (org chart, taxonomy), built level by level from the root; auto layout | depth (by=\"level\") or node count (by=\"node\"); or the largest step | `{nodes:{id:str\\|int,label?,tex?,note?,tone?,dash?:bool,parent?:str\\|int,branch?:str,step?,at?}[],edges?:{from:str\\|int,to:str\\|int,label?,tone?,dash?:bool,step?,at?}[],path?:(str\\|int)[],pathStep?:int,pathNote?:str}` — exactly one node without parent (the root) |",
|
|
1202
|
+
"entry": "### `<m-tree>`\n\nData example (child `<script type=\"application/json\">`): `{\"nodes\":[{\"id\":\"r\",\"label\":\"Animals\"},{\"id\":\"a\",\"label\":\"Vertebrates\",\"parent\":\"r\"},{\"id\":\"b\",\"label\":\"Invertebrates\",\"parent\":\"r\"}]}`\n\n| prop | type | default | meaning |\n|---|---|---|---|\n| `orient` | string | `\"down\"` | down (default) or right |\n| `by` | string | `\"level\"` | level (default) or node (depth-first) |\n| `link` | string | `\"elbow\"` | elbow (default) or straight |\n| `size` | number | `0` | box text px (0 = 27, shrink to 24) |\n\nParent–child structures (org charts, taxonomies, outlines). No coordinates; laid out without overlaps.\n\n(`edges` optional).\n\n- node: `id`, `label` (`\\n`) or `tex` (KaTeX), `parent` (parent `id`; exactly one root without `parent`), `note` (small, **under** box), `tone` (`term` default, `emph`, `muted`, `accent2`, `series-1..4`), `dash: true` (dashed, unfilled), `step`, `at` (start s)\n- Children in array order; parent centred over them\n- edge: extra links (`from` `to` `label` `tone` `dash` `step`), dashed arrow outside the tree; best at same depth; step: later end\n- Child `branch`: line text (e.g. probability). `path`: root-first `id`s highlighted in turn (default 1 step per line, after the tree; `pathStep`: in one step; `pathNote`: end note)\n- `orient=\"right\"` for wide taxonomies. `by=\"node\"`: one at a time, depth-first (to follow a branch). Node `step` wins\n- Lines `--muted`, 3 px; `tone: emph` box: `--emph-tint` fill\n- Fit (~440 px high): ~8 four-character boxes per level (`down`), ~7 (`right`); ~5 levels. More leaves: 2 staggered rows (~16 / ~11), then 2-line names. Text ≥ 24 px; overflow spills, reported. Too many: split\n- `variant`: `fade`, `draw`, `grow`\n- Show later steps faintly (`ctx.preview`): later parts faint\n\nPremise contrast (positioning): root the question, children the positions (this work `emph`), then premises, then what each can say; a dropped premise `dash: true`."
|
|
1188
1203
|
},
|
|
1189
1204
|
"m-vector": {
|
|
1190
1205
|
"set": "standard",
|
|
@@ -1204,7 +1219,7 @@ export const PACK = {
|
|
|
1204
1219
|
"extHead": "### `<{name}>`: extension for this part set (the part is described in §3)"
|
|
1205
1220
|
},
|
|
1206
1221
|
"ja": {
|
|
1207
|
-
"common": "# AI への指示\n\n指示のバージョン:`2a06805c`\n\n短い **Egatari のスライドと台本**を 1 つ書いてください。ステップごとに出る HTML のスライド(`deck.html`)と台本(`narration.md`)で、どちらも自動で組まれ、品質チェックを受けます。ここにないものは使えません。スライドと台本は依頼された言語で書きます(どちらも同じ言語)。規格には **R-fit** のような名前があり、修正依頼は破った規格を名前で示します。依頼は最後の **頼みたいこと**(かその前の会話)にあります。空の項目やない項目はほどよく決め、A と B が両方残っていれば書き込みのある方に従います。\n\n**よくある失敗:**\n\n- **2 つの灰色の枠(コードブロック)はどちらも最後まで書いて閉じる。**コードブロックの途中で終わらない(R-output)。構成案がなければ、スライドは短くする(5〜8 枚)。指示に構成案とその範囲があれば、その範囲のスライドをちょうどその枚数だけ書く(エディタは 1 回に 6 枚までしか依頼しないので、収まる)\n- **1280×720 のスライドの大きさ**(品質チェックが測る。R-fit):本文の場所は 1184 × 443 px(565 px まで。`noconcl` なら 1184 × 558)。字は 32 px・1 行 46 px で、入るのは**およそ 8 行**。はみ出す 46 px ごとに 1 行を削る。**図やパーツの中もテキストはすべて 24 px 以上**\n- **グラフと図:**パーツは大きさによらずテキストを 24〜28 px で描くので、決めるのはパーツの大きさ(R-fit)\n- **その場で書く `<svg>`:**字は「表示の幅 ÷ viewBox の幅」で縮むので、viewBox を表示の画素で書く(`<svg viewBox=\"0 0 560 320\" width=\"560\" height=\"320\">`)。`font-size` は 24 以上。`width:100%` と別の幅の viewBox を組み合わせない。合うパーツがあればパーツを使う\n\n## 1. 出力の形\n\n- **R-output** 出力は**ちょうど 2 つのコードブロック**にし、この順で、名前を `deck.html` と `narration.md` にする(始まりの行は ```` ```deck.html ```` と ```` ```narration.md ````)。間には何も書かない(前後に 1 行の添え書きはよい)。1 つのファイルを複数のコードブロックに分けない。ファイル・キャンバス・添付にせず、本文に書く。ほかのファイルを参照しない(画像・`{{FIG:…}}`・`{{JSON:…}}`・外の URL・`<link>` は使わない)。コードブロックの途中で終わらない(長すぎるなら枚数を減らす。ただし構成案の範囲を頼まれたら、ちょうどその枚数)\n- **R-outline** **構成案だけ**を依頼されたら(長いものを 2 回に分けて作るとき)、`outline` という名前のコードブロック 1 つ(始まりの行は ```` ```outline ````)だけで返し、`deck.html` と `narration.md` は書かない:列が「番号」「見出し」「要点(1 行)」の Markdown の表で、スライドごとに 1 行、全スライドを順に。その後の指示は範囲を示す(「構成案の 7〜12 枚目」)ので、その見出しと要点のとおりに、ちょうどそのスライドを書く\n- **R-noids** スライドの id を**書かない**。`<section class=\"slide\">` に `id` を付けず、台本の見出しにも `{#…}` を付けない。id は取り込みでエディタが付ける。id のあるスライドを渡されたとき(修正依頼)は、今ある `id=\"…\"` と `{#…}` を変えない\n\n## 2. deck.html\n\n### 2.1 骨組み\n\n```html\n<!DOCTYPE html>\n<html lang=\"ja\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>題名</title>\n</head>\n<body>\n<div id=\"stage\">\n <section class=\"slide cover noconcl static\"> … </section>\n <section class=\"slide\"> … </section>\n</div>\n</body>\n</html>\n```\n\n- `lang`:`ja`・`en` など(スライドと台本の言語)。`data-theme`:ビジネス・ピッチは `sumi`、国語は `kokugo`、ほかは `default`\n- `<script>` はパーツのデータ(§2.6)だけ。`<style>` は配置(大きさ・間隔)だけに使い、色は書かない\n\n### 2.2 スライド\n\n- 普通のスライド:`<h2>` の見出し、`<div class=\"body\">…</div>`、`<div class=\"concl\"><span>…</span></div>`(結論の行。短い 1 文)\n- 肩見出し(見出しの上の短い言葉)を添えるなら、`<h2>` の直前に `<p class=\"kicker\">` を 1 つ置く(普通のスライドだけ。`layout-tate` には置かない)。見出しには含めず、ステップ 0 で見せる。英語はテーマが大文字で表示するので、大文字で書かない。\n- 表紙:`<section class=\"slide cover noconcl static\">` に、あれば `<div class=\"venue\">…</div>`、`<h1>題名</h1>`、あれば `<div class=\"au\">…</div>`\n- 章の扉:`<section class=\"slide sec noconcl static\"><h1>章の題</h1></section>`\n- `<section>` の class:`noconcl`(結論の行なし)、`static`(ステップなし)、`nostep`(箇条書きも初めから全部)、`layout-tate`(縦書き。kokugo のセットがあるときだけ)、属性 `data-morph`(§2.5)\n- `.body` の中:`<p class=\"sub\">` 小見出し、`<div class=\"big\">` 主要な式、`<p class=\"note\">` 補足、`<div class=\"thm\">` 定理の枠、`<div class=\"cols\">` 横並び、普通の `<p>` `<ul>` `<ol>` `<table>`\n- **R-caution** `.body` に注意は `<div class=\"caution\">…</div>`、警告は `class=\"caution warn\"`。ラベルは自動で付く。\n- 字の強調(色を付ける唯一の方法):`term`(用語・問い)、`emph`(結論・問題・目標)、`muted`(既知の結果・控えめ)、`b`(太字)\n- **R-headings** スライドの見出し(表紙と扉は `h1`、ほかは `h2`)は**すべて違う**ものにする(同じなら語を追加する)。そのスライドの台本の節は `## ` に続けて**見出しとまったく同じ文字列**で始める(`<br>` などのタグは除く)\n- **R-colors** 色はテーマだけで:上の class と式のマクロ `\\hlE` `\\hlT` `\\hlM`。16 進・`rgb()`・色の名前・`\\color`・`\\textcolor` は使わない。パーツや SVG の中では:**色はテーマの CSS 変数だけ**を使う:`var(--fg)` `var(--term)` `var(--emph)` `var(--muted)` `var(--accent2)` `var(--line)`。SVG では属性ではなく `style=\"stroke:var(--emph)\"` で書く(`DECK.el` は `fill` `stroke` に `var(` があれば自動で style に回す)\n\n### 2.3 ステップ(出す順 = 話す順)\n\n- **R-steps** ステップ 0 は現れたときの姿で、文脈だけ(見出し・小見出し・導入の 1 文)。`data-step=\"k\"`(k = 1, 2, …)の要素はステップ k で現れる。材料(箇条書きの項目・式・表の行・図の部分)は話す順に出す。式とそれを導く 1 文は同じステップ(`<div data-step=\"k\">` で一緒に囲む)。1 枚のステップの数は 5 前後まで。表は、比べ方で見せ方を選ぶ。項目を 1 つずつ説明するなら行を話す順に出す。行列(縦に比べるもの、横に評価基準)や 2 本の軸の交差の表は、全体を見せてから注目する列・マスに印を付けるか、軸の列ごとに埋める。研究の位置づけの表では、本研究のマスに字で「本研究」と書く(色や太字だけで区別しない)。\n- 結論の行は自動で**最後のステップ** `concl` になる(`data-step` を付けない)\n- `data-step` が 1 つもないスライドでは、上の階層の箇条書きの項目(`.body > ul > li`・`.body > ol > li`)に 1, 2, … が自動で付く。1 つでもあれば自動にならないので、出すものすべてに付ける\n- パーツは自分のステップを追加する(§3)。`data-from`(既定 1)から始まる\n- つまりステップは `0 … max` と、結論の行があれば `concl`。`static` のスライドはステップ 0 だけ\n\n### 2.4 数式(KaTeX)\n\n- **R-math** 行内は `\\( … \\)`、別行は `\\[ … \\]`。式の中の `<` は `\\lt`、`>` は `\\gt`。標準のほかに使えるマクロ:`\\hlE{…}`(emph)`\\hlT{…}`(term)`\\hlM{…}`(muted)、`\\htmlId{ID}{…}`、`\\htmlData{mark=ID}{…}`、`\\htmlClass{…}{…}`、`\\morph{ID}{…}`。`\\newcommand` と `\\color` は使わない。項の説明は `\\underbrace{…}_{\\text{…}}`・`\\overbrace{…}^{…}`。`$$` は使わない。記号は最初に使う所で定義する(`\\(\\mu\\)`:母平均)\n\n### 2.5 強調とモーフ\n\n- **R-marks** 台本の `{mark:ID}`(§4)は、**同じスライド**の目印に印を付ける。目印:スライドの中の `id=\"ID\"` か `data-mark=\"ID\"` の要素。式の一部は KaTeX の `\\htmlId{ID}{…}` / `\\htmlData{mark=ID}{…}`(build はこの 2 つと `\\htmlClass` だけを許す)。同じ ID を何枚かで使うなら `data-mark` にする(id は文書の中で一意に)\n- モーフ(なくてよい):`<section class=\"slide\" data-morph>` は前のスライドの要素を今の位置へ滑らせる。両方のスライドの要素に同じ `data-id=\"…\"`、式の一部は両方に `\\morph{ID}{…}`。ステップ 0 で見えている要素だけが動く\n\n### 2.6 パーツ\n\n- **R-components** パーツは一覧(§3)の Web Components `<m-…>` で、`.body` の中に置く。どれにも高さ(`style=\"height:380px\"`)と `aria-label` を付ける。データは子の `<script type=\"application/json\">…</script>` **1 つ**にその場で書く。**図の数字は正しく**(計算する。見た目のために値を作らない。架空の数字は架空と書く)。関数の式は算術の式だけで、コードとしては実行されない(`Math.exp(x)`・`x**2`)。動きが説明になる所だけに使う(たいていのスライドには要らない)\n\n### 2.7 表し方を選ぶ\n\n- **R-purpose** 表し方は習慣でなく、そのスライドで言いたいことから選ぶ。作者がグラフの種類を言っていればそれに従う。表は全パーツの一覧を兼ねる。使うのは渡された文章にあるパーツだけ(§3 と、入っているセット)。入っていないパーツの方が合うときは、1 行のメモでそう伝える\n\n{{PURPOSES}}\n\n- **R-whole** 箇条書き・数字のカード・円グラフは全体を一度に見せる。台本が 1 つずつ取り上げるときだけ 1 行ずつ出す(箇条書きなら全体に 1 つの `data-step` を付けるか、スライドに `nostep`)\n\n### 2.8 スライドに収める(品質チェックのエラー)\n\n- **R-title** 見出し:日本語は 26 字まで(全角 1・半角 0.5)、英語は 60 文字まで。コロンで終えない\n- **R-concl** 結論の行:日本語は 35 字まで、英語は 70 文字まで。1 行\n- **R-fit** 本文は 565 px(`noconcl` なら 680 px)より上で終える:1 枚におよそ 8 行・100 字・英語 60 語、または `big` の式 1 つと短い箇条書き 3 つ、または高さ 380 px までのパーツと短い 1 行(2 行なら 330 px まで)。入らなければスライドを分ける。字を縮めず、字の大きさを書かない\n- **R-style** 日本語のスライドは常体(だ・である、体言止め)で、です・ます を使わない。句読点はファイル全体で 1 つの組(`、。` か `,.`)。英語のスライドは短い句で\n\n## 3. パーツの一覧\n\nどのファイルでも使える標準のパーツ。§6 の後にセットの指示があれば、その種類の材料のパーツが追加される。「steps」はパーツが使うスライドのステップの数(`data-from` から。既定 1)。秒で測る属性(動きの長さ・ずれ)は載せない(既定で台本に合う)。型が json の属性は、値に JSON を書く(`values=\"[0.1,0.5]\"`)。「データの形」の `?` は省略できる欄。型を書いていない label・tex・note・tone は str、step は int、at は num。名前やラベルの `*…*` は斜体、`_` `^` は次の 1 字だけ下付き・上付き。記号のまま出すなら全角の _ ^ *。\n\n{{CATALOG}}\n\n## 4. narration.md\n\n```markdown\n# 台本:<題名>\n\n## 減衰の式\n[0] 減衰の式です。時刻ごとに残っている原子の数を考えます。\n[1] 残る数は、はじめの数に、時間とともに小さくなる指数関数を掛けたものです。\n[2] {mark:n0|circle}{N₀|エヌゼロ} は、時刻ゼロのときの、はじめの数です。\n[concl] 半分になるまでの時間は、崩壊定数だけで決まります。\n```\n\n- スライドごとに 1 つの節を、**スライドの順に、すべてのスライド(表紙も)について**:`## <スライドの見出し>`(R-headings)。`{#id}` は付けない(R-noids)\n- **R-narr-steps** ステップの指定は `[0]` `[1]` … と `[concl]`。**どのスライドのどのステップにも台本を書き**(ステップ 0 から max まで、結論の行があれば `[concl]`)、**ないステップの指定は書かない**(`static` の表紙は `[0]` だけ。結論の行がなければ `[concl]` もない。`[01]` とは書かない)。ステップの中では、そのステップで現れるものだけを話す\n- **R-dialogue** **既定は話者 1 人**で、話者名を書かない。掛け合いは依頼されたときだけ(3 人以上を依頼されても 2 役にし、最初にそう書く):行を `Expert:` か `Novice:` で始め(続きの行は字下げ。話者なしは Expert)、認知的徒弟制の形にする:\n - Novice は相づち役にせず、学習者の疑問を代弁するか、「つまり〜ということですか」と言い換える\n - Expert は答えて具体例か比喩を 1 つ追加するか、言い換えを確認して(違えば修正して)1 歩進める\n - 理解の分かれ目(誤解しやすい所、「なぜ」が残る所)にだけ、1 枚に 1 回・2〜3 発言まで。ほかは Expert 1 人\n - 「なるほど」だけの発言、前の発言のくり返しは書かない。例:`Novice: つまり、大きいほど早く着くのですか。` `Expert: いつもではありません。大きすぎると谷を飛び越えます。大股で坂を下りすぎて、向こうの斜面に足が着くように。`\n- `{note:…}` 発表者用\n- `{cue}`:ステップの中の同期点。パーツの `cues(k)` の 1 つに 1 つ(パーツの説明が求めるときだけ)\n- `{mark:ID}`・`{mark:ID|効果}`・`{mark:ID|効果|hold=秒}`・`{mark:clear}`:目印のことを言う言葉の**すぐ前**に置く。1 ステップに 1〜2 個まで。言葉でも言う。効果:`underline`(既定。手描きの下線を左から右へ)、`circle`(手描きの囲み)、`box`(角丸の枠)、`spot`(対象のまわり以外を背景色で薄くする)、`laser`(光の点が対象の下へ滑ってきて少し留まる)\n- **R-reading** `{表示|読み}` は **1 つの記号か 1 つの用語**の読み:`{θ|シータ}`、`{N₀|エヌゼロ}`、`{論語|ろんご}`。1 つの記号に星・プライム・添え字・ハットやバーが付いていてもよい(`{Q*|キュースター}`、`{θ̂|シータハット}`)。表示は普通の文字で書き、LaTeX にせず、式やいくつもの記号にしない(`{1-η|…}`・`{θとη|…}` は誤り:記号ごとに読みを付け、関係は言葉で言う)。読みは読みなしで読み違える語にだけ付ける(かなの読みは抑揚を崩しやすい)。読みは書いた所にだけ当たるので、付けた語がまた出てくるなら、出てくる所ごとに付ける\n- **R-formula** **式を読み上げない**:台本に LaTeX・`\\`・`^`・`_`・`a + b = c` のような文字列を書かない。式の意味を言葉で言う(§4 の例の [1])\n- 日本語の台本は話し言葉の です・ます。英語は話し言葉の英語。目安は 1 秒に日本語 5 字・英語 2.5 語。1 回の発言は 1〜3 文\n\n## 5. 修正依頼\n\n利用者が**修正依頼**(規格の名前の付いた指摘の一覧と、今のファイル)を貼り付けたら、その指摘だけを修正し、ほかは変えず、`id=\"…\"` と `{#…}` をすべて変えず(R-noids)、また 2 つのコードブロックで返す(R-output)。依頼に一部のスライドしかなければ、そのスライドの `<section>` だけ(`<html>` なし)とその節だけを 2 つのコードブロックで返す(エディタが id で元の場所に戻す)。\n\n## 6. 例\n\n小さな例(架空。形を見るためで、中身はコピーしない)。ステップの数え方:2 項目の箇条書きはステップ 1〜2 と `[concl]`<!--part:m-flow-->、箱が 4 つの `m-flow` はステップ 1〜4<!--/part-->。いくつかのセットの指示の最後にも例がある。\n\n### 共通(英語・default テーマ・強調<!--part:m-flow-->・m-flow<!--/part-->)\n\n```deck.html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>How a web page arrives</title>\n</head>\n<body>\n<div id=\"stage\">\n\n<section class=\"slide cover noconcl static\">\n <div class=\"venue\">Computing basics, lesson 1 (a fictional course)</div>\n <h1>How a web page arrives</h1>\n</section>\n\n<section class=\"slide\">\n <h2>Two programs take part</h2>\n <div class=\"body\">\n <p>Opening a page is a conversation between two programs.</p>\n <ul>\n <li id=\"browser\">The <span class=\"term\">browser</span> asks for the page and draws it</li>\n <li id=\"server\">The <span class=\"term\">server</span> keeps the page and sends it back</li>\n </ul>\n </div>\n <div class=\"concl\"><span>Every page load is a request and a reply</span></div>\n</section><!--part:m-flow-->\n\n<section class=\"slide\">\n <h2>From the address to the screen</h2>\n <div class=\"body\">\n <m-flow style=\"height:300px\" aria-label=\"Four stages: type the address, send a request, send the page back, draw the page\">\n <script type=\"application/json\">{\"nodes\": [\n {\"id\": \"a\", \"label\": \"Type the\\naddress\", \"x\": 10, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 1},\n {\"id\": \"b\", \"label\": \"Send a\\nrequest\", \"x\": 315, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 2},\n {\"id\": \"c\", \"label\": \"Send the\\npage back\", \"x\": 620, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 3, \"tone\": \"term\"},\n {\"id\": \"d\", \"label\": \"Draw the\\npage\", \"x\": 925, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 4, \"tone\": \"emph\"}\n ], \"edges\": [\n {\"from\": \"a\", \"to\": \"b\"}, {\"from\": \"b\", \"to\": \"c\"}, {\"from\": \"c\", \"to\": \"d\"}\n ]}</script>\n </m-flow>\n </div>\n <div class=\"concl\"><span>A slow page is slow in one of these four stages</span></div>\n</section><!--/part-->\n\n</div>\n</body>\n</html>\n```\n\n```narration.md\n# Narration: How a web page arrives\n\n## How a web page arrives\n[0] Today we follow a web page on its way from a server to your screen.\n\n## Two programs take part\n[0] Opening a page is a conversation between two programs.\n[1] {mark:browser}The browser is the program you look at. It asks for the page and then draws it.\n[2] {mark:server}The server is a program on another computer. It keeps the page and sends it back when asked.\n[concl] Every page load is a request and a reply.<!--part:m-flow-->\n\n## From the address to the screen\n[0] Let us put the steps in order.\n[1] First you type the address of the page.\n[2] The browser turns it into a request and sends it to the server.\n[3] The server finds the page and sends it back.\n[4] The browser draws the page on the screen.\n[concl] When a page is slow, one of these four stages is taking the time.<!--/part-->\n```",
|
|
1222
|
+
"common": "# AI への指示\n\n指示のバージョン:`027f5293`\n\n短い **Egatari のスライドと台本**を 1 つ書いてください。ステップごとに出る HTML のスライド(`deck.html`)と台本(`narration.md`)で、どちらも自動で組まれ、品質チェックを受けます。ここにないものは使えません。スライドと台本は依頼された言語で書きます(どちらも同じ言語)。規格には **R-fit** のような名前があり、修正依頼は破った規格を名前で示します。依頼は最後の **頼みたいこと**(かその前の会話)にあります。空の項目やない項目はほどよく決め、A と B が両方残っていれば書き込みのある方に従います。\n\n**よくある失敗:**\n\n- **2 つの灰色の枠(コードブロック)はどちらも最後まで書いて閉じる。**コードブロックの途中で終わらない(R-output)。構成案がなければ、スライドは短くする(5〜8 枚)。指示に構成案とその範囲があれば、その範囲のスライドをちょうどその枚数だけ書く(エディタは 1 回に 6 枚までしか依頼しないので、収まる)\n- **1280×720 のスライドの大きさ**(品質チェックが測る。R-fit):本文の場所は 1184 × 443 px(565 px まで。`noconcl` なら 1184 × 558)。字は 32 px・1 行 46 px で、入るのは**およそ 8 行**。はみ出す 46 px ごとに 1 行を削る。**図やパーツの中もテキストはすべて 24 px 以上**\n- **グラフと図:**パーツは大きさによらずテキストを 24〜28 px で描くので、決めるのはパーツの大きさ(R-fit)\n- **その場で書く `<svg>`:**字は「表示の幅 ÷ viewBox の幅」で縮むので、viewBox を表示の画素で書く(`<svg viewBox=\"0 0 560 320\" width=\"560\" height=\"320\">`)。`font-size` は 24 以上。`width:100%` と別の幅の viewBox を組み合わせない。合うパーツがあればパーツを使う\n\n## 1. 出力の形\n\n- **R-output** 出力は**ちょうど 2 つのコードブロック**にし、この順で、名前を `deck.html` と `narration.md` にする(始まりの行は ```` ```deck.html ```` と ```` ```narration.md ````)。間には何も書かない(前後に 1 行の添え書きはよい)。1 つのファイルを複数のコードブロックに分けない。ファイル・キャンバス・添付にせず、本文に書く。ほかのファイルを参照しない(画像・`{{FIG:…}}`・`{{JSON:…}}`・外の URL・`<link>` は使わない)。コードブロックの途中で終わらない(長すぎるなら枚数を減らす。ただし構成案の範囲を頼まれたら、ちょうどその枚数)\n- **R-outline** **構成案だけ**を依頼されたら(長いものを 2 回に分けて作るとき)、`outline` という名前のコードブロック 1 つ(始まりの行は ```` ```outline ````)だけで返し、`deck.html` と `narration.md` は書かない:列が「番号」「見出し」「要点(1 行)」の Markdown の表で、スライドごとに 1 行、全スライドを順に。その後の指示は範囲を示す(「構成案の 7〜12 枚目」)ので、その見出しと要点のとおりに、ちょうどそのスライドを書く\n- **R-noids** スライドの id を**書かない**。`<section class=\"slide\">` に `id` を付けず、台本の見出しにも `{#…}` を付けない。id は取り込みでエディタが付ける。id のあるスライドを渡されたとき(修正依頼)は、今ある `id=\"…\"` と `{#…}` を変えない\n\n## 2. deck.html\n\n### 2.1 骨組み\n\n```html\n<!DOCTYPE html>\n<html lang=\"ja\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>題名</title>\n</head>\n<body>\n<div id=\"stage\">\n <section class=\"slide cover noconcl static\"> … </section>\n <section class=\"slide\"> … </section>\n</div>\n</body>\n</html>\n```\n\n- `lang`:`ja`・`en` など(スライドと台本の言語)。`data-theme`:ビジネス・ピッチは `sumi`、国語は `kokugo`、ほかは `default`\n- `<script>` はパーツのデータ(§2.6)だけ。`<style>` は配置(大きさ・間隔)だけに使い、色は書かない\n\n### 2.2 スライド\n\n- 普通のスライド:`<h2>` の見出し、`<div class=\"body\">…</div>`、`<div class=\"concl\"><span>…</span></div>`(結論の行。短い 1 文)\n- 数字・図・引用を使ったスライドには、結論の行の上に出典の行(`<p class=\"source\">出典:…</p>`)を書く\n- 肩見出し(見出しの上の短い言葉)を添えるなら、`<h2>` の直前に `<p class=\"kicker\">` を 1 つ置く(普通のスライドだけ。`layout-tate` には置かない)。見出しには含めず、ステップ 0 で見せる。英語はテーマが大文字で表示するので、大文字で書かない。\n- 表紙:`<section class=\"slide cover noconcl static\">` に、あれば `<div class=\"venue\">…</div>`、`<h1>題名</h1>`、あれば `<div class=\"au\">…</div>`\n- 章の扉:`<section class=\"slide sec noconcl static\"><h1>章の題</h1></section>`\n- `<section>` の class:`noconcl`(結論の行なし)、`static`(ステップなし)、`nostep`(箇条書きも初めから全部)、`layout-tate`(縦書き。kokugo のセットがあるときだけ)、属性 `data-morph`(§2.5)\n- `.body` の中:`<p class=\"sub\">` 小見出し、`<div class=\"big\">` 主要な式、`<p class=\"note\">` 補足、`<div class=\"thm\">` 定理の枠、`<div class=\"cols\">` 横並び、普通の `<p>` `<ul>` `<ol>` `<table>`\n- **R-caution** `.body` に注意は `<div class=\"caution\">…</div>`、警告は `class=\"caution warn\"`。ラベルは自動で付く。\n- 字の強調(色を付ける唯一の方法):`term`(用語・問い)、`emph`(結論・問題・目標)、`muted`(既知の結果・控えめ)、`b`(太字)\n- **R-headings** スライドの見出し(表紙と扉は `h1`、ほかは `h2`)は**すべて違う**ものにする(同じなら語を追加する)。そのスライドの台本の節は `## ` に続けて**見出しとまったく同じ文字列**で始める(`<br>` などのタグは除く)\n- **R-colors** 色はテーマだけで:上の class と式のマクロ `\\hlE` `\\hlT` `\\hlM`。16 進・`rgb()`・色の名前・`\\color`・`\\textcolor` は使わない。パーツや SVG の中では:**色はテーマの CSS 変数だけ**を使う:`var(--fg)` `var(--term)` `var(--emph)` `var(--muted)` `var(--accent2)` `var(--line)`。SVG では属性ではなく `style=\"stroke:var(--emph)\"` で書く(`DECK.el` は `fill` `stroke` に `var(` があれば自動で style に回す)\n\n### 2.3 ステップ(出す順 = 話す順)\n\n- **R-steps** ステップ 0 は現れたときの姿で、文脈だけ(見出し・小見出し・導入の 1 文)。`data-step=\"k\"`(k = 1, 2, …)の要素はステップ k で現れる。材料(箇条書きの項目・式・表の行・図の部分)は話す順に出す。式とそれを導く 1 文は同じステップ(`<div data-step=\"k\">` で一緒に囲む)。1 枚のステップの数は 5 前後まで。表は、比べ方で見せ方を選ぶ。項目を 1 つずつ説明するなら行を話す順に出す。行列(縦に比べるもの、横に評価基準)や 2 本の軸の交差の表は、全体を見せてから注目する列・マスに印を付けるか、軸の列ごとに埋める。研究の位置づけの表では、本研究のマスに字で「本研究」と書く(色や太字だけで区別しない)。\n- 結論の行は自動で**最後のステップ** `concl` になる(`data-step` を付けない)\n- `data-step` が 1 つもないスライドでは、上の階層の箇条書きの項目(`.body > ul > li`・`.body > ol > li`)に 1, 2, … が自動で付く。1 つでもあれば自動にならないので、出すものすべてに付ける\n- パーツは自分のステップを追加する(§3)。`data-from`(既定 1)から始まる\n- つまりステップは `0 … max` と、結論の行があれば `concl`。`static` のスライドはステップ 0 だけ\n\n### 2.4 数式(KaTeX)\n\n- **R-math** 行内は `\\( … \\)`、別行は `\\[ … \\]`。式の中の `<` は `\\lt`、`>` は `\\gt`。標準のほかに使えるマクロ:`\\hlE{…}`(emph)`\\hlT{…}`(term)`\\hlM{…}`(muted)、`\\htmlId{ID}{…}`、`\\htmlData{mark=ID}{…}`、`\\htmlClass{…}{…}`、`\\morph{ID}{…}`。`\\newcommand` と `\\color` は使わない。項の説明は `\\underbrace{…}_{\\text{…}}`・`\\overbrace{…}^{…}`。`$$` は使わない。記号は最初に使う所で定義する(`\\(\\mu\\)`:母平均)\n\n### 2.5 強調とモーフ\n\n- **R-marks** 台本の `{mark:ID}`(§4)は、**同じスライド**の目印に印を付ける。目印:スライドの中の `id=\"ID\"` か `data-mark=\"ID\"` の要素。式の一部は KaTeX の `\\htmlId{ID}{…}` / `\\htmlData{mark=ID}{…}`(build はこの 2 つと `\\htmlClass` だけを許す)。同じ ID を何枚かで使うなら `data-mark` にする(id は文書の中で一意に)\n- モーフ(なくてよい):`<section class=\"slide\" data-morph>` は前のスライドの要素を今の位置へ滑らせる。両方のスライドの要素に同じ `data-id=\"…\"`、式の一部は両方に `\\morph{ID}{…}`。ステップ 0 で見えている要素だけが動く\n\n### 2.6 パーツ\n\n- **R-components** パーツは一覧(§3)の Web Components `<m-…>` で、`.body` の中に置く。どれにも高さ(`style=\"height:380px\"`)と `aria-label` を付ける。データは子の `<script type=\"application/json\">…</script>` **1 つ**にその場で書く。**図の数字は正しく**(計算する。見た目のために値を作らない。架空の数字は架空と書く)。関数の式は算術の式だけで、コードとしては実行されない(`Math.exp(x)`・`x**2`)。動きが説明になる所だけに使う(たいていのスライドには要らない)\n<!--paid-->- 写真が要る所は、図の枠(テンプレートの「図」)と内容の説明を書き、画像は作成者が後で入れる<!--/paid-->\n\n### 2.7 表し方を選ぶ\n\n- **R-purpose** 表し方は習慣でなく、そのスライドで言いたいことから選ぶ。作者がグラフの種類を言っていればそれに従う。表は全パーツの一覧を兼ねる。使うのは渡された文章にあるパーツだけ(§3 と、入っているセット)。入っていないパーツの方が合うときは、1 行のメモでそう伝える\n\n{{PURPOSES}}\n\n- **R-whole** 箇条書き・数字のカード・円グラフは全体を一度に見せる。台本が 1 つずつ取り上げるときだけ 1 行ずつ出す(箇条書きなら全体に 1 つの `data-step` を付けるか、スライドに `nostep`)\n\n### 2.8 スライドに収める(品質チェックのエラー)\n\n- **R-title** 見出し:日本語は 26 字まで(全角 1・半角 0.5)、英語は 60 文字まで。コロンで終えない\n- **R-concl** 結論の行:日本語は 35 字まで、英語は 70 文字まで。1 行\n- **R-fit** 本文は 565 px(`noconcl` なら 680 px)より上で終える:1 枚におよそ 8 行・100 字・英語 60 語、または `big` の式 1 つと短い箇条書き 3 つ、または高さ 380 px までのパーツと短い 1 行(2 行なら 330 px まで)。入らなければスライドを分ける。字を縮めず、字の大きさを書かない\n- **R-style** 日本語のスライドは常体(だ・である、体言止め)で、です・ます を使わない。句読点はファイル全体で 1 つの組(`、。` か `,.`)。英語のスライドは短い句で\n\n## 3. パーツの一覧\n\nどのファイルでも使える標準のパーツ。§6 の後にセットの指示があれば、その種類の材料のパーツが追加される。「steps」はパーツが使うスライドのステップの数(`data-from` から。既定 1)。秒で測る属性(動きの長さ・ずれ)は載せない(既定で台本に合う)。型が json の属性は、値に JSON を書く(`values=\"[0.1,0.5]\"`)。「データの形」の `?` は省略できる欄。型を書いていない label・tex・note・tone は str、step は int、at は num。名前やラベルの `*…*` は斜体、`_` `^` は次の 1 字だけ下付き・上付き。記号のまま出すなら全角の _ ^ *。\n\n{{CATALOG}}\n\n## 4. narration.md\n\n```markdown\n# 台本:<題名>\n\n## 減衰の式\n[0] 減衰の式です。時刻ごとに残っている原子の数を考えます。\n[1] 残る数は、はじめの数に、時間とともに小さくなる指数関数を掛けたものです。\n[2] {mark:n0|circle}{N₀|エヌゼロ} は、時刻ゼロのときの、はじめの数です。\n[concl] 半分になるまでの時間は、崩壊定数だけで決まります。\n```\n\n- スライドごとに 1 つの節を、**スライドの順に、すべてのスライド(表紙も)について**:`## <スライドの見出し>`(R-headings)。`{#id}` は付けない(R-noids)\n- **R-narr-steps** ステップの指定は `[0]` `[1]` … と `[concl]`。**どのスライドのどのステップにも台本を書き**(ステップ 0 から max まで、結論の行があれば `[concl]`)、**ないステップの指定は書かない**(`static` の表紙は `[0]` だけ。結論の行がなければ `[concl]` もない。`[01]` とは書かない)。ステップの中では、そのステップで現れるものだけを話す\n- **R-dialogue** **既定は話者 1 人**で、話者名を書かない。掛け合いは依頼されたときだけ(3 人以上を依頼されても 2 役にし、最初にそう書く):行を `Expert:` か `Novice:` で始め(続きの行は字下げ。話者なしは Expert)、認知的徒弟制の形にする:\n - Novice は相づち役にせず、学習者の疑問を代弁するか、「つまり〜ということですか」と言い換える\n - Expert は答えて具体例か比喩を 1 つ追加するか、言い換えを確認して(違えば修正して)1 歩進める\n - 理解の分かれ目(誤解しやすい所、「なぜ」が残る所)にだけ、1 枚に 1 回・2〜3 発言まで。ほかは Expert 1 人\n - 「なるほど」だけの発言、前の発言のくり返しは書かない。例:`Novice: つまり、大きいほど早く着くのですか。` `Expert: いつもではありません。大きすぎると谷を飛び越えます。大股で坂を下りすぎて、向こうの斜面に足が着くように。`\n- `{note:…}` 発表者用\n- `{cue}`:ステップの中の同期点。パーツの `cues(k)` の 1 つに 1 つ(パーツの説明が求めるときだけ)\n- `{mark:ID}`・`{mark:ID|効果}`・`{mark:ID|効果|hold=秒}`・`{mark:clear}`:目印のことを言う言葉の**すぐ前**に置く。1 ステップに 1〜2 個まで。言葉でも言う。効果:`underline`(既定。手描きの下線を左から右へ)、`circle`(手描きの囲み)、`box`(角丸の枠)、`spot`(対象のまわり以外を背景色で薄くする)、`laser`(光の点が対象の下へ滑ってきて少し留まる)\n- **R-reading** `{表示|読み}` は **1 つの記号か 1 つの用語**の読み:`{θ|シータ}`、`{N₀|エヌゼロ}`、`{論語|ろんご}`。1 つの記号に星・プライム・添え字・ハットやバーが付いていてもよい(`{Q*|キュースター}`、`{θ̂|シータハット}`)。表示は普通の文字で書き、LaTeX にせず、式やいくつもの記号にしない(`{1-η|…}`・`{θとη|…}` は誤り:記号ごとに読みを付け、関係は言葉で言う)。読みは読みなしで読み違える語にだけ付ける(かなの読みは抑揚を崩しやすい)。読みは書いた所にだけ当たるので、付けた語がまた出てくるなら、出てくる所ごとに付ける\n- **R-formula** **式を読み上げない**:台本に LaTeX・`\\`・`^`・`_`・`a + b = c` のような文字列を書かない。式の意味を言葉で言う(§4 の例の [1])\n- 日本語の台本は話し言葉の です・ます。英語は話し言葉の英語。目安は 1 秒に日本語 5 字・英語 2.5 語。1 回の発言は 1〜3 文\n\n## 5. 修正依頼\n\n利用者が**修正依頼**(規格の名前の付いた指摘の一覧と、今のファイル)を貼り付けたら、その指摘だけを修正し、ほかは変えず、`id=\"…\"` と `{#…}` をすべて変えず(R-noids)、また 2 つのコードブロックで返す(R-output)。依頼に一部のスライドしかなければ、そのスライドの `<section>` だけ(`<html>` なし)とその節だけを 2 つのコードブロックで返す(エディタが id で元の場所に戻す)。\n\n## 6. 例\n\n小さな例(架空。形を見るためで、中身はコピーしない)。ステップの数え方:2 項目の箇条書きはステップ 1〜2 と `[concl]`<!--part:m-flow-->、箱が 4 つの `m-flow` はステップ 1〜4<!--/part-->。いくつかのセットの指示の最後にも例がある。\n\n### 共通(英語・default テーマ・強調<!--part:m-flow-->・m-flow<!--/part-->)\n\n```deck.html\n<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"default\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>How a web page arrives</title>\n</head>\n<body>\n<div id=\"stage\">\n\n<section class=\"slide cover noconcl static\">\n <div class=\"venue\">Computing basics, lesson 1 (a fictional course)</div>\n <h1>How a web page arrives</h1>\n</section>\n\n<section class=\"slide\">\n <h2>Two programs take part</h2>\n <div class=\"body\">\n <p>Opening a page is a conversation between two programs.</p>\n <ul>\n <li id=\"browser\">The <span class=\"term\">browser</span> asks for the page and draws it</li>\n <li id=\"server\">The <span class=\"term\">server</span> keeps the page and sends it back</li>\n </ul>\n </div>\n <div class=\"concl\"><span>Every page load is a request and a reply</span></div>\n</section><!--part:m-flow-->\n\n<section class=\"slide\">\n <h2>From the address to the screen</h2>\n <div class=\"body\">\n <m-flow style=\"height:300px\" aria-label=\"Four stages: type the address, send a request, send the page back, draw the page\">\n <script type=\"application/json\">{\"nodes\": [\n {\"id\": \"a\", \"label\": \"Type the\\naddress\", \"x\": 10, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 1},\n {\"id\": \"b\", \"label\": \"Send a\\nrequest\", \"x\": 315, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 2},\n {\"id\": \"c\", \"label\": \"Send the\\npage back\", \"x\": 620, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 3, \"tone\": \"term\"},\n {\"id\": \"d\", \"label\": \"Draw the\\npage\", \"x\": 925, \"y\": 100, \"w\": 250, \"h\": 110, \"step\": 4, \"tone\": \"emph\"}\n ], \"edges\": [\n {\"from\": \"a\", \"to\": \"b\"}, {\"from\": \"b\", \"to\": \"c\"}, {\"from\": \"c\", \"to\": \"d\"}\n ]}</script>\n </m-flow>\n </div>\n <div class=\"concl\"><span>A slow page is slow in one of these four stages</span></div>\n</section><!--/part-->\n\n</div>\n</body>\n</html>\n```\n\n```narration.md\n# Narration: How a web page arrives\n\n## How a web page arrives\n[0] Today we follow a web page on its way from a server to your screen.\n\n## Two programs take part\n[0] Opening a page is a conversation between two programs.\n[1] {mark:browser}The browser is the program you look at. It asks for the page and then draws it.\n[2] {mark:server}The server is a program on another computer. It keeps the page and sends it back when asked.\n[concl] Every page load is a request and a reply.<!--part:m-flow-->\n\n## From the address to the screen\n[0] Let us put the steps in order.\n[1] First you type the address of the page.\n[2] The browser turns it into a request and sends it to the server.\n[3] The server finds the page and sends it back.\n[4] The browser draws the page on the screen.\n[concl] When a page is slow, one of these four stages is taking the time.<!--/part-->\n```",
|
|
1208
1223
|
"request": "# 頼みたいこと\n\n*(A か B を埋め、もう一方は削除します。書かない項目は削除してかまいません)*\n\n**A. 新しく作る**\n\n- タイトル(表紙にそのまま使う):\n- 対象(だれ向け):\n- 長さ(枚数か分):\n- 言語:\n- 話者:1 人\n- そのほかの希望:\n\n**B. 渡した資料と話し合いの内容で作る**\n\nこのチャットで渡した資料と、ここまでの話し合いの内容で、スライドと台本を作ってください。\n\n- タイトル(表紙にそのまま使う):\n- 対象(だれ向け):\n- 長さ(枚数か分):\n- 言語:\n- 話者:1 人\n- そのほかの希望:",
|
|
1209
1224
|
"sets": {
|
|
1210
1225
|
"stats": "## パーツのセット:stats(統計の図)\n\nデータを見せる授業・発表向け。分布、箱ひげ図、ヒートマップ、観測が 1 つずつ加わって変わる分布を見せる。テーマは `default`。データの出どころと数(何人・何件)をスライドか台本に書き、本物らしく見えるデータを作らない(R-components)。\n\n- **軸のある図**(<!--part:m-hist-->`m-hist`・<!--/part--><!--part:m-boxplot-->`m-boxplot`・<!--/part--><!--part:m-seq-->`m-seq`・<!--/part-->など)は目盛りと軸の名前に左 86 px、上下合わせて 80 px を使うので、高さ **300〜380 px**、幅 **560 px 以上**にする(`<div class=\"cols\">` なら図の列を 55% 以上に)\n- 軸の範囲には、図の値(R-components のとおり計算したもの)がすべて入るようにする\n\nこのセットのパーツ(§3 のパーツに加えて):\n\n{{CATALOG}}\n\n{{EXTENSIONS}}",
|
|
@@ -1278,6 +1293,12 @@ export const PACK = {
|
|
|
1278
1293
|
"row": "| `<m-contour>` | 2 変数の関数の等高線を値ごとに引き、勾配の矢印と、勾配降下法などの反復の道を 1 点ずつ見せる | 等高線の値ごと(by=\"all\" なら 1)→ 勾配 → 道の点ごと | `{f?:str,label?,grid?:{nx:int,ny:int,values:any[]},range:{x:[num,num],y:[num,num]},axes?:{x?:str,y?:str},levels:num[],gradient?:{at:[num,num][],scale?:num,tangent?:bool},path?:[num,num][],monotone?:bool,equal?:bool} (f or grid)` |",
|
|
1279
1294
|
"entry": "### `<m-contour>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"f\":\"x**2 + 3*y**2\",\"range\":{\"x\":[-3,3],\"y\":[-2,2]},\"levels\":[1,2,4,8],\"gradient\":{\"at\":[[1,1]]},\"path\":[[2.5,1.5],[1.5,0.3],[0.9,0.06]],\"monotone\":true}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `size` | number | `24` | 字の大きさ(px、24 以上) |\n| `by` | enum | `\"level\"` | 等高線を値ごとに 1 ステップ(level)か、まとめて 1 ステップ(all) |\n\n関数は式 `f`(`x` と `y` の算術の式)か、スクリプトが計算した格子の値 `grid` のどちらか。`levels`(8 個まで)、`gradient.at`(勾配の矢印を描く点)、`path`(反復の点。スクリプトの出力)。大きさの目安:`equal`(既定)で range が正方形なら、図は(高さ − 約 95px)の正方形で左に寄り、右に 240px 以上空けば関数の名前と反復ごとの f の欄になる。高さ 440px なら幅 740px ほど(右に別の字や図を並べる)。横いっぱいに使うなら range の x を広げるか `equal: false`。"
|
|
1280
1295
|
},
|
|
1296
|
+
"m-contrast": {
|
|
1297
|
+
"set": "standard",
|
|
1298
|
+
"row": "| `<m-contrast>` | 研究の位置づけの図。問いごとに従来の答え(不明は破線)と本研究の答えを並べるか、近い研究の仮定の札と本研究の札(外した・加えた)を並べ、ステップで出す | answers は 問い → 従来の答え → 矢印と本研究の答え(order=\"row\" で行ごと)。assumptions は 近い研究 → 本研究の行(残した・外した)→ 加えた → 得られること。order=\"whole\" で 1 | `{kind?:\"answers\"\\|\"assumptions\",heads?:[str,str,str],selfLabel?:str,rows?:{q:str,after:str,basis?:str,before:{text?:str,by?:str,unknown?:bool,near?:str}}[],studies?:{label,chips:str[],result:str}[],self?:{dropped?:str[],kept?:str[],added?:str[],result:str}}` — answers:rows は [{\"q\", \"before\": {\"text\", \"by\"} か {\"unknown\": true, \"near\"}, \"after\", \"basis\"?}]。assumptions:studies は [{\"label\", \"chips\", \"result\"}]、self は {\"kept\", \"dropped\", \"added\", \"result\"} |",
|
|
1299
|
+
"entry": "### `<m-contrast>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"kind\":\"answers\",\"rows\":[{\"q\":\"差はどこにあるか\",\"before\":{\"unknown\":true,\"near\":\"国の間の差は [2]\"},\"after\":\"7 割は学校の間\",\"basis\":\"3 年分の全数データ\"}]}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `order` | string | `\"\"` | 出し方:build(既定。answers は列ごと、assumptions は研究 → 本研究)・row(answers の行ごと)・whole |\n| `size` | number | `28` | 字の大きさ(px、24 以上。入らなければ 24 まで縮める) |\n\n新しさが答えの値や見方にあるとき<!--part:m-matrix-->(m-matrix の表にならないとき)<!--/part-->の図。`kind` を子の JSON に書く。\n\n- `answers`(既定、問いと答え):`rows` は 1〜3 個の `{\"q\": \"問い\", \"before\": {\"text\": \"従来の答え\", \"by\": \"[1]\"}, \"after\": \"本研究の答え\", \"basis\": \"根拠\"}`。従来の答えがないときは `\"before\": {\"unknown\": true, \"near\": \"近い条件で分かっていること [2]\"}`(破線の箱に「不明」)\n- `assumptions`(仮定の差分):`studies` は 1〜3 個の `{\"label\": \"[2]\", \"chips\": [\"仮定\", …], \"result\": \"得られること\"}`、`self` は `{\"kept\": [...], \"dropped\": [...], \"added\": [...], \"result\": \"新しく得たこと\"}`。外した札は「外した」と書いて取り消し線、加えた札は「加えた」と書いて `--emph`\n- 本研究は字で書いて `--emph` の枠で囲む。`selfLabel` で名前を替え(既定「本研究」)、`heads` で 3 つの列の見出しを替える(answers は 問い・従来・本研究、assumptions は 研究・仮定・得られること)\n- 最も近い従来研究を `by` か `label` で名指しする。<!--part:m-tree-->前提ごとの対比は m-tree(`dash: true`)<!--/part-->",
|
|
1300
|
+
"paidOnly": true
|
|
1301
|
+
},
|
|
1281
1302
|
"m-ctable": {
|
|
1282
1303
|
"set": "standard",
|
|
1283
1304
|
"row": "| `<m-ctable>` | 分散分析表・分割表・潜在結果の表を、ステップごとに埋める。使ったセルと埋めたセルを示し、表の下に式。計算を確かめる | 埋めるステップの数(anova は値の列の数、contingency は計・期待度数・χ²・オッズ比、po は 3) | `{kind:\"anova\"\\|\"contingency\"\\|\"po\"\\|\"table\",rows?:(object\\|str\\|any[])[],cols?:str[],n?:num[][],margins?:bool,expected?:num[][],chi2?:num,or?:num,units?:{id?:str,t:0\\|1,y0:num,y1:num}[],ate?:num,naive?:num,header?:str[],note?}` |",
|
|
@@ -1287,7 +1308,7 @@ export const PACK = {
|
|
|
1287
1308
|
"m-curves": {
|
|
1288
1309
|
"set": "standard",
|
|
1289
1310
|
"row": "| `<m-curves>` | 同じ座標軸に線を 1 本ずつ引く(線の名前は凡例でなく線の端に直接書く) | step の最大(既定は系列の数) | `[{label?,f?:str,pts?:[num,num][],tone?,step?,labelAt?:num,color?:str,dash?:bool,xr?:[num,num],area?:any[],areaLabel?:str\\|any[],at?,anchor?:\"right\"\\|\"left\"\\|\"above\"\\|\"below\"\\|\"top\"\\|\"bottom\"\\|\"start\"\\|\"middle\"\\|\"end\",dx?:num,dy?:num,ly?:num} (f or pts),…]` — データは配列そのもの({\"series\": […]} ではない)。軸は属性に書く(xr=\"[0,10]\" xl=\"…\")。式の欄は f で、変数は x(fn・u ではない) |",
|
|
1290
|
-
"entry": "### `<m-curves>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `[{\"label\":\"需要 D\",\"f\":\"10 - x\"},{\"label\":\"供給 S\",\"f\":\"2 + x\"},{\"label\":\"均衡\",\"pts\":[[4,0],[4,6]],\"dash\":true}]`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `xr` | json | `[0, 1]` | 横軸の範囲 |\n| `yr` | json | `[0, 1]` | 縦軸の範囲 |\n| `xt` | json | `[]` | 横軸の目盛りの値 * |\n| `yt` | json | `[]` | 縦軸の目盛りの値 * |\n| `xf` | number | | 横軸の目盛りの小数桁 |\n| `yf` | number | | 縦軸の目盛りの小数桁 |\n| `xl` | string | `\"\"` | 横軸の名前(`*斜体*` `_下付き` `^上付き`) * |\n| `yl` | string | `\"\"` | 縦軸の名前 * |\n| `n` | number | `300` | f を描く分割数 |\n| `lw` | number | `3.5` | 線の太さ |\n| `size` | number | `0` | 字の大きさ(24 以上。0 = 既定) |\n\n同じ予測分布に平均・中央値・分位点を順に引く、損失関数を 1 つずつ重ねる、など\n「一つの図で比較の軸を一つずつ見せる」ときに使う。\n\n系列は子の `<script type=\"application/json\">` に配列で書く。\n1 系列 = 1 ステップ(書いた順)。`step` で変えられ、同じ `step` の系列は一緒に引く。台本の [n] はこのステップに合わせる。\n\n| 欄 | 意味 |\n|---|---|\n| `label` | 線の名前 |\n| `f` | x の算術の式(`exp(…)` `sqrt(…)` `PI` などの `Math` の関数と定数、`N(x, 平均, 標準偏差)`、`+ - * / % **`、比較と `? :`。下を見よ)。`xr` で描く範囲を狭められる |\n| `pts` | 点列 `[[x, y], …]`(縦線や実測の折れ線) |\n| `tone` | `term` `emph` `accent2` `muted` `fg` `series-1..4`(既定は `series-1..4` の順) |\n| `dash` | 破線 |\n| `area` / `areaLabel` | 塗る区間 `[a, b]`(複数可、null は端)とラベル |\n| `labelAt` / `anchor` / `dx` / `dy` / `ly` | 名前の位置:横軸の値 `labelAt` の点に置く(既定は線の端)。`anchor` は向き(`right` `left` `above` `below`)。`ly` は縦軸の値で高さを決める |\n\n`size=\"40\"`:字の大きさ(24
|
|
1311
|
+
"entry": "### `<m-curves>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `[{\"label\":\"需要 D\",\"f\":\"10 - x\"},{\"label\":\"供給 S\",\"f\":\"2 + x\"},{\"label\":\"均衡\",\"pts\":[[4,0],[4,6]],\"dash\":true}]`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `xr` | json | `[0, 1]` | 横軸の範囲 |\n| `yr` | json | `[0, 1]` | 縦軸の範囲 |\n| `xt` | json | `[]` | 横軸の目盛りの値 * |\n| `yt` | json | `[]` | 縦軸の目盛りの値 * |\n| `xf` | number | | 横軸の目盛りの小数桁 |\n| `yf` | number | | 縦軸の目盛りの小数桁 |\n| `xl` | string | `\"\"` | 横軸の名前(`*斜体*` `_下付き` `^上付き`) * |\n| `yl` | string | `\"\"` | 縦軸の名前 * |\n| `n` | number | `300` | f を描く分割数 |\n| `lw` | number | `3.5` | 線の太さ |\n| `size` | number | `0` | 字の大きさ(24 以上。0 = 既定) |\n\n同じ予測分布に平均・中央値・分位点を順に引く、損失関数を 1 つずつ重ねる、など\n「一つの図で比較の軸を一つずつ見せる」ときに使う。\n\n系列は子の `<script type=\"application/json\">` に配列で書く。\n1 系列 = 1 ステップ(書いた順)。`step` で変えられ、同じ `step` の系列は一緒に引く。台本の [n] はこのステップに合わせる。\n\n| 欄 | 意味 |\n|---|---|\n| `label` | 線の名前 |\n| `f` | x の算術の式(`exp(…)` `sqrt(…)` `PI` などの `Math` の関数と定数、`N(x, 平均, 標準偏差)`、`+ - * / % **`、比較と `? :`。下を見よ)。`xr` で描く範囲を狭められる |\n| `pts` | 点列 `[[x, y], …]`(縦線や実測の折れ線) |\n| `tone` | `term` `emph` `accent2` `muted` `fg` `series-1..4`(既定は `series-1..4` の順) |\n| `dash` | 破線 |\n| `area` / `areaLabel` | 塗る区間 `[a, b]`(複数可、null は端)とラベル |\n| `labelAt` / `anchor` / `dx` / `dy` / `ly` | 名前の位置:横軸の値 `labelAt` の点に置く(既定は線の端)。`anchor` は向き(`right` `left` `above` `below`)。`ly` は縦軸の値で高さを決める |\n\n`size=\"40\"`:字の大きさ(24 以上)。`xt` に字の目盛り:`xt='[\"4月\",\"5月\",\"6月\"]'`(x = 1, 2, 3)か `[[0, \"2023年度\"], …]`。\n\n`f` は算術の式で、コードとしては実行しない:数、`x`、`Math` の関数と定数(`sin(x)` とも `Math.sin(x)` とも書ける。`Math.random` は使えない)、`N(x, 平均, 標準偏差)`、`+ - * / % **`、比較(`< <= > >= == !=`)、`&& || !`、`? :`、括弧。べき乗は `**`(`^` は書けない)。書けない式はエラーの表示になる。",
|
|
1291
1312
|
"sup": true
|
|
1292
1313
|
},
|
|
1293
1314
|
"m-cycle": {
|
|
@@ -1381,8 +1402,8 @@ export const PACK = {
|
|
|
1381
1402
|
},
|
|
1382
1403
|
"m-matrix": {
|
|
1383
1404
|
"set": "standard",
|
|
1384
|
-
"row": "| `<m-matrix>` | 研究の位置づけの表。2 本の軸の交差の表(マスに研究の名前、本研究のマスを枠で結論の 1 文と、空きマスは — と注、下に設計の行)か、研究 × 要素の表(✓ △ × や短い字、列の上に要件の出どころ)を、ステップで埋める | cross は
|
|
1385
|
-
"entry": "### `<m-matrix>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"kind\":\"cross\",\"rows\":{\"axis\":\"評価基準\",\"values\":[\"予測誤差\",\"ベイズリスク\"]},\"cols\":{\"axis\":\"予測の形\",\"values\":[\"点予測\",\"分布予測\"]},\"cells\":[[[\"[1]\",\"[2]\"],[\"[3]\"]],[{\"none\":\"自明\"},{\"self\":true}]]}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `order` | string | `\"\"` | 出し方:cross は build(既定)・whole、attributes は whole(既定)・col・row |\n| `size` | number | `28` | 字の大きさ(px、24 以上。入らなければ 24 まで縮める) |\n\n`kind`:`cross`(既定、2 本の軸の交差の表)・`attributes`(行に研究、列に要素の表)。子の JSON に書く。\n\n- cross:`rows`・`cols` は `{\"axis\": \"軸の名前\", \"values\": [値, …]}`(どちらも 2〜4 個)。`cells[r][c]` は研究の名前の並び(引用番号か「著者(年)」、1〜3 本)、本研究のマスは `{\"self\": true}`、空きマスは `{\"none\": \"空きの理由\"}`(「—」と注の番号、表の下に注)。3 本目の軸は名前に印(† など)を付け、`marks: [{\"mark\": \"†\", \"text\": \"意味\"}]`\n - `{\"self\": \"分かったことの 1 文\"}` で本研究のマスに結論も書く(40 字まで)\n - `design: {\"cols\": [2〜3 個], \"rows\": [{\"label\", \"cells\"}, {\"self\": true, \"cells\"}]}`:表の下の設計の行(従来と本研究のデータ・識別の設計と、比べられるようになったこと)\n- attributes:`cols` は要素の名前か `{\"name\", \"source\"}`(要件が来た応用の必要)、`rows` は `{\"label\", \"cells\", \"self\"}`(本研究を先頭に)。空のマスは「—」。記号の意味は `marks`(● 満たす・× 満たさない・— 記載なし)\n- 本研究は「本研究」と字で書いて `--emph` の枠で囲む(色だけで分けない)\n\n型の選び方(新しさの在りか):問題の記述(目的・設定・入力・出力・評価基準)なら cross(問いと対象なら結論の 1 文、観測・識別なら design も)、応用の要件を満たす手法なら attributes に出どころと ● ×
|
|
1405
|
+
"row": "| `<m-matrix>` | 研究の位置づけの表。2 本の軸の交差の表(マスに研究の名前、本研究のマスを枠で結論の 1 文と、空きマスは — と注、下に設計の行)か、研究 × 要素の表(✓ △ × や短い字、列の上に要件の出どころ)を、ステップで埋める | cross は 軸と空の表(0)→ 従来(1)→ 本研究(2)→ 注(3、none のマスがあるときだけ)、order=\"whole\" で 1。attributes は whole で 1、col・row で 列・行の数 + 1(枠) | `{kind?:\"cross\"\\|\"attributes\",rows?:object\\|any[],cols?:object\\|any[],cells?:(any[]\\|object)[][],marks?:{mark:str,text:str}[],design?:{cols:str[],rows:{label?,self?:bool,cells:str[]}[]},self?:str}` — cross:rows・cols は {\"axis\", \"values\"}、cells[r][c] は研究の名前の並び・{\"self\": true か \"結論\"}・{\"none\": \"理由\"}、design は {\"cols\", \"rows\"}。attributes:cols は名前か {\"name\", \"source\"}、rows は {\"label\", \"cells\", \"self\"?} |",
|
|
1406
|
+
"entry": "### `<m-matrix>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"kind\":\"cross\",\"rows\":{\"axis\":\"評価基準\",\"values\":[\"予測誤差\",\"ベイズリスク\"]},\"cols\":{\"axis\":\"予測の形\",\"values\":[\"点予測\",\"分布予測\"]},\"cells\":[[[\"[1]\",\"[2]\"],[\"[3]\"]],[{\"none\":\"自明\"},{\"self\":true}]]}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `order` | string | `\"\"` | 出し方:cross は build(既定)・whole、attributes は whole(既定)・col・row |\n| `size` | number | `28` | 字の大きさ(px、24 以上。入らなければ 24 まで縮める) |\n\n`kind`:`cross`(既定、2 本の軸の交差の表)・`attributes`(行に研究、列に要素の表)。子の JSON に書く。\n\n- cross:`rows`・`cols` は `{\"axis\": \"軸の名前\", \"values\": [値, …]}`(どちらも 2〜4 個)。`cells[r][c]` は研究の名前の並び(引用番号か「著者(年)」、1〜3 本)、本研究のマスは `{\"self\": true}`、空きマスは `{\"none\": \"空きの理由\"}`(「—」と注の番号、表の下に注)。3 本目の軸は名前に印(† など)を付け、`marks: [{\"mark\": \"†\", \"text\": \"意味\"}]`\n - `{\"self\": \"分かったことの 1 文\"}` で本研究のマスに結論も書く(40 字まで)\n - `design: {\"cols\": [2〜3 個], \"rows\": [{\"label\", \"cells\"}, {\"self\": true, \"cells\"}]}`:表の下の設計の行(従来と本研究のデータ・識別の設計と、比べられるようになったこと)\n- attributes:`cols` は要素の名前か `{\"name\", \"source\"}`(要件が来た応用の必要)、`rows` は `{\"label\", \"cells\", \"self\"}`(本研究を先頭に)。空のマスは「—」。記号の意味は `marks`(● 満たす・× 満たさない・— 記載なし)\n- 本研究は「本研究」と字で書いて `--emph` の枠で囲む(色だけで分けない)\n\n型の選び方(新しさの在りか):問題の記述(目的・設定・入力・出力・評価基準)なら cross(問いと対象なら結論の 1 文、観測・識別なら design も)、応用の要件を満たす手法なら attributes に出どころと ● × —。答えの値や見方が新しいなら、この表にしない<!--part:m-contrast,m-tree-->(m-contrast、前提ごとなら m-tree の `dash`)<!--/part-->。どれも最も近い従来研究 1〜2 件を表の中で名指しする\n\n注意\n\n- 交差の表の軸は 2〜4 個ずつ。それより多いときは軸の値をまとめるか、attributes の表にする\n- マスの研究は主なものを 3 本まで。全部の文献の一覧は参考文献のスライドに置く\n- 要件を本研究に有利な語で作らない(本研究だけが全部 ● の表は、選び方しだいで必ず作れる)",
|
|
1386
1407
|
"paidOnly": true
|
|
1387
1408
|
},
|
|
1388
1409
|
"m-menu": {
|
|
@@ -1485,8 +1506,8 @@ export const PACK = {
|
|
|
1485
1506
|
},
|
|
1486
1507
|
"m-tree": {
|
|
1487
1508
|
"set": "standard",
|
|
1488
|
-
"row": "| `<m-tree>` | 階層・分類の木(組織図、生物の分類など)を、根から 1 段ずつ組み立てる。座標は書かず、配置はパーツが決める | 節の深さの数(by=\"level\"、既定)か節の数(by=\"node\")。節と edges の step があればその最大 | `{nodes:{id:str\\|int,label?,tex?,note?,tone?,parent?:str\\|int,branch?:str,step?,at?}[],edges?:{from:str\\|int,to:str\\|int,label?,tone?,dash?:bool,step?,at?}[],path?:(str\\|int)[],pathStep?:int,pathNote?:str}` — parent のない節(根)はちょうど 1 つ |",
|
|
1489
|
-
"entry": "### `<m-tree>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"nodes\":[{\"id\":\"r\",\"label\":\"動物\"},{\"id\":\"a\",\"label\":\"脊椎動物\",\"parent\":\"r\"},{\"id\":\"b\",\"label\":\"無脊椎動物\",\"parent\":\"r\"}]}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `orient` | string | `\"down\"` | down(上から下、既定)か right(左から右) |\n| `by` | string | `\"level\"` | ステップの分け方:level(深さごと、既定)か node(1 つずつ、深さ優先の順) |\n| `link` | string | `\"elbow\"` | 親子の線:elbow(かぎ形、既定)か straight(まっすぐ) |\n| `size` | number | `0` | 箱の字の大きさ(px。0 = 27 から入るまで 24 まで縮める) |\n\n組織図、生物や物質の分類、概念の上位と下位、章と節の構成など、親子の関係で並ぶものを上から順に見せるときに使う。\n座標は書かない(共通の決まり §2)。中身とつながりだけを書けば、パーツが重ならないように並べる。\n\n子の JSON の並び:`edges` は省いてよい。\n\n- node:`id`、`label`(`\\n` で改行)か `tex`(KaTeX)、`parent`(親の `id`。`parent` のない節(根)はちょうど 1 つ)、`note`(箱の**下**に小さな一言、`--muted`)、`tone`(`term`(既定)・`emph`・`muted`・`accent2`・`series-1..4`)、`step`、`at`(ステップの中の開始秒)\n- 子は配列の順に並ぶ。親は子の並びの中央に置く\n- edge:親子のほかのつながり(`from` `to` `label` `tone` `dash` `step`)。破線で矢印つき、木の外側(`down` は下、`right` は右)へふくらむ。同じ深さの節どうしに向く。ステップは既定で両端の遅いほう\n- 子の `branch`:線の字(確率など)。`path`:根からの `id` の道を順に強調(`pathStep` で一度に。`pathNote`:末尾の一言)\n- `orient`:`down`(既定、上から下)か `right`(左から右。分類を横に広げるとき)\n- `by`:`level`(既定。根、それから深さごとに 1 段)か `node`(深さ優先の順に 1 つずつ。1 つの枝をたどって話すとき)。節の `step` が勝つ\n- `link`:親子の線。`elbow`(既定、かぎ形)か `straight`(まっすぐ)。線の色は `--muted`、3 px\n- `tone: emph` の箱は、地が `--emph-tint`、枠と字が `--emph`\n- 入る大きさの目安(1280×720 の本文、高さ 440 px ほど):`down` は 1 段に 4 字ほどの箱が 8 個、`right` は 7 個ほど。深さは 5 段ほど。\n それより多い葉(子のない節)が 1 つの親に並ぶと、子を 2 段に互い違いに並べる(`down` で 16 個ほど、`right` で 11 個ほどまで)。\n さらに入らなければ名前を 2 行に折る。字は 24 px より小さくならず、入らない分は要素の箱からはみ出す(足りない px を `ctx.report` で知らせ、Studio の品質チェックに出る)。多いときは木を分ける\n- 見せ方(`variant`):`fade`・`draw`・`grow`。書かなければ資料のシード値で選ばれる(書かなくてよい)\n- 動きの上限:どの見せ方でも箱が動くのは 12 px まで(箱の中心で測る)、時間も `fade` の長さの中(共通の決まり §1.2)\n- 先のステップを薄く見せる表示(`ctx.preview
|
|
1509
|
+
"row": "| `<m-tree>` | 階層・分類の木(組織図、生物の分類など)を、根から 1 段ずつ組み立てる。座標は書かず、配置はパーツが決める | 節の深さの数(by=\"level\"、既定)か節の数(by=\"node\")。節と edges の step があればその最大 | `{nodes:{id:str\\|int,label?,tex?,note?,tone?,dash?:bool,parent?:str\\|int,branch?:str,step?,at?}[],edges?:{from:str\\|int,to:str\\|int,label?,tone?,dash?:bool,step?,at?}[],path?:(str\\|int)[],pathStep?:int,pathNote?:str}` — parent のない節(根)はちょうど 1 つ |",
|
|
1510
|
+
"entry": "### `<m-tree>`\n\nデータ(子の `<script type=\"application/json\">`)の例: `{\"nodes\":[{\"id\":\"r\",\"label\":\"動物\"},{\"id\":\"a\",\"label\":\"脊椎動物\",\"parent\":\"r\"},{\"id\":\"b\",\"label\":\"無脊椎動物\",\"parent\":\"r\"}]}`\n\n| 値 | 型 | 既定 | 意味 |\n|---|---|---|---|\n| `orient` | string | `\"down\"` | down(上から下、既定)か right(左から右) |\n| `by` | string | `\"level\"` | ステップの分け方:level(深さごと、既定)か node(1 つずつ、深さ優先の順) |\n| `link` | string | `\"elbow\"` | 親子の線:elbow(かぎ形、既定)か straight(まっすぐ) |\n| `size` | number | `0` | 箱の字の大きさ(px。0 = 27 から入るまで 24 まで縮める) |\n\n組織図、生物や物質の分類、概念の上位と下位、章と節の構成など、親子の関係で並ぶものを上から順に見せるときに使う。\n座標は書かない(共通の決まり §2)。中身とつながりだけを書けば、パーツが重ならないように並べる。\n\n子の JSON の並び:`edges` は省いてよい。\n\n- node:`id`、`label`(`\\n` で改行)か `tex`(KaTeX)、`parent`(親の `id`。`parent` のない節(根)はちょうど 1 つ)、`note`(箱の**下**に小さな一言、`--muted`)、`tone`(`term`(既定)・`emph`・`muted`・`accent2`・`series-1..4`)、`step`、`at`(ステップの中の開始秒)\n- node の `dash: true`:箱の枠を破線にし、地を塗らない(外した前提・まだないものなど。意味は `note` か本文で言う)\n- 子は配列の順に並ぶ。親は子の並びの中央に置く\n- edge:親子のほかのつながり(`from` `to` `label` `tone` `dash` `step`)。破線で矢印つき、木の外側(`down` は下、`right` は右)へふくらむ。同じ深さの節どうしに向く。ステップは既定で両端の遅いほう\n- 子の `branch`:線の字(確率など)。`path`:根からの `id` の道を順に強調(`pathStep` で一度に。`pathNote`:末尾の一言)\n- `orient`:`down`(既定、上から下)か `right`(左から右。分類を横に広げるとき)\n- `by`:`level`(既定。根、それから深さごとに 1 段)か `node`(深さ優先の順に 1 つずつ。1 つの枝をたどって話すとき)。節の `step` が勝つ\n- `link`:親子の線。`elbow`(既定、かぎ形)か `straight`(まっすぐ)。線の色は `--muted`、3 px\n- `tone: emph` の箱は、地が `--emph-tint`、枠と字が `--emph`\n- 入る大きさの目安(1280×720 の本文、高さ 440 px ほど):`down` は 1 段に 4 字ほどの箱が 8 個、`right` は 7 個ほど。深さは 5 段ほど。\n それより多い葉(子のない節)が 1 つの親に並ぶと、子を 2 段に互い違いに並べる(`down` で 16 個ほど、`right` で 11 個ほどまで)。\n さらに入らなければ名前を 2 行に折る。字は 24 px より小さくならず、入らない分は要素の箱からはみ出す(足りない px を `ctx.report` で知らせ、Studio の品質チェックに出る)。多いときは木を分ける\n- 見せ方(`variant`):`fade`・`draw`・`grow`。書かなければ資料のシード値で選ばれる(書かなくてよい)\n- 動きの上限:どの見せ方でも箱が動くのは 12 px まで(箱の中心で測る)、時間も `fade` の長さの中(共通の決まり §1.2)\n- 先のステップを薄く見せる表示(`ctx.preview`)では、後のステップの箱と線をテーマの薄さで出しておく\n\n前提の対比(研究の位置づけ):根に問い、子に立場(本研究は `tone: emph`)、その下に前提、さらに下に言えること(`note` に「前提」「言えること」)。本研究が外した前提は `dash: true` に `note: \"外した前提\"`。"
|
|
1490
1511
|
},
|
|
1491
1512
|
"m-vector": {
|
|
1492
1513
|
"set": "standard",
|
|
@@ -1505,9 +1526,9 @@ export const PACK = {
|
|
|
1505
1526
|
"briefNote": "下に説明の節がないパーツは、表の「データの形」のとおりに子の JSON か属性を書き、ほかの属性は既定のままにする。",
|
|
1506
1527
|
"extHead": "### `<{name}>`:このセットの拡張(パーツの説明は §3)"
|
|
1507
1528
|
},
|
|
1508
|
-
"version": "
|
|
1529
|
+
"version": "027f5293",
|
|
1509
1530
|
"tiers": {
|
|
1510
|
-
"catalogue": "2.
|
|
1531
|
+
"catalogue": "2.21.0",
|
|
1511
1532
|
"parts": {
|
|
1512
1533
|
"m-balance": {
|
|
1513
1534
|
"tier": "specialized",
|
|
@@ -1695,6 +1716,21 @@ export const PACK = {
|
|
|
1695
1716
|
"en": "Contour plot"
|
|
1696
1717
|
}
|
|
1697
1718
|
},
|
|
1719
|
+
"m-contrast": {
|
|
1720
|
+
"tier": "specialized",
|
|
1721
|
+
"purposes": [
|
|
1722
|
+
"compare",
|
|
1723
|
+
"position"
|
|
1724
|
+
],
|
|
1725
|
+
"audiences": [
|
|
1726
|
+
"university",
|
|
1727
|
+
"working-adult"
|
|
1728
|
+
],
|
|
1729
|
+
"display": {
|
|
1730
|
+
"ja": "対比の図",
|
|
1731
|
+
"en": "Contrast figure"
|
|
1732
|
+
}
|
|
1733
|
+
},
|
|
1698
1734
|
"m-ctable": {
|
|
1699
1735
|
"tier": "specialized",
|
|
1700
1736
|
"purposes": [
|
package/kit/core/part-labels.mjs
CHANGED
|
@@ -73,6 +73,7 @@ const LOCAL = {
|
|
|
73
73
|
'm-contour': { icon: 'heatmap', desc: { ja: '2 変数の関数の等高線と勾配、勾配降下法の道', en: 'Contours of a two-variable function, its gradient and a descent path' } },
|
|
74
74
|
'm-ctable': { icon: 'compare', desc: { ja: '分散分析表・分割表を計算のステップごとに埋める', en: 'ANOVA and contingency tables, filled in step by step' } },
|
|
75
75
|
'm-vector': { icon: 'matrix', desc: { ja: '平面のベクトルと 2 × 2 の行列の変換を 1 ステップずつ', en: 'Plane vectors and 2 × 2 matrix maps, one step at a time' } },
|
|
76
|
+
'm-contrast': { icon: 'compare', desc: { ja: '問いごとに従来の答えと本研究の答えを並べて、研究の位置づけを示す', en: 'Positions the work by setting earlier answers and this work side by side, question by question' } },
|
|
76
77
|
'm-matrix': { icon: 'compare', desc: { ja: '研究の位置づけを、2 本の軸の表か研究 × 要素の表でステップごとに埋める', en: 'Positions studies in a two-axis table or a studies × elements table, filled step by step' } },
|
|
77
78
|
'm-scroll': { icon: 'timeline', desc: { ja: '縦に長い図を枠に入れ、ステップごとに決めた所までスクロールする', en: 'A tall figure in a fixed frame, scrolled to set places step by step' } },
|
|
78
79
|
};
|
package/kit/core/portable.mjs
CHANGED
|
@@ -578,6 +578,7 @@ function completionCheck(c, w, e) {
|
|
|
578
578
|
if (own(c, 'played') && c.played !== true) e.push(`${w}.played: not true`);
|
|
579
579
|
if (own(c, 'visitedFraction') && !(typeof c.visitedFraction === 'number' && c.visitedFraction > 0 && c.visitedFraction <= 1)) e.push(`${w}.visitedFraction: not in (0, 1]`);
|
|
580
580
|
if (own(c, 'reachedEnd') && c.reachedEnd !== true) e.push(`${w}.reachedEnd: not true`);
|
|
581
|
+
if (own(c, 'checks') && c.checks !== 'answered' && c.checks !== 'correct') e.push(`${w}.checks: not "answered" or "correct"`);
|
|
581
582
|
}
|
|
582
583
|
// 実行系の deck-meta(仕様の写し(FORMAT.VENDOR_DIR)の schema/deck-meta.schema.json)
|
|
583
584
|
// opts.preDraft:1.0 の形より前の草案の文書(player がない。§7.1)を読むとき、player がないことは問わない(読むのは今までどおり。書くものは必ず持つ)
|
|
@@ -1502,8 +1503,10 @@ function carryUnknown(index, carry, opts) {
|
|
|
1502
1503
|
// player は写さない:作り直しは再生器を替える(§4.1)ので、前の再生器の記録の項目はこの再生器のことではない
|
|
1503
1504
|
for (const k of ['version', 'contracts', 'generator']) copyUnknown(index[k], carry[k], KNOWN[k]);
|
|
1504
1505
|
if (isObj(carry.metadata)) {
|
|
1505
|
-
// 知っている項目でも、この書き手が作らなかったもの(ほかの書き手が書いた description
|
|
1506
|
-
|
|
1506
|
+
// 知っている項目でも、この書き手が作らなかったもの(ほかの書き手が書いた description など)は残す。
|
|
1507
|
+
// 権利の表示と作成者(license・copyright・attribution・creators)は写さない:開いたときに設定のファイルへ写してあり(folderConfig)、
|
|
1508
|
+
// 設定のファイルにないのは消したということ(「ファイルの情報…」の「ライセンスを付けない」・空の欄。handoff #88)。写すと deck-meta と食い違う
|
|
1509
|
+
for (const k of Object.keys(carry.metadata)) if (k !== 'derivedFrom' && !DECK_META_RIGHTS.includes(k) && !own(index.metadata, k)) index.metadata[k] = carry.metadata[k];
|
|
1507
1510
|
if (!opts.identity) {
|
|
1508
1511
|
if (own(carry.metadata, 'derivedFrom')) index.metadata.derivedFrom = carry.metadata.derivedFrom;
|
|
1509
1512
|
else delete index.metadata.derivedFrom;
|
package/kit/core/scorm.mjs
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// LMS 用の SCORM 1.2 の包み(spec bindings/scorm12.md §1):再生専用の Egatari ファイルを、そのまま index.html として 1 つの SCO の zip に入れる。
|
|
2
2
|
// node: も fs も使わない(CLI の build --scorm と編集アプリの「エクスポート ▸ LMS 用(SCORM)…」が同じバイトを作る)
|
|
3
3
|
//
|
|
4
|
-
// scormPackage(html) → { zip: Uint8Array, manifest, docId, title, steps, completion }
|
|
4
|
+
// scormPackage(html, { checks }?) → { zip: Uint8Array, manifest, docId, title, steps, completion }
|
|
5
5
|
// html:再生専用の Egatari ファイル(kit/core/portable.mjs の playOnly の出力)。バイトを変えずに index.html にする
|
|
6
|
+
// checks:確認問題の条件(format spec §9.2 completion.checks)を、包む前に再生専用の写しの deck-meta.completion に書く。
|
|
7
|
+
// "answered" | "correct" で書き、null で消す。省けば(undefined)写しのまま。書いた写しを、バイトを変えずに index.html にする
|
|
8
|
+
// withChecks(html, checks) → deck-meta.completion.checks を書き換えた再生専用の写し(上の checks と同じ。ほかはバイトのまま)
|
|
6
9
|
// scormManifest({ docId, title }) → imsmanifest.xml の文字列(包み方 §1 の形のまま)
|
|
7
10
|
// SCORM_EXT:書き出す zip の拡張子(名前は kit/core/export-name.mjs の exportName(題名, 既定, SCORM_EXT))
|
|
8
11
|
//
|
|
@@ -10,10 +13,12 @@
|
|
|
10
13
|
// 再開データ(cmi.suspend_data、3 つの bitset)が 4096 字を超えうる(§2.2。数えると 8064 ステップより多いとき。包み方の「about 3000」は控えめに過ぎる)・索引を持つ(編集できる Egatari ファイル。再生専用にしてから包む)
|
|
11
14
|
//
|
|
12
15
|
// 終えた判定(§3)は再生器(kit/track.js)が deck-meta.completion から決め、cmi.core.lesson_status を completed にする。
|
|
13
|
-
//
|
|
14
|
-
//
|
|
16
|
+
// 確認問題(パーツの問い、format spec §8.4 ctx.answer)があれば、再生器が点数(cmi.core.score.raw、正解した割合)も送る(§2.1)。
|
|
17
|
+
// 包みの側には何も書かない:adlcp:masteryscore は点数と比べて passed / failed を決めるためのもので、確認問題は理解の確認で
|
|
18
|
+
// 試験ではない(§2.1:passed / failed は使わない。答えはファイルの中にあり、学習者の端末で判定する。成績は LMS の小テストで)
|
|
15
19
|
import { writeZip } from './zip-write.mjs';
|
|
16
20
|
import { scanDocument, readDeckMeta } from './portable.mjs';
|
|
21
|
+
import { jsonScript } from './build-core.mjs';
|
|
17
22
|
import { FORMAT } from './format.mjs';
|
|
18
23
|
|
|
19
24
|
export const SCORM_EXT = '.scorm.zip';
|
|
@@ -80,8 +85,9 @@ export function stepCount(html) {
|
|
|
80
85
|
return Math.max(keys.size, narr);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
export function scormPackage(html) {
|
|
88
|
+
export function scormPackage(html, opts = {}) {
|
|
84
89
|
if (typeof html !== 'string') fail('scorm-not-egatari', 'not an Egatari file');
|
|
90
|
+
if (opts.checks !== undefined) html = withChecks(html, opts.checks);
|
|
85
91
|
const scan = scanDocument(html);
|
|
86
92
|
const meta = readDeckMeta(scan);
|
|
87
93
|
if (!meta || meta.format !== FORMAT.FORMAT_ID) fail('scorm-not-egatari', `not a ${FORMAT.DISPLAY_NAME} file (no deck-meta with format "${FORMAT.FORMAT_ID}")`);
|
|
@@ -96,14 +102,32 @@ export function scormPackage(html) {
|
|
|
96
102
|
return { zip, manifest, docId: meta.docId, title, steps, completion: meta.completion || null };
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
// 再生専用の写しの deck-meta.completion.checks を書き換える(checks:"answered" | "correct" | null)。ほかの項目と、deck-meta の外はバイトのまま。
|
|
106
|
+
// completion がほかに何も持たなくなったら completion ごと消す({} は規則のない completion:schema が断る)
|
|
107
|
+
export const CHECKS = Object.freeze(['answered', 'correct']);
|
|
108
|
+
export function withChecks(html, checks) {
|
|
109
|
+
if (checks !== null && !CHECKS.includes(checks)) throw new TypeError(`checks: not one of ${CHECKS.join(', ')} or null`);
|
|
110
|
+
const scan = scanDocument(html);
|
|
111
|
+
const meta = readDeckMeta(scan), el = scan.byId.get('deck-meta');
|
|
112
|
+
if (!meta || meta.format !== FORMAT.FORMAT_ID || !el || el.start == null) fail('scorm-not-egatari', `not a ${FORMAT.DISPLAY_NAME} file (no deck-meta with format "${FORMAT.FORMAT_ID}")`);
|
|
113
|
+
const c = meta.completion && typeof meta.completion === 'object' && !Array.isArray(meta.completion) ? { ...meta.completion } : {};
|
|
114
|
+
if ((c.checks ?? null) === checks) return html;
|
|
115
|
+
if (checks) c.checks = checks; else delete c.checks;
|
|
116
|
+
const nm = { ...meta };
|
|
117
|
+
if (Object.keys(c).length) nm.completion = c; else delete nm.completion;
|
|
118
|
+
return html.slice(0, el.start) + jsonScript('deck-meta', nm) + html.slice(el.end);
|
|
119
|
+
}
|
|
120
|
+
|
|
99
121
|
// 終えた判定(deck-meta.completion、format spec §9.2)を平たい言葉で。編集アプリの窓と CLI の出力が使う
|
|
100
|
-
// kind:'all' | 'fraction' | 'end'、percent(fraction のとき)、played
|
|
122
|
+
// kind:'all' | 'fraction' | 'end'、percent(fraction のとき)、played(再生したステップだけを数える)、
|
|
123
|
+
// checks:確認問題の条件(null | 'answered' | 'correct')
|
|
101
124
|
export function completionRule(c) {
|
|
102
|
-
const r = { kind: 'all', percent: 100, played: false };
|
|
125
|
+
const r = { kind: 'all', percent: 100, played: false, checks: null };
|
|
103
126
|
if (c && typeof c === 'object') {
|
|
104
127
|
if (c.reachedEnd === true) r.kind = 'end';
|
|
105
128
|
else if (typeof c.visitedFraction === 'number' && c.visitedFraction > 0 && c.visitedFraction < 1) { r.kind = 'fraction'; r.percent = Math.round(c.visitedFraction * 1000) / 10; }
|
|
106
129
|
if (c.played === true) r.played = true;
|
|
130
|
+
if (CHECKS.includes(c.checks)) r.checks = c.checks;
|
|
107
131
|
}
|
|
108
132
|
return r;
|
|
109
133
|
}
|