egatari 0.6.15 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/README.ja.md +65 -64
  3. package/README.md +40 -39
  4. package/bin/egatari.mjs +3 -3
  5. package/kit/check-messages.mjs +95 -70
  6. package/kit/check.mjs +17 -11
  7. package/kit/core/article-messages.mjs +15 -15
  8. package/kit/core/check-parity.mjs +1 -1
  9. package/kit/core/check-rules.mjs +11 -6
  10. package/kit/core/colab-core.mjs +2 -2
  11. package/kit/core/export-name.mjs +2 -2
  12. package/kit/core/geometry-check.mjs +363 -25
  13. package/kit/core/layout-scan.mjs +8 -3
  14. package/kit/core/live-policy.mjs +2 -2
  15. package/kit/core/live.mjs +2 -2
  16. package/kit/core/llm-fix.mjs +12 -12
  17. package/kit/core/llm-insert.mjs +11 -11
  18. package/kit/core/llm-outline.mjs +7 -7
  19. package/kit/core/llm-pack-data.mjs +10 -10
  20. package/kit/core/parts2.mjs +5 -5
  21. package/kit/core/portable.mjs +5 -5
  22. package/kit/core/purposes.mjs +2 -2
  23. package/kit/core/ref-voice.mjs +1 -1
  24. package/kit/core/scorm.mjs +1 -1
  25. package/kit/core/sound-preferences.mjs +1 -1
  26. package/kit/core/theme-derive.mjs +209 -0
  27. package/kit/core/themes-list.mjs +1 -1
  28. package/kit/core/themes-lock.mjs +1 -1
  29. package/kit/core/tier-a.mjs +7 -7
  30. package/kit/deck.js +7 -4
  31. package/kit/instruction-version.json +1 -1
  32. package/kit/live.js +20 -20
  33. package/kit/player.json +1 -1
  34. package/kit/player.lock.json +2 -2
  35. package/kit/presenter.js +2 -2
  36. package/kit/templates/new-deck.mjs +6 -6
  37. package/kit/tools.js +5 -5
  38. package/kit/track.js +1 -1
  39. package/package.json +1 -1
  40. package/server/editor-ui.js +20 -17
  41. package/tts/yomi.yaml +8 -0
  42. package/vendor/egatari-spec/SOURCE.json +2 -2
  43. package/vendor/egatari-spec/schema/deck-meta.schema.json +1 -1
  44. package/vendor/egatari-spec/schema/egatari-metadata.schema.json +2 -2
@@ -28,7 +28,7 @@ export const ARTICLE_MESSAGES = {
28
28
  articleFrontMatter: { ja: (a) => `前付けの行「${a.text}」が読めない:1 行に「名前: 値」だけを書く`, en: (a) => `cannot read the front matter line “${a.text}”: write one “name: value” per line` },
29
29
  articleFrontMatterMember: { ja: (a) => `前付けの「${a.member}」は書けない(title・subtitle・lang・bibliography・writing-mode・chapter・kind・numbering だけ)`, en: (a) => `the front matter member “${a.member}” is not allowed (only title, subtitle, lang, bibliography, writing-mode, chapter, kind, numbering)` },
30
30
  articleFrontMatterValue: { ja: (a) => `前付けの ${a.member} の値「${a.value}」が違う(${{ string: '空でない字', lang: '言語の名前(ja・en など)', mode: 'horizontal-tb か vertical-rl', posint: '正の整数', kind: 'preface・chapter・appendix・afterword のどれか', boolean: 'true か false' }[a.expected]})`, en: (a) => `front matter ${a.member}: “${a.value}” is not ${{ string: 'a non-empty string', lang: 'a language tag (ja, en, …)', mode: 'horizontal-tb or vertical-rl', posint: 'a positive integer', kind: 'one of preface, chapter, appendix, afterword', boolean: 'true or false' }[a.expected]}` },
31
- articleKindChapter: { ja: (a) => `kind: ${a.kind} のファイルに chapter(章の番号)がある:付録は A・B…と自動で振るので chapter を外す`, en: (a) => `a kind: ${a.kind} file states chapter: remove it (appendices are lettered A, B, … automatically)` },
31
+ articleKindChapter: { ja: (a) => `kind: ${a.kind} のファイルに chapter(章の番号)がある:付録は A・B…と自動で振るので chapter を削除する`, en: (a) => `a kind: ${a.kind} file states chapter: remove it (appendices are lettered A, B, … automatically)` },
32
32
  articleDirective: { ja: (a) => `{${a.name}} は Egatari Text の外の書き方${hintJa(a)}`, en: (a) => `{${a.name}} is outside Egatari Text${hintEn(a)}` },
33
33
  articleBacktickDirective: { ja: (a) => `{${a.name}} を「\`\`\`」で囲んでいる:指令は「:::」で囲む`, en: (a) => `{${a.name}} is fenced with backticks: fence directives with ::: (colons)` },
34
34
  articleOption: { ja: (a) => `{${a.name}} に :${a.option}: は書けない`, en: (a) => `{${a.name}} does not take the option :${a.option}:` },
@@ -37,14 +37,14 @@ export const ARTICLE_MESSAGES = {
37
37
  articleHtmlTable: { ja: (a) => `HTML の表が決まりに合わない:${a.why}(使えるのは table・thead・tbody・tr・th・td、属性 colspan・rowspan・align、セルの中は字と em・strong・code・sub・sup・br だけ。空行・数式・Markdown は書けない)`, en: (a) => `the HTML table breaks the rules: ${a.why} (only table, thead, tbody, tr, th, td; attributes colspan, rowspan, align; cells hold text and em, strong, code, sub, sup, br; no blank lines, math or Markdown)` },
38
38
  articleHtmlTableNoSpan: { ja: () => 'HTML の表にセルをつなぐところ(colspan・rowspan)がない:パイプの表(| 見出し | … |)で書く', en: () => 'the HTML table merges no cells (no colspan or rowspan): write it as a pipe table (| header | … |)' },
39
39
  articleComment: { ja: (a) => `「%」で始まる行(${a.text})は MyST では消える:字として書くなら \\% と書く`, en: (a) => `a line starting with % (${a.text}) is a MyST comment and disappears: write \\% for the character` },
40
- articleBlockBreak: { ja: () => '「+++」(区切り)は節の kind の行だけに使える:外すか、--- (横線)にする', en: () => 'a block break (+++) is allowed only for a section kind line: remove it or use --- (a thematic break)' },
40
+ articleBlockBreak: { ja: () => '「+++」(区切り)は節の kind の行だけに使える:削除するか、--- (横線)にする', en: () => 'a block break (+++) is allowed only for a section kind line: remove it or use --- (a thematic break)' },
41
41
  articleSubstitution: { ja: (a) => `置き換え「${a.text}」は書けない:字をそのまま書く`, en: (a) => `the substitution “${a.text}” is not allowed: write the text itself` },
42
42
  articleStrike: { ja: (a) => `取り消し線「${a.text}」は書けない`, en: (a) => `strikethrough “${a.text}” is not allowed` },
43
43
  articleBareUrl: { ja: (a) => `URL「${a.url}」がリンクになっていない:<${a.url}> か [字](${a.url}) と書く`, en: (a) => `the URL ${a.url} is not a link: write <${a.url}> or [text](${a.url})` },
44
44
  articleTaskList: { ja: () => 'チェックの付く箇条書き(- [ ])は書けない:普通の箇条書きにする', en: () => 'task lists (- [ ]) are not allowed: use a plain list' },
45
45
  articleHeadingLevel: { ja: (a) => (a.depth === 1 ? '「#」(第 1 段の見出し)は書けない:題は前付けの title に書き、節は ## から' : `「${'#'.repeat(a.depth)}」(第 ${a.depth} 段の見出し)は書けない:見出しは ##・###・#### まで`), en: (a) => (a.depth === 1 ? 'a level-1 heading (#) is not allowed: put the title in the front matter title and start sections at ##' : `a level-${a.depth} heading is not allowed: use ##, ### or ####`) },
46
46
  articleSectionId: { ja: (a) => `節${quoteJa(a.heading)}(## の見出し)に id がない:npm run ids で (sec-…)= の行を付ける(自分で書かない)`, en: (a) => `the section “${a.heading}” (a ## heading) has no id: run npm run ids to add its (sec-…)= line (do not write ids by hand)` },
47
- articleSectionIdForm: { ja: (a) => `節の id「${a.label}」が決まりの形(sec- と英小文字・2〜7 の 6 字)でない:その (…)= の行を消して npm run ids で付け直す(参照も直す)`, en: (a) => `the section id “${a.label}” is not of the required form (sec- and 6 characters a–z, 2–7): delete its (…)= line, run npm run ids and update references to it` },
47
+ articleSectionIdForm: { ja: (a) => `節の id「${a.label}」が決まりの形(sec- と英小文字・2〜7 の 6 字)でない:その (…)= の行を削除して npm run ids で付け直す(参照も修正する)`, en: (a) => `the section id “${a.label}” is not of the required form (sec- and 6 characters a–z, 2–7): delete its (…)= line, run npm run ids and update references to it` },
48
48
  articleLabel: { ja: (a) => `名前「${a.label}」:${WHY_LABEL.ja[a.why]}`, en: (a) => `the label “${a.label}” ${WHY_LABEL.en[a.why]}` },
49
49
  articleCiteKey: { ja: (a) => `引用キー「${a.key}」が引用キーの書式に合わない(英数字と _、間に . : - 。64 字まで)`, en: (a) => `the citation key “${a.key}” does not match the citation key pattern (letters, digits, _, separated by . : -; up to 64)` },
50
50
  articleCitePrefix: { ja: (a) => `[@${a.key}] の前に字(${a.prefix})がある:字は角かっこの外に書く`, en: (a) => `text before the key in the citation of ${a.key} (“${a.prefix}”): write the text outside the brackets` },
@@ -57,7 +57,7 @@ export const ARTICLE_MESSAGES = {
57
57
  articleTableClass: { ja: (a) => `表の :class: の名前「${a.cls}」は英小文字・数字・- だけ(例:horizontal)`, en: (a) => `the table class “${a.cls}” must be lowercase letters, digits and - (e.g. horizontal)` },
58
58
  articleProofKind: { ja: (a) => `定理の類の種類 prf:${a.kind} は Egatari Text 1 にない(theorem・lemma・definition など 15 種)`, en: (a) => `prf:${a.kind} is not a theorem-like kind of Egatari Text 1 (theorem, lemma, definition, … 15 kinds)` },
59
59
  articleFootnoteContent: { ja: (a) => `脚注 [^${a.name}] の中に ${a.what} がある:脚注は段落だけ`, en: (a) => `the footnote [^${a.name}] holds a ${a.what}: footnotes hold paragraphs only` },
60
- articleFootnoteMissing: { ja: (a) => `脚注 [^${a.name}] の定義がない:[^${a.name}]: 本文 の行を足す`, en: (a) => `the footnote [^${a.name}] has no definition: add a line [^${a.name}]: text` },
60
+ articleFootnoteMissing: { ja: (a) => `脚注 [^${a.name}] の定義がない:[^${a.name}]: 本文 の行を追加する`, en: (a) => `the footnote [^${a.name}] has no definition: add a line [^${a.name}]: text` },
61
61
  articleFootnoteUnused: { ja: (a) => `脚注 [^${a.name}] の定義がどこからも参照されていない(表示されない)`, en: (a) => `the footnote definition [^${a.name}] is never referenced (it is not shown)` },
62
62
  articleFootnoteName: { ja: (a) => `脚注の名前「${a.name}」は英数字・_・- だけ`, en: (a) => `the footnote name “${a.name}” must be letters, digits, _ and -` },
63
63
  articleFootnoteDuplicate: { ja: (a) => `脚注 [^${a.name}] の定義が 2 つある`, en: (a) => `the footnote [^${a.name}] is defined twice` },
@@ -67,10 +67,10 @@ export const ARTICLE_MESSAGES = {
67
67
  articleFigureAlt: { ja: (a) => `図${a.label ? `(${a.label})` : ''}に :alt: がない:見えない人のために図の中身を書く`, en: (a) => `the figure${a.label ? ` ${a.label}` : ''} has no :alt: — describe the image for readers who cannot see it` },
68
68
  articleGlossary: { ja: (a) => { const w = WHY_GLOSS.ja[a.why]; return typeof w === 'function' ? w(a) : w; }, en: (a) => { const w = WHY_GLOSS.en[a.why]; return typeof w === 'function' ? w(a) : w; } },
69
69
  articleSolutionLabel: { ja: () => '解答(:::{solution})に問の名前がない::::{solution} exr-… と書く', en: () => 'a solution names no exercise: write :::{solution} exr-…' },
70
- articleConverted: { ja: (a) => `${a.from} を ${a.to} に直して読んだ(原稿も直す)`, en: (a) => `read ${a.from} as ${a.to} (fix the source too)` },
70
+ articleConverted: { ja: (a) => `${a.from} を ${a.to} に修正して読んだ(原稿も修正する)`, en: (a) => `read ${a.from} as ${a.to} (fix the source too)` },
71
71
  articleIndex: { ja: (a) => (a.why === 'both' ? 'article.md と article/ の章のファイルの両方がある:1 つのファイルか章に分けるかのどちらかにする' : '本文のファイルがない(index.article に path も chapters もない)'), en: (a) => (a.why === 'both' ? 'both article.md and chapter files in article/: use one file or chapters, not both' : 'index.article has neither path nor chapters') },
72
- articleConfig: { ja: (a) => `egatari.json の article(本文のファイルと読む順)${{ shape: 'が object でない', path: `の path(${a.path})が article.md でない`, chapters: 'の chapters が article/<名前>.md の重ならない並びでない', missing: `のファイル ${a.path} が作業フォルダにない`, unreadable: 'が読めない(egatari.json が JSON でない)' }[a.why]}:直すか、article の項目を消す(読む順は種類とファイルの名前の順になる)`, en: (a) => `egatari.json article (the book's files and reading order): ${{ shape: 'not an object', path: `path (${a.path}) is not article.md`, chapters: 'chapters is not a list of distinct article/<name>.md paths', missing: `${a.path} is not in the working folder`, unreadable: 'unreadable (egatari.json is not JSON)' }[a.why]}; fix it or remove the article member (the order then follows kind and file name)` },
73
- articleUnlisted: { ja: () => '本文のファイルが egatari.json の article に載っていない(本に入らない):chapters に足すか、ファイルを外す', en: () => 'this article file is not listed in egatari.json article (it is not part of the book): add it to chapters or move the file' },
72
+ articleConfig: { ja: (a) => `egatari.json の article(本文のファイルと読む順)${{ shape: 'が object でない', path: `の path(${a.path})が article.md でない`, chapters: 'の chapters が article/<名前>.md の重ならない並びでない', missing: `のファイル ${a.path} が作業フォルダにない`, unreadable: 'が読めない(egatari.json が JSON でない)' }[a.why]}:修正するか、article の項目を削除する(読む順は種類とファイルの名前の順になる)`, en: (a) => `egatari.json article (the book's files and reading order): ${{ shape: 'not an object', path: `path (${a.path}) is not article.md`, chapters: 'chapters is not a list of distinct article/<name>.md paths', missing: `${a.path} is not in the working folder`, unreadable: 'unreadable (egatari.json is not JSON)' }[a.why]}; fix it or remove the article member (the order then follows kind and file name)` },
73
+ articleUnlisted: { ja: () => '本文のファイルが egatari.json の article に載っていない(本に含まれない):chapters に追加するか、ファイルを移動する', en: () => 'this article file is not listed in egatari.json article (it is not part of the book): add it to chapters or move the file' },
74
74
  articleRead: { ja: (a) => `本文のファイルが読めない:${a.why}`, en: (a) => `cannot read the article file: ${a.why}` },
75
75
  articleUnsafeParagraph: {
76
76
  ja: (a) => `${a.heading ? `節${quoteJa(a.heading)}の` : ''}段落${quoteJa(a.text + '…')}に${a.what === 'html' ? 'タグの始まり(<! と <?)' : '引用符(" と \')'}が ${a.count} 個ある。1 つの段落に ${a.max} 個を越えると安全に読めないので、本を読み込まない:段落を分けるか、${a.what === 'html' ? 'タグ' : '引用符'}を減らす`,
@@ -87,27 +87,27 @@ export const ARTICLE_MESSAGES = {
87
87
  articleSectionKindContext: { ja: () => '節の kind の行は 1 ファイルの本文(article.path)で、ファイルの kind が chapter のときだけ書ける', en: () => 'a section kind line is allowed only in a one-file article (article.path) whose file kind is chapter' },
88
88
  articleChapterOrder: { ja: (a) => `kind: ${a.kind} のファイルの順が違う:前書き・章・付録・後書きの順にファイルの名前を付ける`, en: (a) => `the kind: ${a.kind} file is out of order: name the files so that prefaces, chapters, appendices and afterwords come in that order` },
89
89
  articleChapterDiffer: { ja: (a) => `章のファイルで ${a.member} が違う(${a.values.join('・')}):すべての章で同じにする`, en: (a) => `${a.member} differs between chapter files (${a.values.join(', ')}): use the same value in every chapter` },
90
- articleLang: { ja: (a) => `前付けの lang(${a.lang})が教材の言語(${a.deck})と違う:同じにするか、lang を外す`, en: (a) => `front matter lang (${a.lang}) differs from the lesson language (${a.deck}): make them equal or remove lang` },
91
- articleBibliography: { ja: (a) => `前付けの bibliography(${a.value})が文献のファイル(${a.references || 'なし'})と違う:references.json にするか外す`, en: (a) => `front matter bibliography (${a.value}) is not the references file (${a.references || 'none'}): use references.json or remove it` },
90
+ articleLang: { ja: (a) => `前付けの lang(${a.lang})がスライドの言語(${a.deck})と違う:同じにするか、lang を削除する`, en: (a) => `front matter lang (${a.lang}) differs from the slides' language (${a.deck}): make them equal or remove lang` },
91
+ articleBibliography: { ja: (a) => `前付けの bibliography(${a.value})が文献のファイル(${a.references || 'なし'})と違う:references.json にするか削除する`, en: (a) => `front matter bibliography (${a.value}) is not the references file (${a.references || 'none'}): use references.json or remove it` },
92
92
  articleLabelDuplicate: { ja: (a) => `名前「${a.label}」が 2 度使われている(${a.other}${a.otherLine ? ` ${a.otherLine} 行目` : ''}):本文全体で 1 つにする`, en: (a) => `the label “${a.label}” is used twice (also ${a.other}${a.otherLine ? ` line ${a.otherLine}` : ''}): labels are unique in the whole article` },
93
93
  articleLabelSlideId: { ja: (a) => `名前「${a.label}」がスライドの id と同じ:別の名前にする`, en: (a) => `the label “${a.label}” is also a slide id: rename it` },
94
94
  articleXref: { ja: (a) => `相互参照 [](#${a.label}) の行き先がない:ある名前(:label: や (…)= で付けたもの)を書く`, en: (a) => `the cross-reference [](#${a.label}) points to no label: use a label given with :label: or (…)=` },
95
95
  articleSolution: { ja: (a) => `解答の問「${a.label}」${WHY_SOL.ja[a.why]}`, en: (a) => `the solution's exercise “${a.label}” ${WHY_SOL.en[a.why]}` },
96
- articleTerm: { ja: (a) => (a.glossary ? `用語「${a.term}」が用語集にない:用語集に足すか、字を合わせる` : `用語「${a.term}」を使っているが用語集(:::{glossary})がない`), en: (a) => (a.glossary ? `the term “${a.term}” is not in the glossary: add it or match the spelling` : `the term “${a.term}” is used but there is no glossary (:::{glossary})`) },
96
+ articleTerm: { ja: (a) => (a.glossary ? `用語「${a.term}」が用語集にない:用語集に追加するか、字を合わせる` : `用語「${a.term}」を使っているが用語集(:::{glossary})がない`), en: (a) => (a.glossary ? `the term “${a.term}” is not in the glossary: add it or match the spelling` : `the term “${a.term}” is used but there is no glossary (:::{glossary})`) },
97
97
  articleStep: { ja: (a) => `ステップへのリンク ${a.value} ${WHY_STEP.ja(a)}`, en: (a) => `the step link ${a.value}${WHY_STEP.en(a)}` },
98
98
  articleCite: { ja: (a) => (a.why === 'no-references' ? `引用 @${a.key} があるが文献のファイル(references.json)がない` : `引用キー @${a.key} が references.json にない`), en: (a) => (a.why === 'no-references' ? `the citation @${a.key} needs a bibliography, but there is no references.json` : `the citation key @${a.key} is not in references.json`) },
99
99
  articleReferences: { ja: (a) => `references.json が読めない(${a.why}):CSL-JSON の配列にする`, en: (a) => `cannot read references.json (${a.why}): it must be a CSL-JSON array` },
100
100
  articleImage: { ja: (a) => `画像 ${a.path} が作業フォルダにない`, en: (a) => `the image ${a.path} is not in the working folder` },
101
101
  articleDataArticle: { ja: (a) => `スライド ${a.slide} の data-article の節「${a.section}」が本文にない`, en: (a) => `slide ${a.slide}: data-article names “${a.section}”, which is not a section of the article` },
102
102
  articleCitations: { ja: (a) => (a.why === 'list' ? `egatari.json の metadata.citations.list「${a.value}」が違う(end・chapter・none のどれか)` : 'egatari.json の metadata.citations が object でない({"style": "apa", "list": "end"} のように書く)'), en: (a) => (a.why === 'list' ? `egatari.json metadata.citations.list “${a.value}” is not one of end, chapter, none` : 'egatari.json metadata.citations is not an object (write e.g. {"style": "apa", "list": "end"})') },
103
- articleCiteStyle: { ja: (a) => `引用の書式「${a.style}」はこの Studio にない:${a.fallback} で書いた(使える書式:${a.styles.join('・')}。style はそのまま残す)`, en: (a) => `this Studio does not have the citation style “${a.style}”: used ${a.fallback} instead (available: ${a.styles.join(', ')}; style is kept as written)` },
103
+ articleCiteStyle: { ja: (a) => `引用の書式「${a.style}」はこの Studio にない:${a.fallback} で書いた(使える書式:${a.styles.join('・')}。style はそのまま保持する)`, en: (a) => `this Studio does not have the citation style “${a.style}”: used ${a.fallback} instead (available: ${a.styles.join(', ')}; style is kept as written)` },
104
104
  articleCiteListChapter: { ja: () => 'metadata.citations.list が chapter だが、本文が章に分かれていない(article/ の章のファイルのときだけ):end にする', en: () => 'metadata.citations.list is chapter, but the article has no chapters (only with chapter files in article/): use end' },
105
- articleCiteEngine: { ja: (a) => `引用を書式に整えられなかった(${a.why}):引用キーの字のまま書いた。references.json の項目を確かめる`, en: (a) => `could not format citations (${a.why}); wrote the citation keys instead: check the items in references.json` },
105
+ articleCiteEngine: { ja: (a) => `引用を書式に整えられなかった(${a.why}):引用キーの字のまま書いた。references.json の項目を確認する`, en: (a) => `could not format citations (${a.why}); wrote the citation keys instead: check the items in references.json` },
106
106
  articleUncited: { ja: (a) => `本文で引いていない文献が ${a.count} 件ある(${a.keys.join('・')}${a.count > a.keys.length ? ' …' : ''}):一覧には出ない`, en: (a) => `${a.count} ${plural(a.count, 'reference')} never cited (${a.keys.join(', ')}${a.count > a.keys.length ? ', …' : ''}); ${a.count === 1 ? 'it is' : 'they are'} not listed` },
107
- articleLinksShape: { ja: (a) => `egatari.json の articleLinks の形が違う(${a.why}):その項目を消し、npm run ids で付け直す`, en: (a) => `egatari.json articleLinks has the wrong shape (${a.why}): remove it and run npm run ids to record the links again` },
108
- articleLinkStale: { ja: (a) => `スライドと本が合っていないかもしれません:スライド ${a.slide} と節${quoteJa(a.heading || a.section)}(${a.section})。つないだ後に${a.changed === 'article' ? '節' : a.changed === 'slide' ? 'スライドか台本' : '節とスライドの両方'}が変わった。読み比べて、合っていれば npm run ids -- --confirm-links で確かめた印を付ける(字は自動では直さない)`, en: (a) => `slides and book may not match: slide ${a.slide} and the section “${a.heading || a.section}” (${a.section}); ${a.changed === 'article' ? 'the section' : a.changed === 'slide' ? 'the slide or its script' : 'both the section and the slide'} changed after they were linked. Compare them; if they still agree, run npm run ids -- --confirm-links (nothing is changed automatically)` },
107
+ articleLinksShape: { ja: (a) => `egatari.json の articleLinks の形が違う(${a.why}):その項目を削除し、npm run ids で付け直す`, en: (a) => `egatari.json articleLinks has the wrong shape (${a.why}): remove it and run npm run ids to record the links again` },
108
+ articleLinkStale: { ja: (a) => `スライドと本が合っていないかもしれません:スライド ${a.slide} と節${quoteJa(a.heading || a.section)}(${a.section})。対応付けた後に${a.changed === 'article' ? '節' : a.changed === 'slide' ? 'スライドか台本' : '節とスライドの両方'}が変わった。読み比べて、合っていれば npm run ids -- --confirm-links で確認済みの印を付ける(字は自動では修正しない)`, en: (a) => `slides and book may not match: slide ${a.slide} and the section “${a.heading || a.section}” (${a.section}); ${a.changed === 'article' ? 'the section' : a.changed === 'slide' ? 'the slide or its script' : 'both the section and the slide'} changed after they were linked. Compare them; if they still agree, run npm run ids -- --confirm-links (nothing is changed automatically)` },
109
109
  articleLinkUnconfirmed: { ja: (a) => `スライドと節のつながり ${a.count} 組がまだ記録されていない(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):npm run ids で記録すると、後でどちらかが変わったときに知らせる`, en: (a) => `${a.count} slide–section ${plural(a.count, 'link')} ${a.count === 1 ? 'is' : 'are'} not recorded yet (${a.pairs.join(', ')}${a.count > a.pairs.length ? ', …' : ''}): run npm run ids to record them, so that later changes on either side are reported` },
110
- articleLinkUnlinked: { ja: (a) => `egatari.json の articleLinks に、もうつながっていない組が ${a.count} 組ある(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):Egatari ファイルにエクスポートするときに外す`, en: (a) => `egatari.json articleLinks records ${a.count} ${plural(a.count, 'pair')} that ${a.count === 1 ? 'is' : 'are'} no longer linked (${a.pairs.join(', ')}${a.count > a.pairs.length ? ', …' : ''}); ${a.count === 1 ? 'it is' : 'they are'} dropped when the Egatari file is written` },
110
+ articleLinkUnlinked: { ja: (a) => `egatari.json の articleLinks に、もうつながっていない組が ${a.count} 組ある(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):Egatari ファイルにエクスポートするときに削除する`, en: (a) => `egatari.json articleLinks records ${a.count} ${plural(a.count, 'pair')} that ${a.count === 1 ? 'is' : 'are'} no longer linked (${a.pairs.join(', ')}${a.count > a.pairs.length ? ', …' : ''}); ${a.count === 1 ? 'it is' : 'they are'} dropped when the Egatari file is written` },
111
111
  articleSummary: { ja: (a) => `本文:ファイル ${a.files}、節 ${a.sections}、名前 ${a.labels}`, en: (a) => `article: ${a.files} ${plural(a.files, 'file')}, ${a.sections} ${plural(a.sections, 'section')}, ${a.labels} ${plural(a.labels, 'label')}` },
112
112
  articleSectionUnlinked: { ja: (a) => `節${quoteJa(a.heading)}(${a.section})がどのスライドともつながっていない({step} のリンクか、スライドの data-article で結ぶ)`, en: (a) => `the section “${a.heading}” (${a.section}) is linked to no slide (add a {step} link or name it in a slide's data-article)` },
113
113
  };
@@ -23,7 +23,7 @@ export const IN_EDITOR = Object.freeze([
23
23
  'smallText', 'smallSvgText', 'textClipped', 'svgTextOut', 'svgTextBox', 'outsideBody', 'partSvgOut', 'colOverflow', 'textOffSlide', 'textOverlap', 'cellWordBreak',
24
24
  'secHeading', 'textContrast', 'cardsHint',
25
25
  // 描いた図の形(kit/core/geometry-check.mjs。R-geometry)
26
- 'geoEdgeThroughBox', 'geoLineOverLabel', 'geoLabelOverlap', 'geoLabelOutsideBox', 'geoTateSlides',
26
+ 'geoEdgeThroughBox', 'geoLineOverLabel', 'geoLabelOverlap', 'geoLabelOutsideBox', 'geoOutsideFrame', 'geoBadMarkName', 'geoClippedStroke', 'geoTateSlides',
27
27
  // プレビューの中(app/frame-shim.js)
28
28
  'themeMetricsDrift', 'metricsFontLoad', 'fontNotEmbedded', 'desuMasu', 'rawMath', 'katexError', 'punctMixed', 'narrRecheck',
29
29
  'linkEmpty', 'linkUnknown', 'linkNumberRange', 'linkNoConcl', 'linkStepRange', 'linkBadStep', 'linkNumber', 'linkNoId', 'linkCount',
@@ -11,13 +11,17 @@
11
11
  // ruleSet() → 台帳の版(決まりの id と code の並びの sha256 の先頭 12。where や phase が変わっても変わらない)は呼ぶ側が sha256 で作る:ruleSetText()
12
12
  // account({results, visited, facts, inEditor}) → {status, rules, summary, problems}
13
13
  // results:[{sev: 'error'|'warn'|'info', code}]。visited:通った段の名前の集合(編集アプリは null:その版の編集アプリが見る決まりはどれも通ったとみなす)
14
- // facts:{narration, audio, attachments, parts: [タグ…], partMarks, marks, morphs, links, book, tate, allTate, lang}
15
- // partMarks:図の形の印(data-part="box|edge|label|mark")が原稿にある。allTate:中身のスライド(表紙・章の扉を除く)がみな縦書き
14
+ // facts:{narration, audio, attachments, parts: [タグ…], partMarks, svg, marks, morphs, links, book, tate, allTate, lang}
15
+ // partMarks:図の形の印(data-part="box|edge|label|mark")か、枠の中の印(kit/core/geometry-check.mjs の WITHIN_ATTRS の within・frame。名前の形に合わない値の知らせ geoBadMarkName があるので枠だけでも)が原稿にある。allTate:中身のスライド(表紙・章の扉を除く)がみな縦書き。
16
+ // svg:原稿にインラインの <svg> がある(作成者の図。線が図の端で欠けるかを測る)
16
17
  // inEditor:編集アプリの品質チェック(コマンド版だけの決まりは skipped/notInEditor)
17
18
  // factsFromSource({deck, narration, audio, attachments, book}) → facts:原稿と台本の文字列から(コマンド版と編集アプリで同じ判定にする)。
18
19
  // audio・attachments・book は呼ぶ側がファイルの有無から(audio/manifest.json か voice.json・attachments/・article.md か article/)
19
20
  // excused か skipped の決まりに code が出たら problems(台帳の誤り)。problems があるか、どれにもならない決まりがあれば status は incomplete
20
21
  import { cliOnly } from './check-parity.mjs';
22
+ import { WITHIN_ATTRS } from './geometry-check.mjs';
23
+ // 枠の中の印(handoff #46)が原稿にあるか(属性の名前は WITHIN_ATTRS の 1 か所)
24
+ const WITHIN_RE = new RegExp('\\s(?:' + WITHIN_ATTRS.within + '|' + WITHIN_ATTRS.frame + ')\\s*=');
21
25
 
22
26
  export const EXCUSES = Object.freeze(['noNarration', 'noAudio', 'noAttachments', 'noParts', 'noMarks', 'noMorphs', 'noLinks', 'noBook', 'tate', 'lang']);
23
27
  // tate は EXCUSES にも SKIPS にもある(state で区別する)。SKIPS の tate は「まだ測っていない」:縦書きの字も重なりうるので、
@@ -50,10 +54,11 @@ export const RULES = Object.freeze([
50
54
  { id: 'R-style', kind: 'authoring', phase: 'A 体裁', codes: ['desuMasu', 'punctMixed'], applies: (f) => (f.lang === 'ja' ? null : 'lang') },
51
55
  { id: 'R-math', kind: 'authoring', phase: 'A 体裁', codes: ['rawMath', 'katexError'] },
52
56
  { id: 'R-purpose', kind: 'authoring', phase: 'A 体裁', codes: ['cardsHint'] },
53
- // 描いた図の形(kit/core/geometry-check.mjs、backlog #201):パーツが付けた印(data-part)を測る。パーツも印もない教材は noParts。
57
+ // 描いた図の形(kit/core/geometry-check.mjs、backlog #201):パーツが付けた印(data-part)と、インラインの SVG の線が図の端で欠けるか(geoClippedStroke、handoff #52)を測る。
58
+ // パーツも印もインラインの SVG もない教材は noParts。
54
59
  // 中身のスライドがみな縦書きなら skipped/tate(まだ測らない)。縦横が混ざれば横書きのスライドだけを見て geoTateSlides(情報)
55
- { id: 'R-geometry', kind: 'authoring', phase: 'A 体裁', codes: ['geoEdgeThroughBox', 'geoLineOverLabel', 'geoLabelOverlap', 'geoLabelOutsideBox', 'geoTateSlides'],
56
- applies: (f) => ((f.parts || []).length || f.partMarks ? null : 'noParts'), skips: (f) => (f.allTate ? 'tate' : null) },
60
+ { id: 'R-geometry', kind: 'authoring', phase: 'A 体裁', codes: ['geoEdgeThroughBox', 'geoLineOverLabel', 'geoLabelOverlap', 'geoLabelOutsideBox', 'geoOutsideFrame', 'geoBadMarkName', 'geoClippedStroke', 'geoTateSlides'],
61
+ applies: (f) => ((f.parts || []).length || f.partMarks || f.svg ? null : 'noParts'), skips: (f) => (f.allTate ? 'tate' : null) },
57
62
  { id: 'R-colors', kind: 'authoring', phase: 'C パレット', codes: ['colorOutside', 'textContrast', 'contrastLow'] },
58
63
  { id: 'R-balance', kind: 'authoring', phase: 'N 釣り合い', codes: ['balance'] },
59
64
  // 台本がない教材にも、ステップごとに narrMissing が出る(台本を書くこと自体がこの決まり)。だから外さない。言語と確かめ直しの知らせも台本なしで出る
@@ -97,7 +102,7 @@ export function factsFromSource({ deck = '', narration = '', audio = false, atta
97
102
  narration: /\S/.test(narration), audio: !!audio, attachments: !!attachments, book: !!book,
98
103
  parts: [...new Set([...deck.matchAll(/<(m-[a-z][a-z0-9]*(?:-[a-z0-9]+)*)[\s>/]/g)].map((m) => m[1]))].sort(),
99
104
  marks: /\{mark:/.test(narration), morphs: /\bdata-morph\b/.test(deck), links: /<a\b[^>]*\shref=/i.test(deck),
100
- partMarks: /\sdata-part=["']?(?:box|edge|label|mark)\b/.test(deck),
105
+ partMarks: /\sdata-part=["']?(?:box|edge|label|mark)\b/.test(deck) || WITHIN_RE.test(deck), svg: /<svg[\s>]/i.test(deck),
101
106
  tate: /\blayout-tate\b/.test(deck), allTate: content.length > 0 && content.every((c) => c.includes('layout-tate')), lang: /^ja\b/i.test(lang) || !lang ? 'ja' : 'en',
102
107
  };
103
108
  }
@@ -45,7 +45,7 @@ export const JOB = Object.freeze({ tag: 'tts-job', recordsTag: 'tts-records', v:
45
45
  export const COLAB = Object.freeze({
46
46
  repo: 'egatari/egatari-studio', notebook: 'colab/egatari-tts.ipynb',
47
47
  videoNotebook: 'colab/egatari-video.ipynb', // 動画(MP4)を作るノート(CPU のランタイム。#131)
48
- ref: 'v0.6.15', // バッジの URL は版のタグに固定する(リリースの手順で替える。RELEASING.md)
48
+ ref: 'v0.6.16', // バッジの URL は版のタグに固定する(リリースの手順で替える。RELEASING.md)
49
49
  pause: 0.35,
50
50
  models: Object.freeze({ irodori: 'irodori-tts-500m-v3', kokoro: 'kokoro-82m-v1.0' }),
51
51
  // 後処理の版(records の recipe.processing は PROCESSING に '+colab<ノートブックの版>' を付けたもの):ノートブック(colab/egatari_tts.py)の後処理は audio-core.mjs と同じ数。数を変えたら名前も変える
@@ -160,7 +160,7 @@ export async function planImport({ zip, segs, docId = null, yomi = null }) {
160
160
  const pr = parseRecords(new TextDecoder().decode(rj));
161
161
  if (pr.fatal) { out.reject = { code: 'bad-records', why: pr.problems[0].why }; return out; }
162
162
  out.generator = pr.generator;
163
- if (docId !== null && pr.docId !== null && docId !== pr.docId) { out.reject = { code: 'doc-id', why: 'the job was made for another lesson (docId differs)', title: pr.title }; return out; }
163
+ if (docId !== null && pr.docId !== null && docId !== pr.docId) { out.reject = { code: 'doc-id', why: 'the job was made for another file (docId differs)', title: pr.title }; return out; }
164
164
  for (const p of pr.problems) out.skipped.push({ key: p.key || null, why: p.why });
165
165
  const byKey = new Map(segs.map((s) => [`${s.slideKey}:${s.stepKey}`, s]));
166
166
  for (const [key, rec] of pr.records) {
@@ -35,10 +35,10 @@ function fit(name, ext) {
35
35
  }
36
36
  export function exportName(title, fallback, ext) {
37
37
  const e = String(ext || '');
38
- for (const cand of [title, fallback, 'lesson']) {
38
+ for (const cand of [title, fallback, 'untitled']) {
39
39
  const n = fit(clean(cand), e);
40
40
  if (n && !RESERVED.test(n)) return n + e;
41
41
  if (n) return n + '_' + e; // CON → CON_.ega.html
42
42
  }
43
- return 'lesson' + e;
43
+ return 'untitled' + e;
44
44
  }