egatari 0.6.10 → 0.6.11-rc.1
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/README.ja.md +22 -22
- package/README.md +1 -1
- package/bin/egatari.mjs +1 -1
- package/components.lock.json +288 -144
- package/components2.lock.json +657 -1
- package/kit/build.mjs +3 -2
- package/kit/check-messages.mjs +46 -12
- package/kit/check.mjs +54 -19
- package/kit/core/article-messages.mjs +5 -4
- package/kit/core/attachments.mjs +2 -1
- package/kit/core/build-core.mjs +2 -1
- package/kit/core/check-parity.mjs +3 -1
- package/kit/core/check-result.mjs +2 -1
- package/kit/core/check-rules.mjs +132 -0
- package/kit/core/colab-core.mjs +2 -2
- package/kit/core/geometry-check.mjs +302 -0
- package/kit/core/layout-scan.mjs +9 -2
- package/kit/core/live-results.mjs +1 -1
- package/kit/core/llm-fix.mjs +3 -2
- package/kit/core/llm-outline.mjs +3 -2
- package/kit/core/llm-pack-data.mjs +114 -114
- package/kit/core/narration-lint.mjs +37 -0
- package/kit/core/new-deck-pack.mjs +2 -1
- package/kit/core/new-deck.mjs +1 -1
- package/kit/core/plural.mjs +5 -0
- package/kit/core/portable.mjs +6 -5
- package/kit/core/sample-layout.mjs +14 -0
- package/kit/core/text-band.mjs +37 -0
- package/kit/core/tier-a.mjs +2 -1
- package/kit/instruction-version.json +1 -1
- package/kit/player.json +1 -1
- package/kit/player.lock.json +2 -2
- package/kit/render-compare.mjs +5 -4
- package/kit/tools.js +2 -2
- package/package.json +3 -2
- package/server/editor-ui.js +2 -2
- package/vendor/components/CATALOG.md +12 -12
- package/vendor/components/sha256/00d9072cb279a1a68166787f53395c747072388971d916c082a106844dbf888f/index.js +315 -0
- package/vendor/components/sha256/03e20fb6803de0d94e93de7c01d7d00cede57b0b2604b449daa4cb156367500d/README.en.md +23 -0
- package/vendor/components/sha256/03e20fb6803de0d94e93de7c01d7d00cede57b0b2604b449daa4cb156367500d/index.js +289 -0
- package/vendor/components/sha256/0e5458deb63e32aefdbf8722fa156fd44cd90d5d8f9d6a25a636007b4b599450/README.en.md +40 -0
- package/vendor/components/sha256/0e5458deb63e32aefdbf8722fa156fd44cd90d5d8f9d6a25a636007b4b599450/index.js +341 -0
- package/vendor/components/sha256/1073e03374f0fe65d2691f160bfd8c092986c168d0bd6a6094ebd444d4b89c27/index.js +592 -0
- package/vendor/components/sha256/12b1b32eb3a75e9f11eff407b7876473674ae996d7ce276e2ab6ffaf41ad4376/README.en.md +48 -0
- package/vendor/components/sha256/12b1b32eb3a75e9f11eff407b7876473674ae996d7ce276e2ab6ffaf41ad4376/index.js +384 -0
- package/vendor/components/sha256/147987bd84722249dab609293d4fafa93f0a2aac25b8517fda1710840b575d00/index.js +341 -0
- package/vendor/components/sha256/170e9072285213a2b4e79d7c2e4ddb882d1501e60b5da63c59b1679643163005/README.en.md +23 -0
- package/vendor/components/sha256/170e9072285213a2b4e79d7c2e4ddb882d1501e60b5da63c59b1679643163005/index.js +120 -0
- package/vendor/components/sha256/17da8ef5ce58354df54ebb52c8a9b0726e69d06ac28cc8e78f807ec338002782/README.en.md +32 -0
- package/vendor/components/sha256/17da8ef5ce58354df54ebb52c8a9b0726e69d06ac28cc8e78f807ec338002782/index.js +222 -0
- package/vendor/components/sha256/1b30dfd9b366ff07556024eb8ce75cca2eac8001fa392eed4e1232047001ec74/index.js +404 -0
- package/vendor/components/sha256/37846655693f8dd869d11d3d4cddb43be57f848037d0e49564b2250401448ab5/README.en.md +66 -0
- package/vendor/components/sha256/37846655693f8dd869d11d3d4cddb43be57f848037d0e49564b2250401448ab5/index.js +920 -0
- package/vendor/components/sha256/3fdd15756f779a16362dd854f143ca4343154059882d88d44adf64745c7876e3/README.en.md +50 -0
- package/vendor/components/sha256/3fdd15756f779a16362dd854f143ca4343154059882d88d44adf64745c7876e3/index.js +171 -0
- package/vendor/components/sha256/435c3f8e0c0abc123866e57ae2c7f3409e19d14a2eb67b1fde84c4da5d95f14c/README.en.md +31 -0
- package/vendor/components/sha256/435c3f8e0c0abc123866e57ae2c7f3409e19d14a2eb67b1fde84c4da5d95f14c/index.js +232 -0
- package/vendor/components/sha256/43740da51de85c1b7ec1eaf688f93fd9ea25b15977ab075e6abac196f08643a6/index.js +122 -0
- package/vendor/components/sha256/4817f77bd021ec5c77d5a15ee56e2e34d31d1d98630e86225eb20f2f9bf095e9/index.js +812 -0
- package/vendor/components/sha256/4e4bf3b2968c36a334dc997e32e36f22ecbc4f5dfe1c76bb7a5beef002fe8899/index.js +228 -0
- package/vendor/components/sha256/553e132d1f84caad648bb7175a206d4c5d18c005b5ca17989f5e8a5e3f5cdfa1/index.js +75 -0
- package/vendor/components/sha256/5b02d8a81a41f4d1658f1972f3fc91de3cc431b2c71bb6b92601d58f734de9ec/README.en.md +34 -0
- package/vendor/components/sha256/5b02d8a81a41f4d1658f1972f3fc91de3cc431b2c71bb6b92601d58f734de9ec/index.js +244 -0
- package/vendor/components/sha256/5c72414df5a948a7cbb882be1e5bdd4113d188e357d4a0f01fabda15781417eb/LICENSE-tabler.txt +21 -0
- package/vendor/components/sha256/5c72414df5a948a7cbb882be1e5bdd4113d188e357d4a0f01fabda15781417eb/index.js +4868 -0
- package/vendor/components/sha256/5c72414df5a948a7cbb882be1e5bdd4113d188e357d4a0f01fabda15781417eb/names.txt +4808 -0
- package/vendor/components/sha256/636f47e955f5550f046cfc7a3de8de70c4b97aa77771bde2ee0e31d706bb032e/index.js +278 -0
- package/vendor/components/sha256/65ddc34bd9c75e073f4c2cd283369417fe88769521809670c6b8730852d4f647/index.js +97 -0
- package/vendor/components/sha256/6b0c75b0f697fe451197301de82a113f1c2548b67f7a8d2b56576d2bae8e240c/index.js +607 -0
- package/vendor/components/sha256/6cdf432d3e61be3ff15e80910369324ac7ea0e8b9f62c32ef37bf09a5bfe93b9/README.en.md +33 -0
- package/vendor/components/sha256/6cdf432d3e61be3ff15e80910369324ac7ea0e8b9f62c32ef37bf09a5bfe93b9/index.js +390 -0
- package/vendor/components/sha256/6d648d0e5c96ec680c04a14b7c3d672010d3b9f101197689e9672ec00174383d/README.en.md +31 -0
- package/vendor/components/sha256/6d648d0e5c96ec680c04a14b7c3d672010d3b9f101197689e9672ec00174383d/index.js +267 -0
- package/vendor/components/sha256/71208afc5c8ea1ed6d2180f46de7385e43990cfb046ba350eefb917eca5d92fe/README.en.md +22 -0
- package/vendor/components/sha256/71208afc5c8ea1ed6d2180f46de7385e43990cfb046ba350eefb917eca5d92fe/index.js +145 -0
- package/vendor/components/sha256/7552a029f30f9c2f2ec8c5af4f144b63eeffc9172b53e35a925821f69a738b64/README.en.md +44 -0
- package/vendor/components/sha256/7552a029f30f9c2f2ec8c5af4f144b63eeffc9172b53e35a925821f69a738b64/index.js +203 -0
- package/vendor/components/sha256/781a45d97f1325cfb40aa98d00e1db9600949158fdb2749b0223b019c67a80f2/index.js +919 -0
- package/vendor/components/sha256/850944419734168be3dc202057de128131869c471cb8ab3baec2cfe789d56493/index.js +465 -0
- package/vendor/components/sha256/863d4d42075fbae1084089730f10da943c88d3e3e655235f28c24b9a3cf95c88/README.en.md +37 -0
- package/vendor/components/sha256/863d4d42075fbae1084089730f10da943c88d3e3e655235f28c24b9a3cf95c88/index.js +424 -0
- package/vendor/components/sha256/8a892d25d0bb6105ba31ea690b465876ce3af1fbaf18e2a9ce44ad2fee81260e/index.js +162 -0
- package/vendor/components/sha256/8acec8f299510287fbad6a69311ec58a39b0e99647dd03609c818e053b3b6087/index.js +484 -0
- package/vendor/components/sha256/8ef66bd1e800bcbedef436585469d308665aaa1ab6011aee699544302d0a8ad0/index.js +312 -0
- package/vendor/components/sha256/8fa5ed6ab12a27542e077ff965bea626ff9450b330609304dc1148fc8dbb68b0/README.en.md +40 -0
- package/vendor/components/sha256/8fa5ed6ab12a27542e077ff965bea626ff9450b330609304dc1148fc8dbb68b0/index.js +348 -0
- package/vendor/components/sha256/a0c71874d83045baaef70285bd00d87a7c6c43219fa5630dfff60d5cb08509be/index.js +250 -0
- package/vendor/components/sha256/a31f39625d7d1087d06a72b644cec417372f98add940288257ef07f812d8395a/index.js +747 -0
- package/vendor/components/sha256/ae04a57be4a26b7443796a93c58adcf1cbcf746120eba619bf9c2bcdce53c640/README.en.md +38 -0
- package/vendor/components/sha256/ae04a57be4a26b7443796a93c58adcf1cbcf746120eba619bf9c2bcdce53c640/index.js +289 -0
- package/vendor/components/sha256/ae06622a328da2a01260bc68b28bb632c391e8d62a4e8387638e5a944525a418/index.js +521 -0
- package/vendor/components/sha256/b490139e9afa84164054738532d5ec4985bf071e40791d903012fe3b850bae43/README.en.md +24 -0
- package/vendor/components/sha256/b490139e9afa84164054738532d5ec4985bf071e40791d903012fe3b850bae43/index.js +103 -0
- package/vendor/components/sha256/b756c66d5c6e6ace90912ab467dea3031f2c9b291d8b2a786ca660faa0e8ac84/index.js +121 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/chords.json +89 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/extras.json +192 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/fixtures/ties.json +360 -0
- package/vendor/components/sha256/babd98da50ea334b63f79c66be436d092e8aea32654e011a6444667abb882e77/index.js +508 -0
- package/vendor/components/sha256/bea7cb344f55677d5756c9711b90cc971126830ec5f66a03f71f13dbfadc401e/index.js +351 -0
- package/vendor/components/sha256/c08b25a2f7be68c36634cdee180aa617fd018d80b7ddf2a484a2edb4acffdbe0/README.en.md +42 -0
- package/vendor/components/sha256/c08b25a2f7be68c36634cdee180aa617fd018d80b7ddf2a484a2edb4acffdbe0/index.js +268 -0
- package/vendor/components/sha256/cbe8bb4b2fd0845a9333bc2064d86758ea6465992ad86a99167ba17f57f3e382/README.en.md +51 -0
- package/vendor/components/sha256/cbe8bb4b2fd0845a9333bc2064d86758ea6465992ad86a99167ba17f57f3e382/index.js +228 -0
- package/vendor/components/sha256/d2df3d70fc7c6e07e3cad7332a7e5501e84abeb24653786e567f57046adebcba/index.js +268 -0
- package/vendor/components/sha256/d386f2b94cd9fbed765ad301aa7009228599edb2859efe7f37a98d7aaa44b9bb/README.en.md +35 -0
- package/vendor/components/sha256/d386f2b94cd9fbed765ad301aa7009228599edb2859efe7f37a98d7aaa44b9bb/index.js +179 -0
- package/vendor/components/sha256/e6d219f67d241fdf00a40d4cec261d9dd3c09ad3110d3418d4e843d0f2b8c196/index.js +429 -0
- package/vendor/components/sha256/ef60e6c089f5f6e909f439af8fc0c9c0a2d7a1aafad5e65be6328ba993b990a0/index.js +354 -0
- package/vendor/components/sha256/f6f47601c90f0195353e94b76d57499591d6330a7e35714958a2c41229f70da2/index.js +198 -0
- package/vendor/components/sha256/f9159c87fa998487787f738fdfab52aa2483f52f170fc258840b127f6ed06051/README.en.md +44 -0
- package/vendor/components/sha256/f9159c87fa998487787f738fdfab52aa2483f52f170fc258840b127f6ed06051/index.js +304 -0
- package/vendor/components/sha256/fb482cbe2ca1da07d08f41880e03fe75ff3f1d29842ff40946541e63030219b8/README.en.md +42 -0
- package/vendor/components/sha256/fb482cbe2ca1da07d08f41880e03fe75ff3f1d29842ff40946541e63030219b8/index.js +481 -0
- package/vendor/components/sha256/fdcea28e27638d8bfe234016672375e14de8bb97c32f7b6840d1b7b10ac4b1cd/index.js +233 -0
- package/vendor/components/sha256/ff5eaa083a46db6aefc13d97b27c9487f9fc318805f5c89b05a12e63703b7a72/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/ff5eaa083a46db6aefc13d97b27c9487f9fc318805f5c89b05a12e63703b7a72/OFL.txt +93 -0
- package/vendor/components/sha256/ff5eaa083a46db6aefc13d97b27c9487f9fc318805f5c89b05a12e63703b7a72/index.js +749 -0
- package/vendor/components/sha256/ff5eaa083a46db6aefc13d97b27c9487f9fc318805f5c89b05a12e63703b7a72/strokes-CHANGES.md +20 -0
- package/vendor/components-2/manifest-2.7.0.json +2118 -0
package/kit/build.mjs
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
//
|
|
27
27
|
// 組む本体は kit/core/build-core.mjs(ブラウザの編集アプリと共有)。ここは Node の読み書き・字の絞り込み(fonttools)・音声の圧縮(ffmpeg)・CLI
|
|
28
28
|
import { cliHints } from './cli-hint.mjs';
|
|
29
|
+
import { plural } from './core/plural.mjs';
|
|
29
30
|
import fs from 'node:fs';
|
|
30
31
|
import path from 'node:path';
|
|
31
32
|
import crypto from 'node:crypto';
|
|
@@ -372,7 +373,7 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.me
|
|
|
372
373
|
const rd = (p, max) => { try { return readRegularText(p, { max }).text; } catch { return null; } };
|
|
373
374
|
const left = draftLeftovers(rd(src, READ_LIMITS.source), rd(path.join(path.dirname(src), 'narration.md'), READ_LIMITS.narration));
|
|
374
375
|
const lines = leftoverLines(left);
|
|
375
|
-
if (lines.length) { console.error(`portable: warning: ${lines.length} template leftover
|
|
376
|
+
if (lines.length) { console.error(`portable: warning: ${lines.length} template ${plural(lines.length, 'leftover')}; the file is written anyway / 雛形のままのところ(書き出しはする):`); for (const l of lines) console.error(' ' + l); }
|
|
376
377
|
}
|
|
377
378
|
let r;
|
|
378
379
|
try { r = await buildPortable(src, { ...opts }); } catch (e) { console.error(`portable: ${e.code ? `[${e.code}] ` : ''}${e.message}`); process.exit(1); }
|
|
@@ -389,7 +390,7 @@ if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.me
|
|
|
389
390
|
if (pkg) {
|
|
390
391
|
const c = completionRule(pkg.completion);
|
|
391
392
|
const rule = c.kind === 'end' ? 'the last step is reached' : c.kind === 'fraction' ? `${c.percent}% of the steps are reached` : 'every step is reached';
|
|
392
|
-
console.log(`scorm: SCORM 1.2 package (imsmanifest.xml + index.html), ${pkg.steps} steps, ${(pkg.zip.length / 1024).toFixed(0)} KB; completed when ${rule}${c.played ? ' (played on the slides; reading in the book does not count)' : ''}`);
|
|
393
|
+
console.log(`scorm: SCORM 1.2 package (imsmanifest.xml + index.html), ${pkg.steps} ${plural(pkg.steps, 'step')}, ${(pkg.zip.length / 1024).toFixed(0)} KB; completed when ${rule}${c.played ? ' (played on the slides; reading in the book does not count)' : ''}`);
|
|
393
394
|
}
|
|
394
395
|
for (const w of r.warnings) console.warn(' ⚠ ' + w);
|
|
395
396
|
if (r.stats.citeproc) console.log(CITEPROC_CREDIT); // citeproc-js の帰属の表示(CPAL-1.0 の Exhibit B。NOTICE)
|
package/kit/check-messages.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// MESSAGES[code] = {rule?, ja(a), en(a)} a はその知らせの値。rule は規格の名前の文字列か、a から決める関数(ruleOf)
|
|
4
4
|
// where(lang, {n, id, title, step}) 「スライド 3「見出し」(s-k3f9q2)、ステップ 2」 / "Slide 3 “Heading” (s-k3f9q2), step 2"
|
|
5
5
|
import { CLIP_ATTR } from './core/layout-scan.mjs';
|
|
6
|
+
import { plural } from './core/plural.mjs';
|
|
6
7
|
import { catalogueMessage } from './core/parts2.mjs';
|
|
7
8
|
import { DEFAULT_METRICS, limitsOf } from './core/theme-metrics.mjs';
|
|
8
9
|
import { quoteJa } from './core/quote-ja.mjs';
|
|
@@ -24,6 +25,17 @@ const PLACE_EN = {
|
|
|
24
25
|
cover: '; a cover holds .venue (venue), h1 (title) and .au (authors, affiliation), and the theme adds the logos: put a subtitle on a second line of the h1 (after <br>) or in .venue, and place any other text in free space with position:absolute and top in the lesson\'s <style>',
|
|
25
26
|
sec: '; a section divider holds h1 (chapter name) and .lead (one line): place any other text in free space with position:absolute and top in the lesson\'s <style>',
|
|
26
27
|
};
|
|
28
|
+
// 図の形の知らせ(R-geometry)の座標:スライドの座標(px)
|
|
29
|
+
const geoPt = (p) => (Array.isArray(p) ? `${p[0]}, ${p[1]}` : '');
|
|
30
|
+
const geoSeg = (q) => (Array.isArray(q) ? `${q[0]}, ${q[1]} → ${q[2]}, ${q[3]}` : '');
|
|
31
|
+
const geoRect = (q) => (Array.isArray(q) ? `${q[0]}, ${q[1]} – ${q[2]}, ${q[3]}` : '');
|
|
32
|
+
// 原稿のデータにある id か(@ で始まる id はパーツの中の箱・端)
|
|
33
|
+
const geoOwn = (id) => !!id && !String(id).startsWith('@');
|
|
34
|
+
const geoSides = (px, lang) => {
|
|
35
|
+
const name = lang === 'en' ? { left: 'left', right: 'right', top: 'top', bottom: 'bottom' } : { left: '左', right: '右', top: '上', bottom: '下' };
|
|
36
|
+
const xs = Object.keys(name).filter((k) => px && px[k] > 0).map((k) => `${name[k]} ${px[k]}px`);
|
|
37
|
+
return xs.join(lang === 'en' ? ', ' : '・');
|
|
38
|
+
};
|
|
27
39
|
const WHERE_JA = { slides: 'スライド', narration: '台本', article: '本' }, WHERE_EN = { slides: 'slides', narration: 'script', article: 'book' };
|
|
28
40
|
const mibOf = (n) => (n / 1048576).toFixed(1) + ' MiB';
|
|
29
41
|
// 添付(§3.8)の型と条件の言葉
|
|
@@ -100,16 +112,16 @@ export const MESSAGES = {
|
|
|
100
112
|
legacyIndex: { ja: (a) => `見出しも id もないので、スライドの id が位置の「${a.key}」になり、スライドを足すと変わる(${a.line} 行目):<section> に id を付ける(npm run ids)`, en: (a) => `no heading and no id, so the slide id is the position “${a.key}” and changes when slides are added (line ${a.line}): give the <section> an id (npm run ids)` },
|
|
101
113
|
// 1.0 の語彙にない書き方(format spec §8.0。kit/core/legacy-vocab.mjs)。警告だけ
|
|
102
114
|
legacyColorClass: { ja: (a) => `クラス「${a.what}」は色の名前で、1.0 の語彙にない(${a.n} か所、最初は ${a.line} 行目):意味のクラス「${a.to}」にする(term は用語・問い、emph は結論・問題、muted は既知のこと)`,
|
|
103
|
-
en: (a) => `the class “${a.what}” names a colour and is not in the 1.0 vocabulary (${a.n} place
|
|
115
|
+
en: (a) => `the class “${a.what}” names a colour and is not in the 1.0 vocabulary (${a.n} ${plural(a.n, 'place')}, first on line ${a.line}): use the meaning class “${a.to}” (term for terms and questions, emph for conclusions and problems, muted for known results)` },
|
|
104
116
|
legacyStepAttr: { ja: (a) => `${a.what} は 1.0 の語彙にない(${a.n} か所、最初は ${a.line} 行目):ステップの数と動きは要素の data-step と data-at、線の class="draw"、パーツの steps から決まる(format spec §8.0)。${a.what} を外す`,
|
|
105
|
-
en: (a) => `${a.what} is not in the 1.0 vocabulary (${a.n} place
|
|
117
|
+
en: (a) => `${a.what} is not in the 1.0 vocabulary (${a.n} ${plural(a.n, 'place')}, first on line ${a.line}): the number of steps and the motion come from data-step and data-at on elements, class="draw" on strokes and the steps of parts (format spec §8.0); remove ${a.what}` },
|
|
106
118
|
// テーマの色の語彙の外の色(format spec §8.4。kit/core/color-vocab.mjs):じかに書いた色(literal)と、相対色で色相を変えた色(hue)。情報だけ(教材は組める。修正依頼には入らない)
|
|
107
119
|
colorOutside: { rule: 'R-colors', ja: (a) => (a.kind === 'hue'
|
|
108
120
|
? `相対色の構文で色相を変えた色は、役割のない新しい色になる(${a.n} か所、最初は ${a.line} 行目:${a.list})。テーマの色に揃えるなら、役割の色 var(--emph) などをそのまま使う(淡くするなら color-mix() で役割と --bg を混ぜ、明るさ・不透明度だけを変えるなら色相は h のまま)`
|
|
109
121
|
: `色をじかに書いている(${a.n} か所、最初は ${a.line} 行目:${a.list})。テーマの色に揃えるなら、テーマの class(term・emph・muted)か変数 var(--fg) var(--term) var(--emph) var(--muted) var(--accent2) var(--line) var(--lit) を使う`),
|
|
110
122
|
en: (a) => (a.kind === 'hue'
|
|
111
|
-
? `a colour derived by changing the hue (relative colour syntax) is a new colour without a role (${a.n} place
|
|
112
|
-
: `colours are written directly (${a.n} place
|
|
123
|
+
? `a colour derived by changing the hue (relative colour syntax) is a new colour without a role (${a.n} ${plural(a.n, 'place')}, first on line ${a.line}: ${a.list}); to follow the theme, use the role colour as it is (var(--emph) …); to make it lighter, mix the role with --bg in color-mix(), and when only lightness or opacity changes keep the hue h`
|
|
124
|
+
: `colours are written directly (${a.n} ${plural(a.n, 'place')}, first on line ${a.line}: ${a.list}); to follow the theme, use its classes (term, emph, muted) or variables var(--fg) var(--term) var(--emph) var(--muted) var(--accent2) var(--line) var(--lit)`) },
|
|
113
125
|
legacyLectureMode: { ja: (a) => `<html data-mode="lecture"> は 1.0 の語彙にない(${a.line} 行目):見せ方は再生の設定の「先のステップを薄く見せる」で選ぶ。スライド(deck.html)からは外す`,
|
|
114
126
|
en: (a) => `<html data-mode="lecture"> is not in the 1.0 vocabulary (line ${a.line}): the participant chooses “Show later steps faintly” in the player; remove it from the slides (deck.html)` },
|
|
115
127
|
narrHeadingDiffers: { rule: 'R-headings', ja: (a) => `narration.md ${a.line} 行目の見出し${quoteJa(a.heading)}がスライドの見出し${quoteJa(a.slide)}と違う({#${a.id}} で対応しているので動きは変わらない)`, en: (a) => `the script heading “${a.heading}” (narration.md line ${a.line}) differs from the slide heading “${a.slide}” (matched by {#${a.id}}, so nothing breaks)` },
|
|
@@ -136,7 +148,7 @@ export const MESSAGES = {
|
|
|
136
148
|
en: (a) => `the reference voice “${a.path}” (the recording a voice in voice.json imitates) ${{ slides: 'is used by the slides: a lesson does not carry reference voices, so export to an Egatari file (.ega.html) is refused. Remove it from the slides', audio: 'is a step\'s audio in audio/manifest.json: it is left out of the Egatari file (.ega.html) and that step has no audio. Replace it with audio made with the voice', attachments: 'is in the attachments folder (attachments/): it is left out of the Egatari file (.ega.html)', folder: 'is inside the working folder: it is left out of the Egatari file (.ega.html), but goes along if you share the whole working folder' }[a.where]}. Keep the recording outside the working folder and give its location or name in voice.json (a lesson carries only the audio made with the voice)`,
|
|
137
149
|
},
|
|
138
150
|
// ---------------------------------------------------------------- 添付(attachments/。format spec §3.8)
|
|
139
|
-
extensionVersion: { ja: (a) => `拡張 ${a.name} の v${a.v} には未対応(対応は v${a.supported}
|
|
151
|
+
extensionVersion: { ja: (a) => `拡張 ${a.name} の v${a.v} には未対応(対応は v${a.supported}):拡張を使わず、そのまま残す。使うには対応するバージョンで開く`, en: (a) => `extension ${a.name} v${a.v} is not supported (implements v${a.supported}): ignore and preserve it; open in a supporting version to use it` },
|
|
140
152
|
attachBadConfig: { ja: (a) => `egatari.json の attachments が読めない(${a.why}):[{"path": "attachments/…", "role": "pdf", "title": "…"}] の形にする`, en: (a) => `attachments in egatari.json cannot be read (${a.why}): use [{"path": "attachments/…", "role": "pdf", "title": "…"}]` },
|
|
141
153
|
attachBadName: { ja: (a) => `添付「${a.path}」の名前は使えない(${a.why}):attachments/ の下の、ふつうの名前(.. ・ \\ ・ : * ? " < > | ・制御文字・末尾の点や空白・CON などの予約名なし)にする`, en: (a) => `the attachment name “${a.path}” is not allowed (${a.why}): use a plain name under attachments/ (no .., \\, : * ? " < > |, control characters, trailing dot or space, or reserved names such as CON)` },
|
|
142
154
|
attachExcluded: { ja: (a) => `添付「${a.path}」は Egatari ファイル(.ega.html)に入らない(${a.why}):入れるなら名前を替える`, en: (a) => `the attachment “${a.path}” is left out of the Egatari file (.ega.html) (${a.why}): rename it to include it` },
|
|
@@ -160,7 +172,7 @@ export const MESSAGES = {
|
|
|
160
172
|
attachUnchecked: { ja: (a) => `添付「${a.path}」は中身を確かめられない(${a.why}):§3.8 では確かめられないものは入れない。暗号化や特別な圧縮を外して保存し直す(Egatari ファイルに入らない)`,
|
|
161
173
|
en: (a) => `the attachment “${a.path}” cannot be checked (${a.why}): §3.8 attachments are checked before packing; save it again without encryption or unusual compression (it is not packed into the Egatari file)` },
|
|
162
174
|
attachInjection: { ja: (a) => `添付「${a.path}」の ${a.n} 個の値が = + - @ やタブで始まり、表計算のソフトで数式として読まれうる${a.row ? `(最初は ${a.row} 行 ${a.col} 列)` : a.where ? `(${a.where})` : ''}:意図したものか確かめる(入れる)`,
|
|
163
|
-
en: (a) => `${a.n} value
|
|
175
|
+
en: (a) => `${a.n} ${plural(a.n, 'value')} in the attachment “${a.path}” ${a.n === 1 ? 'starts' : 'start'} with = + - @ or a tab and may be read as formulas by a spreadsheet${a.row ? ` (first at row ${a.row}, column ${a.col})` : a.where ? ` (in ${a.where})` : ''}: check that this is intended (it is packed)` },
|
|
164
176
|
attachPrivate: { ja: (a) => `添付「${a.path}」に${({ 'private key': '秘密鍵', 'access key': 'アクセスキー', 'password or token': 'パスワードかトークン', 'device-specific path': 'この端末のパス' })[a.what] || a.what}らしい文字がある:配る前に確かめて消す(入れる)`,
|
|
165
177
|
en: (a) => `the attachment “${a.path}” seems to contain a ${({ 'device-specific path': 'path specific to this device' })[a.what] || a.what}: check and remove it before sharing (it is packed)` },
|
|
166
178
|
attachBadDescription: { ja: (a) => `添付「${a.path}」の説明(description)が使えない(${a.why}):${a.max} 字までの 1〜2 文(改行なし)にする(説明なしで一覧に出す)`,
|
|
@@ -242,6 +254,27 @@ export const MESSAGES = {
|
|
|
242
254
|
en: (a) => (a.tate
|
|
243
255
|
? `Content sits to the right (centre of mass ${Math.abs(Math.round(a.hOffset))}% right of the centre; ${Math.round(a.left - a.right)}% empty on the left)`
|
|
244
256
|
: `Content sits high (centre of mass ${Math.abs(Math.round(a.vOffset))}% above the optical centre; ${Math.round(a.bottom - a.top)}% empty at the bottom)`) },
|
|
257
|
+
// 描いた図の形(kit/core/geometry-check.mjs、backlog #201、R-geometry。警告、縦書きの数は情報)。パーツが付けた印(data-part)の id と座標(スライドの 1280×720)を言い、
|
|
258
|
+
// AI が原稿のデータで直せる直し方を 1 つ添える(画素の位置を直させない)。@ で始まる id はパーツの中の箱・端(データにない)
|
|
259
|
+
geoEdgeThroughBox: { rule: 'R-geometry',
|
|
260
|
+
ja: (a) => `図の線 ${a.edge} が、つないでいない箱 ${a.box} の中を通る(${geoSeg(a.seg)}):パーツのデータで${geoOwn(a.box) ? `箱 ${a.box} の位置を変えるか、` : ''}線 ${a.edge} の位置をずらして箱をよける(m-flow なら${geoOwn(a.box) ? `箱の x・y か、` : ''}線の shift)`,
|
|
261
|
+
en: (a) => `figure line ${a.edge} passes through box ${a.box}, which it does not connect (${geoSeg(a.seg)}): in the part's data, ${geoOwn(a.box) ? `move box ${a.box} or ` : ''}shift line ${a.edge} so it goes around the box (in m-flow, ${geoOwn(a.box) ? `the box's x and y, or ` : ''}the line's shift)` },
|
|
262
|
+
geoLineOverLabel: { rule: 'R-geometry',
|
|
263
|
+
ja: (a) => `図の線 ${a.edge} が字「${a.t}」(${a.label} の字)を横切る(${geoPt(a.at)}):パーツのデータで ${geoOwn(a.label) ? `${a.label} か` : ''}線の端(${a.from}・${a.to})の並びを変え、線が字をよけるようにする${a.halo ? '(字に縁取りがあるので読めるが、よけるほうが読みやすい)' : ''}`,
|
|
264
|
+
en: (a) => `figure line ${a.edge} crosses the text “${a.t}” (label of ${a.label}) (${geoPt(a.at)}): in the part's data, reorder ${geoOwn(a.label) ? `${a.label} or ` : ''}the ends of the line (${a.from}, ${a.to}) so the line goes around the text${a.halo ? ' (the text has a halo, so it stays readable, but it reads better clear of the line)' : ''}` },
|
|
265
|
+
geoLabelOverlap: { rule: 'R-geometry',
|
|
266
|
+
ja: (a) => (a.mark
|
|
267
|
+
? `図の字「${a.t}」(${a.label} の字)が点 ${a.other} に重なる(${geoRect(a.rect)}):パーツのデータで ${a.label} か ${a.other} の値を変えて離す`
|
|
268
|
+
: `図の字「${a.t}」(${a.label} の字)と「${a.u}」(${a.other} の字)が重なる(${geoRect(a.rect)}):パーツのデータで ${a.label} か ${a.other} の位置を離すか、字を短くする`),
|
|
269
|
+
en: (a) => (a.mark
|
|
270
|
+
? `figure text “${a.t}” (label of ${a.label}) overlaps point ${a.other} (${geoRect(a.rect)}): change the values of ${a.label} or ${a.other} in the part's data to move them apart`
|
|
271
|
+
: `figure texts “${a.t}” (label of ${a.label}) and “${a.u}” (label of ${a.other}) overlap (${geoRect(a.rect)}): move ${a.label} or ${a.other} apart in the part's data, or shorten the text`) },
|
|
272
|
+
geoLabelOutsideBox: { rule: 'R-geometry',
|
|
273
|
+
ja: (a) => `図の字「${a.t}」が箱 ${a.box} の縁を越える(${geoSides(a.px, 'ja')}):字を短くするか改行するか、パーツのデータで箱 ${a.box} を大きくする(m-flow なら w・h)`,
|
|
274
|
+
en: (a) => `figure text “${a.t}” goes past the border of box ${a.box} (${geoSides(a.px, 'en')}): shorten the text, break it into lines, or make box ${a.box} larger in the part's data (in m-flow, w and h)` },
|
|
275
|
+
geoTateSlides: { rule: 'R-geometry',
|
|
276
|
+
ja: (a) => `縦書きのスライド ${a.n} 枚の図は、図の形の点検で測っていない:その図の線・箱・字の重なりは目で確かめる`,
|
|
277
|
+
en: (a) => `the figures on ${a.n} vertical (layout-tate) slide${a.n === 1 ? '' : 's'} were not measured by the figure geometry check: check their lines, boxes and text for overlaps by eye` },
|
|
245
278
|
step0: { ja: (a) => `ステップ 0 の本文:「${a.t}」`, en: (a) => `body text at step 0: “${a.t}”` },
|
|
246
279
|
punctMixed: { rule: 'R-style', ja: (a) => `句読点が混ざっている:${a.minor}が ${a.n} 個あり、教材の多くは${a.major}:このスライドも${a.major}にそろえる`, en: (a) => `mixed punctuation: ${a.n} × ${a.minor} while most of the lesson uses ${a.major}: use ${a.major} on this slide too` },
|
|
247
280
|
// ---------------------------------------------------------------- 台本
|
|
@@ -287,12 +320,13 @@ export const MESSAGES = {
|
|
|
287
320
|
+ (a.comps && a.comps.length ? `. The part ${a.comps.map((t) => `<${t}>`).join(', ')} on this slide cannot draw its data, so its steps are not counted: fix its data first (R-components)` : '');
|
|
288
321
|
} },
|
|
289
322
|
readingExpr: { rule: 'R-reading', ja: (a) => `読みの指定 ${a.t} が式を読んでいる(narration.md ${a.line} 行目):読みは 1 つの記号か用語だけに付け({θ|シータ})、式は意味を言葉で言う`, en: (a) => `the reading ${a.t} reads an expression (narration.md line ${a.line}): give readings to single symbols or terms only ({θ|theta}) and say the relation in words` },
|
|
323
|
+
readingGap: { rule: 'R-reading', ja: (a) => `「${a.t}」に読みがない(narration.md ${a.line} 行目):${a.first} 行目では {${a.t}|${a.reading}} と読みを付けている。読みは出てくる所ごとに当たるので、ここにも {${a.t}|${a.reading}} と付ける。読みなしで正しく読まれる語なら、{${a.t}|${a.reading}} のほうを外して ${a.t} にそろえる(かなの読みは抑揚を崩しやすい)`, en: (a) => `“${a.t}” has no reading here (narration.md line ${a.line}): line ${a.first} gives it {${a.t}|${a.reading}}. A reading applies only where it is written, so add {${a.t}|${a.reading}} here too. If the term is read correctly without one, remove the reading at line ${a.first} instead so every occurrence is plain ${a.t} (a kana reading can break the accent)` },
|
|
290
324
|
readingSeveral: { rule: 'R-reading', ja: (a) => `読みの指定 ${a.t} に記号が 2 つ以上ある(narration.md ${a.line} 行目):記号ごとに分ける({θ|シータ} と {η|イータ})`, en: (a) => `the reading ${a.t} covers several symbols (narration.md line ${a.line}): give each symbol its own reading ({θ|theta} and {η|eta})` },
|
|
291
325
|
// ---------------------------------------------------------------- 色・パーツ・強調・モーフ・読み上げ
|
|
292
326
|
palette: { ja: (a) => `パレット:${a.v} ${a.css} = rgb(${a.rgb})${a.ratio ? ` vs --bg → コントラスト ${a.ratio}:1` : ''}`, en: (a) => `palette: ${a.v} ${a.css} = rgb(${a.rgb})${a.ratio ? ` vs --bg → contrast ${a.ratio}:1` : ''}` },
|
|
293
327
|
contrastLow: { rule: 'R-colors', ja: (a) => `${a.v} と --bg のコントラストが低い(${a.ratio}:1 < ${a.min}:1):テーマの色を直す(教材の中で色を書いていれば消し、テーマの class と変数だけを使う)`, en: (a) => `low contrast between ${a.v} and --bg (${a.ratio}:1 < ${a.min}:1): fix the theme colors (remove any colors written in the lesson; use only theme classes and variables)` },
|
|
294
328
|
compOrder: { ja: (a) => `パーツの描画が呼び出し順に依存している(ステップ ${a.k}):render(k, t) が前の呼び出しの状態に頼らないようにパーツを直す(docs/contract.md §3)`, en: (a) => `the part draws differently depending on call order (step ${a.k}): make render(k, t) independent of previous calls (docs/contract.md §3)` },
|
|
295
|
-
compOrderNoise: { ja: (a) => `パーツの描画の揺れを許した(ステップ ${a.k}):2 回の描画でパーツの DOM はバイトまで同じで、違う画素 ${a.n} 個は${a.faint ? `、縁から遠いわずかな違いの ${a.faint} 個(ばらばらで、各チャンネル 24/255 以下)のほかは` : ''}どれも図形の縁にあり、上限 ${a.cap} 以下(描き方のアンチエイリアスの揺れで、呼び出し順への依存ではない。kit/render-compare.mjs)`, en: (a) => `renderer noise accepted (step ${a.k}): the part DOM was byte-identical in both renders and the ${a.n} differing pixel
|
|
329
|
+
compOrderNoise: { ja: (a) => `パーツの描画の揺れを許した(ステップ ${a.k}):2 回の描画でパーツの DOM はバイトまで同じで、違う画素 ${a.n} 個は${a.faint ? `、縁から遠いわずかな違いの ${a.faint} 個(ばらばらで、各チャンネル 24/255 以下)のほかは` : ''}どれも図形の縁にあり、上限 ${a.cap} 以下(描き方のアンチエイリアスの揺れで、呼び出し順への依存ではない。kit/render-compare.mjs)`, en: (a) => `renderer noise accepted (step ${a.k}): the part DOM was byte-identical in both renders and the ${a.n} differing ${plural(a.n, 'pixel')} all lie on shape edges${a.faint ? ` except ${a.faint} isolated faint ${plural(a.faint, 'pixel')} (each channel ≤ 24/255)` : ''}, within the cap of ${a.cap} (anti-aliasing noise, not call-order dependence; kit/render-compare.mjs)` },
|
|
296
330
|
compOrderDetail: { ja: (a) => `品質チェック(呼び出し順)の詳しい結果(ステップ ${a.k}):${a.note}`, en: (a) => `quality check details (call order, step ${a.k}): ${a.note}` },
|
|
297
331
|
markMissing: { rule: 'R-marks', ja: (a) => `強調 {mark:${a.id}} の目印がこのスライドにない:目印の要素に id="${a.id}" か data-mark="${a.id}" を付ける(式の一部は \\htmlId{${a.id}}{…})か、{mark:…} を消す`, en: (a) => `the emphasis {mark:${a.id}} has no target on this slide: put id="${a.id}" or data-mark="${a.id}" on the element (\\htmlId{${a.id}}{…} in math), or remove the {mark:…}` },
|
|
298
332
|
marks: { ja: (a) => `強調:${a.list}`, en: (a) => `emphasis: ${a.list}` },
|
|
@@ -302,10 +336,10 @@ export const MESSAGES = {
|
|
|
302
336
|
morphLater: { ja: (a) => `モーフ:ステップ 0 で見えないので動かさない:${a.ids}`, en: (a) => `morph: not moved because not visible at step 0: ${a.ids}` },
|
|
303
337
|
morphDupSrc: { ja: (a) => `モーフ:元のスライドに data-id「${a.id}」が 2 つ以上ある(初めのものだけを使う):1 つにする`, en: (a) => `morph: the source slide has data-id “${a.id}” more than once (only the first is used): keep one` },
|
|
304
338
|
morphDupDst: { ja: (a) => `モーフ:data-id「${a.id}」が 2 つ以上ある(初めのものだけを使う):1 つにする`, en: (a) => `morph: data-id “${a.id}” appears more than once (only the first is used): keep one` },
|
|
305
|
-
imgAlt: { ja: (a) => `alt の無い画像が ${a.n} 枚(${a.list}):内容を alt="…" に書く(飾りなら alt="")`, en: (a) => `${a.n} image
|
|
306
|
-
svgName: { ja: (a) => `名前の無い SVG の図が ${a.n} 個:aria-label="…" か <title>…</title> を付ける(飾りなら aria-hidden="true")`, en: (a) => `${a.n} SVG figure
|
|
339
|
+
imgAlt: { ja: (a) => `alt の無い画像が ${a.n} 枚(${a.list}):内容を alt="…" に書く(飾りなら alt="")`, en: (a) => `${a.n} ${plural(a.n, 'image')} without alt (${a.list}): describe ${a.n === 1 ? 'it' : 'them'} in alt="…" (alt="" if decorative)` },
|
|
340
|
+
svgName: { ja: (a) => `名前の無い SVG の図が ${a.n} 個:aria-label="…" か <title>…</title> を付ける(飾りなら aria-hidden="true")`, en: (a) => `${a.n} SVG ${plural(a.n, 'figure')} without a name: add aria-label="…" or <title>…</title> (aria-hidden="true" if decorative)` },
|
|
307
341
|
compName: { ja: (a) => `名前の無いパーツ:${a.list}(読み上げ用に aria-label="…" を付けられる)`, en: (a) => `parts without a name: ${a.list} (an aria-label="…" helps screen readers)` },
|
|
308
|
-
timelineTotal: { ja: (a) => `タイムライン合計:${a.s} 秒(${a.n} ステップ)`, en: (a) => `timeline total: ${a.s} s (${a.n}
|
|
342
|
+
timelineTotal: { ja: (a) => `タイムライン合計:${a.s} 秒(${a.n} ステップ)`, en: (a) => `timeline total: ${a.s} s (${a.n} ${plural(a.n, 'step')})` },
|
|
309
343
|
slideLength: { ja: (a) => `この枚の長さ:${a.s} 秒`, en: (a) => `slide length: ${a.s} s` },
|
|
310
344
|
compLayout: { rule: 'R-fit',
|
|
311
345
|
ja: (a) => `${compName(a, true)}を置く場所が足りない:${a.msg}。パーツを置く場所を広げるか、表示する内容を減らす`,
|
|
@@ -331,8 +365,8 @@ function compWhat(a, ja) {
|
|
|
331
365
|
if (a.why === 'required') return ja ? `${p(a.path.replace(/\.?[^.[\]]+$/, ''))}に欄 ${a.key} がない(${a.expected})` : `${p(a.path.replace(/\.?[^.[\]]+$/, ''))} has no field ${a.key} (${a.expected})`;
|
|
332
366
|
if (a.why === 'unknown') return ja ? `欄「${a.path}」はない${a.near ? `(${a.near} のこと?)` : ''}。使える欄:${a.expected}` : `there is no field “${a.path}”${a.near ? ` (did you mean ${a.near}?)` : ''}; the fields are: ${a.expected}`;
|
|
333
367
|
if (a.why === 'anyOf') return ja ? `${p(a.path)}に ${a.expected} のどちらかが要る(今は ${a.got})` : `${p(a.path)} needs ${a.expected} (it is ${a.got})`;
|
|
334
|
-
if (a.why === 'minItems') return ja ? `${p(a.path)}は ${a.n} 個以上要る(今は ${a.got})` : `${p(a.path)} needs at least ${a.n}
|
|
335
|
-
if (a.why === 'maxItems') return ja ? `${p(a.path)}は ${a.n} 個まで(今は ${a.got})` : `${p(a.path)} takes at most ${a.n}
|
|
368
|
+
if (a.why === 'minItems') return ja ? `${p(a.path)}は ${a.n} 個以上要る(今は ${a.got})` : `${p(a.path)} needs at least ${a.n} ${plural(a.n, 'item')} (it is ${a.got})`;
|
|
369
|
+
if (a.why === 'maxItems') return ja ? `${p(a.path)}は ${a.n} 個まで(今は ${a.got})` : `${p(a.path)} takes at most ${a.n} ${plural(a.n, 'item')} (it is ${a.got})`;
|
|
336
370
|
if (a.keys && a.keys.length) {
|
|
337
371
|
// 配列のはずが object:{"series": [...], "xr": [...]} のような形
|
|
338
372
|
const extra = [];
|
package/kit/check.mjs
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// ただし段階の状態は DECK.seek(i, k, Infinity) で作る(beforeprint の代わり)
|
|
8
8
|
// はみ出し・切れ・字の大きさ・字数は kit/core/layout-scan.mjs(編集アプリの品質チェックと同じ関数)。箱で切れる字・スライドの外に出る
|
|
9
9
|
// 図の字・図の箱からはみ出す字・本文の外に置いた字は警告。わざと切るところは要素に data-clip(CLIP_ATTR)を付けて外す
|
|
10
|
+
// 描いた図の形(パーツの印 data-part を測る:箱を通る線・字を横切る線・重なる字・箱の縁を越える字)は kit/core/geometry-check.mjs(R-geometry、警告。編集アプリと同じ関数)
|
|
10
11
|
// 本文の場所の限りはテーマの寸法の宣言(theme.json の metrics、contract §12)から導き、描いた箱が宣言と違えば themeMetricsDrift(警告、デッキに 1 回)。
|
|
11
12
|
// 読めない宣言は themeMetricsInvalid(警告、デッキに 1 回)。同梱の字体が読み込めなければ測らずに metricsFontLoad(警告、デッキに 1 回)
|
|
12
13
|
// 埋め込んだ字体のどれにもない見える字(スライド・台本・本)は fontNotCovered(情報、デッキに 1 回。端末の字体で出るだけで、v0.6.6 までと見え方は同じ。kit/core/font-coverage.mjs)
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
// 式らしさは \ ^ _ と演算子の密度だけ、長いターンは 60 語で見る
|
|
34
35
|
// 口述原稿の言語はスライドと別に決め(voice.json の "lang" > 発言の文字 > <html lang>)、式らしさと長いターンは発言ごとにその言語の規則で見る
|
|
35
36
|
import { findRawMath } from './core/raw-math.mjs';
|
|
37
|
+
import { plural } from './core/plural.mjs';
|
|
36
38
|
import { cliHints } from './cli-hint.mjs';
|
|
37
39
|
import fs from 'node:fs';
|
|
38
40
|
import os from 'node:os';
|
|
@@ -45,13 +47,17 @@ import { excludedReason } from './core/portable.mjs';
|
|
|
45
47
|
import { FORMAT } from './core/format.mjs';
|
|
46
48
|
import { planAttachments, inspectAttachment, ATTACH_LIMITS } from './core/attachments.mjs';
|
|
47
49
|
import { normalizeKey, noteProblems } from './narration.mjs';
|
|
48
|
-
import { readingProblems, orphanSteps, orphanDetail, formulaLike, formulaText, narrationLang, textLang } from './core/narration-lint.mjs';
|
|
50
|
+
import { readingProblems, readingGaps, orphanSteps, orphanDetail, formulaLike, formulaText, narrationLang, textLang } from './core/narration-lint.mjs';
|
|
49
51
|
import { cleanErrorText, componentError } from './core/error-text.mjs';
|
|
50
52
|
import { partReportFinding, message, where, ruleOf } from './check-messages.mjs';
|
|
53
|
+
import { account, ruleSetText, factsFromSource } from './core/check-rules.mjs';
|
|
54
|
+
import { createHash } from 'node:crypto';
|
|
51
55
|
import { readRegular, readHead, READ_LIMITS } from './bounded-read.mjs';
|
|
52
56
|
import { audioState } from './core/audio-core.mjs';
|
|
53
57
|
import { scanBalance } from './fill-scan.mjs';
|
|
54
58
|
import { layoutScan, metricsProbe, metricsFonts, CLIP_ATTR, ANNOT_ATTR, OVERLAP_ATTR } from './core/layout-scan.mjs';
|
|
59
|
+
import { geometryScan, geometryTate } from './core/geometry-check.mjs';
|
|
60
|
+
import { TEXT_BANDS, DEFAULT_BAND } from './core/text-band.mjs';
|
|
55
61
|
import { placeholderSteps, templateTextIn } from './core/template-text.mjs';
|
|
56
62
|
import { legacyVocabulary } from './core/legacy-vocab.mjs';
|
|
57
63
|
import { colorsOutsideVocabulary } from './core/color-vocab.mjs';
|
|
@@ -121,7 +127,10 @@ catch (e) {
|
|
|
121
127
|
sev: 'error', code: e.code, rule: ruleOf(e.code, data), data,
|
|
122
128
|
msg: where(ml, { n: null }) + (ml === 'en' ? ': ' : ':') + message(ml, e.code, data),
|
|
123
129
|
}));
|
|
124
|
-
|
|
130
|
+
// 組めないので、ほかの決まりは見ていない(incomplete。終了コードは教材の誤りの 1 のまま)
|
|
131
|
+
const acc0 = account({ results: findings.map((f) => ({ sev: f.sev, code: f.code })), visited: new Set(['読み込み']) });
|
|
132
|
+
if (asJson) console.log(JSON.stringify({ ok: false, status: acc0.status, lang: ml, counts: { error: findings.length, warn: 0, info: 0 }, results: findings,
|
|
133
|
+
ruleSet: createHash('sha256').update(ruleSetText()).digest('hex').slice(0, 12), rules: acc0.rules, summary: acc0.summary, unset: acc0.unset, problems: acc0.problems }, null, 2));
|
|
125
134
|
else for (const f of findings) console.log(`[${ml === 'en' ? 'error' : 'エラー'}] ${cliHints(f.msg)}`);
|
|
126
135
|
await new Promise((resolve) => process.stdout.write('', resolve));
|
|
127
136
|
process.exit(1);
|
|
@@ -308,7 +317,10 @@ const browser = await launch();
|
|
|
308
317
|
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
|
309
318
|
// コンソールのエラーとページの例外は、読み込み直後だけでなく検査の全体(後の seek・再現性の確認・開き直し)を通して集め、最後にまとめて報告する
|
|
310
319
|
const consoleErrors = [];
|
|
320
|
+
// 通った検査の段(kit/core/check-rules.mjs の決まりの phase。通らなかった段の決まりは incomplete)
|
|
321
|
+
const visited = new Set();
|
|
311
322
|
let phase = '読み込み';
|
|
323
|
+
visited.add(phase);
|
|
312
324
|
page.on('console', (m) => { if (m.type() === 'error') consoleErrors.push(`[${phase}] ${m.text()}`); });
|
|
313
325
|
page.on('pageerror', (e) => consoleErrors.push(`[${phase}] ${e.message}`));
|
|
314
326
|
await page.goto(url);
|
|
@@ -361,7 +373,7 @@ for (const r of compErrors) {
|
|
|
361
373
|
}
|
|
362
374
|
|
|
363
375
|
// ================================================================ J. スライドへのリンク
|
|
364
|
-
phase = 'J リンク';
|
|
376
|
+
phase = 'J リンク'; visited.add(phase);
|
|
365
377
|
{
|
|
366
378
|
const links = await page.evaluate(() => DECK.slides.flatMap((s, i) => [...s.querySelectorAll('a[href]')].map((a) => {
|
|
367
379
|
const href = a.getAttribute('href'), f = DECK.linkFragment(a);
|
|
@@ -395,7 +407,7 @@ phase = 'J リンク';
|
|
|
395
407
|
|
|
396
408
|
// ================================================================ M. 本文(article.md・article/<名前>.md、format spec §9C.8)
|
|
397
409
|
// 部分集合の外の書き方・名前・章の決まり・相互参照・解答・用語・引用の鍵・画像・data-article。ステップへのリンクの行き先は再生器(DECK.resolveFragment)で確かめる
|
|
398
|
-
phase = 'M 本文';
|
|
410
|
+
phase = 'M 本文'; visited.add(phase);
|
|
399
411
|
if (hasArticle(src)) {
|
|
400
412
|
const { loadArticle, stepLinksOf, articleLinkReport } = await import('./core/article-page.mjs');
|
|
401
413
|
const { validateArticle, stepResolver, STEP_PROBE } = await import('./core/article.mjs');
|
|
@@ -423,11 +435,13 @@ if (hasArticle(src)) {
|
|
|
423
435
|
}
|
|
424
436
|
|
|
425
437
|
// ================================================================ A. 体裁の検査
|
|
426
|
-
phase = 'A 体裁';
|
|
438
|
+
phase = 'A 体裁'; visited.add(phase);
|
|
427
439
|
// 体裁の検査の関数(kit/core/layout-scan.mjs)をページに入れる(文字列で。デッキの決まり(CSP)に依らない)
|
|
428
440
|
await page.evaluate(`window.__layoutScan = ${layoutScan}`);
|
|
429
441
|
await page.evaluate(`window.__findRawMath = ${findRawMath}`);
|
|
430
|
-
|
|
442
|
+
// 描いた図の形(kit/core/geometry-check.mjs、R-geometry。編集アプリの品質チェックと同じ関数)。字の範囲の表は値で渡す(kit/core/text-band.mjs)
|
|
443
|
+
await page.evaluate(`window.__geometryScan = ${geometryScan}; window.__geometryTate = ${geometryTate}`);
|
|
444
|
+
const aOut = await page.evaluate(([metaList, JA, CLIP, ANNOT, OVERLAP, METRICS, GEO]) => {
|
|
431
445
|
const S = DECK.slides;
|
|
432
446
|
const step0 = [], punct = [];
|
|
433
447
|
const style = [], soft = [];
|
|
@@ -460,6 +474,8 @@ const aOut = await page.evaluate(([metaList, JA, CLIP, ANNOT, OVERLAP, METRICS])
|
|
|
460
474
|
const body = s.querySelector('.body');
|
|
461
475
|
// はみ出し・切れ・字の大きさ・字数(kit/core/layout-scan.mjs。編集アプリの品質チェックと同じ関数)
|
|
462
476
|
for (const f of window.__layoutScan(s, { JA, refRe: '文献', clip: CLIP, annot: ANNOT, overlap: OVERLAP, metrics: METRICS })) (f.sev === 'error' ? issues : warns).push([f.code, f.a, f.sev]);
|
|
477
|
+
// 描いた図の形(パーツの印 data-part を測る。縦書きのスライドは測らない)
|
|
478
|
+
for (const f of window.__geometryScan(s, GEO)) (f.sev === 'error' ? issues : warns).push([f.code, f.a, f.sev]);
|
|
463
479
|
if (body) {
|
|
464
480
|
const txt = (() => { const c = body.cloneNode(true); c.querySelectorAll('.katex-mathml').forEach((x) => x.remove()); document.body.appendChild(c); c.style.cssText = 'position:absolute;left:-99999px;width:' + body.clientWidth + 'px'; const r = c.innerText; c.remove(); return r; })();
|
|
465
481
|
// 句読点はデッキの中でそろっていればよい(どちらにするかは元の原稿に合わせる)。数えて後で比べる
|
|
@@ -475,8 +491,8 @@ const aOut = await page.evaluate(([metaList, JA, CLIP, ANNOT, OVERLAP, METRICS])
|
|
|
475
491
|
if (issues.length) style.push({ i: m.i, issues });
|
|
476
492
|
if (warns.length) soft.push({ i: m.i, issues: warns });
|
|
477
493
|
});
|
|
478
|
-
return { step0, style, soft, punct };
|
|
479
|
-
}, [meta, JA, CLIP_ATTR, ANNOT_ATTR, OVERLAP_ATTR, themeInfo.metrics]);
|
|
494
|
+
return { step0, style, soft, punct, geoTate: window.__geometryTate(S) };
|
|
495
|
+
}, [meta, JA, CLIP_ATTR, ANNOT_ATTR, OVERLAP_ATTR, themeInfo.metrics, { bands: TEXT_BANDS, dflt: DEFAULT_BAND }]);
|
|
480
496
|
|
|
481
497
|
// テーマの寸法の宣言と描いた箱(見えない見本のスライドで 1 回測る。宣言がなければ既定と比べる)
|
|
482
498
|
// 測るのは同梱の字体が読み込まれてから(代わりの字体では測らない。読み込めなければ metricsFontLoad を知らせて測らない)
|
|
@@ -489,6 +505,8 @@ const foreign = (mfonts.foreign || []).filter((f) => !extraMissing.some((x) => x
|
|
|
489
505
|
if (foreign.length) report(null, 'warn', 'fontNotEmbedded', { fonts: foreign });
|
|
490
506
|
if (probe.items.length) report(null, 'warn', 'themeMetricsDrift', { theme: themeInfo.name, declared: !!themeInfo.declared, items: probe.items });
|
|
491
507
|
for (const { i, text } of aOut.step0) report(i, 'info', 'step0', { t: text }, '0');
|
|
508
|
+
// 縦横が混ざる教材:形の点検から外した縦書きのスライド(印のあるもの)の数(中身がみな縦書きなら決まりの台帳が skipped/tate にする)
|
|
509
|
+
if (aOut.geoTate) report(null, 'info', 'geoTateSlides', { n: aOut.geoTate });
|
|
492
510
|
for (const { i, issues } of aOut.style) for (const [code, a] of issues) report(i, 'error', code, a);
|
|
493
511
|
// cardsHint は 1 つの教材で最大 a.cap 個(長さのそろい方 a.ratio の小さい順、同じなら前のスライド)。残りは出さない(kit/core/layout-scan.mjs の CH.cap)
|
|
494
512
|
const cardsHints = [];
|
|
@@ -509,14 +527,14 @@ await collectPartReports();
|
|
|
509
527
|
// 本文に図(部品・svg・img・table・.katex-display)があり、上に強く寄り、図の下に大きな空きが片寄るとき知らせる(縦組みは右に寄り図の左が空くとき)。
|
|
510
528
|
// 字だけのスライドは知らせない(上にそろえて始めるのが決まり)。表紙・章の扉・static は測らない。
|
|
511
529
|
// 結論の行(.concl)は本文の外なので撮らない。知らせは情報だけ(エラー・警告の数、終了コード、修正依頼には入らない)
|
|
512
|
-
phase = 'N 釣り合い';
|
|
530
|
+
phase = 'N 釣り合い'; visited.add(phase);
|
|
513
531
|
for (const f of await scanBalance(page, meta)) {
|
|
514
532
|
if (f.skip || !f.flagged) continue;
|
|
515
533
|
report(f.i, 'info', 'balance', { vOffset: f.vOffset, hOffset: f.hOffset, band: f.band, side: f.side, top: f.top, bottom: f.bottom, left: f.left, right: f.right, tate: !!f.tate, bbox: f.bbox, visual: f.visual });
|
|
516
534
|
}
|
|
517
535
|
|
|
518
536
|
// ================================================================ B. 口述原稿
|
|
519
|
-
phase = 'B 台本';
|
|
537
|
+
phase = 'B 台本'; visited.add(phase);
|
|
520
538
|
const narrInfo = await page.evaluate((metaList) => {
|
|
521
539
|
const out = [];
|
|
522
540
|
// static のスライド(表紙など。段階は 0 だけ)も段階 0 の口述原稿を見る
|
|
@@ -588,9 +606,14 @@ for (const seg of built.segs) {
|
|
|
588
606
|
report(i, 'warn', p.why === 'operator' ? 'readingExpr' : 'readingSeveral', { t: p.text, line: seg.line }, seg.stepKey);
|
|
589
607
|
}
|
|
590
608
|
}
|
|
609
|
+
// 読みを付けた語が、ほかの所に読みなしで出てくる(backlog #203。読みは出てくる所ごとに当たる)
|
|
610
|
+
for (const g of readingGaps(built.segs)) {
|
|
611
|
+
const i = meta.findIndex((m) => m.key === g.slideKey);
|
|
612
|
+
if (i >= 0) report(i, 'warn', 'readingGap', { t: g.t, reading: g.reading, line: g.line, first: g.first }, g.stepKey);
|
|
613
|
+
}
|
|
591
614
|
|
|
592
615
|
// ================================================================ C. パレットのコントラスト
|
|
593
|
-
phase = 'C パレット';
|
|
616
|
+
phase = 'C パレット'; visited.add(phase);
|
|
594
617
|
// oklch() や color-mix() は getComputedStyle だけでは rgb に落ちないことがあるので、
|
|
595
618
|
// 一度 1x1 の canvas に塗って画素として読み、実際に表示される sRGB 値を得る。rgb()・rgba() はそのまま数を読む(canvas を通しても同じ値):
|
|
596
619
|
// 込み合った macOS の CI で、どの組も 1.00:1 の contrastLow になったことがある(canvas の読み戻しがどの色も 0,0,0 を返せばそうなる)
|
|
@@ -634,7 +657,7 @@ for (const v of ['--fg', '--term', '--emph', '--title', '--accent2']) {
|
|
|
634
657
|
}
|
|
635
658
|
|
|
636
659
|
// ================================================================ D. 部品の再現性(呼び出し順に依存していないか)
|
|
637
|
-
phase = 'D 再現性';
|
|
660
|
+
phase = 'D 再現性'; visited.add(phase);
|
|
638
661
|
const CLIP = { x: 0, y: 0, width: 1280, height: 720 };
|
|
639
662
|
// 撮る前に字と描画が落ち着くのを待つ(docs/contract.md §1:seek の後に requestAnimationFrame を 2 回)
|
|
640
663
|
// 埋め込みの字はスライドが見えたときに初めて読まれるので、先に全部読んでおく
|
|
@@ -687,7 +710,7 @@ await page.goto(url);
|
|
|
687
710
|
await page.waitForFunction(() => window.DECK && DECK.ready, null, { timeout: 15000 });
|
|
688
711
|
|
|
689
712
|
// ================================================================ F. 注目の演出
|
|
690
|
-
phase = 'F 強調';
|
|
713
|
+
phase = 'F 強調'; visited.add(phase);
|
|
691
714
|
const markInfo = await page.evaluate(() => {
|
|
692
715
|
const out = [];
|
|
693
716
|
DECK.slides.forEach((s, i) => {
|
|
@@ -706,7 +729,7 @@ for (const { i, key, marks } of markInfo) {
|
|
|
706
729
|
}
|
|
707
730
|
|
|
708
731
|
// ================================================================ G. モーフ(data-morph)
|
|
709
|
-
phase = 'G モーフ';
|
|
732
|
+
phase = 'G モーフ'; visited.add(phase);
|
|
710
733
|
const morphInfo = await page.evaluate(() => DECK.slides.map((s, i) => ({ i, m: DECK.morph(i) })).filter((x) => x.m));
|
|
711
734
|
for (const { i, m } of morphInfo) {
|
|
712
735
|
if (!m.src) { report(i, 'warn', 'morphNoSrc', { want: m.want }); continue; }
|
|
@@ -718,7 +741,7 @@ for (const { i, m } of morphInfo) {
|
|
|
718
741
|
}
|
|
719
742
|
|
|
720
743
|
// ================================================================ H. 読み上げ(画像と図の名前)
|
|
721
|
-
phase = 'H 読み上げ';
|
|
744
|
+
phase = 'H 読み上げ'; visited.add(phase);
|
|
722
745
|
const a11y = await page.evaluate(() => {
|
|
723
746
|
const named = (e, root) => {
|
|
724
747
|
for (let a = e; a && a !== root; a = a.parentElement) {
|
|
@@ -748,7 +771,7 @@ for (const { i, imgs, comps, svgs } of a11y) {
|
|
|
748
771
|
}
|
|
749
772
|
|
|
750
773
|
// ================================================================ E. タイムライン
|
|
751
|
-
phase = 'E タイムライン';
|
|
774
|
+
phase = 'E タイムライン'; visited.add(phase);
|
|
752
775
|
const tl = await page.evaluate(() => DECK.timeline());
|
|
753
776
|
const total = tl.length ? tl[tl.length - 1].start + tl[tl.length - 1].dur : 0;
|
|
754
777
|
report(null, 'info', 'timelineTotal', { s: total.toFixed(2), n: tl.length });
|
|
@@ -775,6 +798,15 @@ for (const e of [...new Set(consoleErrors.map(cleanErrorText))]) {
|
|
|
775
798
|
// ================================================================ 出力
|
|
776
799
|
const counts = { error: 0, warn: 0, info: 0 };
|
|
777
800
|
for (const r of results) counts[r.sev]++;
|
|
801
|
+
// 決まりの数え上げ(backlog #202、kit/core/check-rules.mjs):決まりごとに checked・excused・skipped・failed。どれにもならない決まりがあれば incomplete(終了コード 3)
|
|
802
|
+
const deckFolder = path.dirname(path.resolve(src));
|
|
803
|
+
const has = (...p) => fs.existsSync(path.join(deckFolder, ...p));
|
|
804
|
+
let srcText = '';
|
|
805
|
+
try { srcText = readRegular(src, { max: READ_LIMITS.source }).toString('utf8'); } catch { /* 組めたので読めるはず */ }
|
|
806
|
+
// 教材の性質は原稿と台本の文字列から(編集アプリと同じ factsFromSource)
|
|
807
|
+
const facts = factsFromSource({ deck: srcText, narration: narrText || '', audio: has('audio', 'manifest.json') || has('voice.json'), attachments: has(FORMAT.ATTACH_DIR), book: hasArticle(src) });
|
|
808
|
+
const acc = account({ results, visited, facts });
|
|
809
|
+
const ruleSet = createHash('sha256').update(ruleSetText()).digest('hex').slice(0, 12);
|
|
778
810
|
const ok = counts.error === 0;
|
|
779
811
|
|
|
780
812
|
// 言葉を作る:どこか(スライドの番号・見出し・id、段階)+何が違うか+どう直すか(kit/check-messages.mjs)
|
|
@@ -796,7 +828,7 @@ if (asJson) {
|
|
|
796
828
|
data: r.a,
|
|
797
829
|
msg: cliHints(r.msg),
|
|
798
830
|
}));
|
|
799
|
-
console.log(JSON.stringify({ ok, lang: ML, counts, results: out }, null, 2));
|
|
831
|
+
console.log(JSON.stringify({ ok, status: acc.status, lang: ML, counts, results: out, ruleSet, rules: acc.rules, summary: acc.summary, ...(acc.status === 'incomplete' ? { unset: acc.unset, problems: acc.problems } : {}) }, null, 2));
|
|
800
832
|
} else {
|
|
801
833
|
// スライド番号順(null=デッキ全体は先頭)にグループ化し、各グループ内は error → warn → info。見出しの行にスライドがあるので、行には段階と言葉だけ
|
|
802
834
|
const groups = new Map();
|
|
@@ -817,7 +849,10 @@ if (asJson) {
|
|
|
817
849
|
for (const r of items) console.log(` [${MARK[r.sev]}] ${stepOf(r.step)}${cliHints(r.what)}`);
|
|
818
850
|
}
|
|
819
851
|
console.log('');
|
|
820
|
-
console.log(EN ? `${counts.error}
|
|
852
|
+
console.log(EN ? `${counts.error} ${plural(counts.error, 'error')}, ${counts.warn} ${plural(counts.warn, 'warning')}, ${counts.info} info` : `エラー ${counts.error} 警告 ${counts.warn} 情報 ${counts.info}`);
|
|
853
|
+
const S = acc.summary;
|
|
854
|
+
console.log(EN ? `quality check items: ${S.checked} done, ${S.excused} not applicable, ${S.skipped} not run, ${S.failed} failed (of ${S.total})` : `品質チェックの項目:見た ${S.checked} 当てはまらない ${S.excused} 見られなかった ${S.skipped} 落ちた ${S.failed}(${S.total} のうち)`);
|
|
855
|
+
if (acc.status === 'incomplete') console.log((EN ? 'the check did not finish: ' : '点検が終わっていない:') + [...acc.unset.map((id) => id + (EN ? ' (not looked at)' : '(見ていない)')), ...acc.problems].join('; '));
|
|
821
856
|
}
|
|
822
857
|
// 出力を書き終えてから終える(stdout がパイプのとき、process.exit は書きかけの出力(64 KiB を超える分)を捨てる。--json の大きな結果が途中で切れていた)
|
|
823
|
-
process.stdout.write('', () => process.exit(ok ? 0 : 1));
|
|
858
|
+
process.stdout.write('', () => process.exit(acc.status === 'incomplete' ? 3 : ok ? 0 : 1));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// 本文の点検(kit/core/article-text.mjs・article.mjs)の知らせの言葉(日本語・英語)。何が違うかと、どう直すか。
|
|
2
2
|
// 場所(ファイル・行)は articleWhere が前に付け、仕様の節(§9C.x)は後ろに付ける。check(kit/check-messages.mjs の MESSAGES)と build が使う
|
|
3
3
|
import { quoteJa } from './quote-ja.mjs';
|
|
4
|
+
import { plural } from './plural.mjs';
|
|
4
5
|
const hintJa = (a) => (a.hint ? `:${a.hint} と書く` : '');
|
|
5
6
|
const hintEn = (a) => (a.hint ? `: write ${a.hint}` : '');
|
|
6
7
|
const WHY_SUBFIG = {
|
|
@@ -97,12 +98,12 @@ export const ARTICLE_MESSAGES = {
|
|
|
97
98
|
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)` },
|
|
98
99
|
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' },
|
|
99
100
|
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` },
|
|
100
|
-
articleUncited: { ja: (a) => `本文で引いていない文献が ${a.count} 件ある(${a.keys.join('・')}${a.count > a.keys.length ? ' …' : ''}):一覧には出ない`, en: (a) => `${a.count} reference
|
|
101
|
+
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` },
|
|
101
102
|
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` },
|
|
102
103
|
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)` },
|
|
103
|
-
articleLinkUnconfirmed: { ja: (a) => `スライドと節のつながり ${a.count} 組がまだ記録されていない(${a.pairs.join('、')}${a.count > a.pairs.length ? ' …' : ''}):npm run ids で記録すると、後でどちらかが変わったときに知らせる`, en: (a) => `${a.count} slide–section link
|
|
104
|
-
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} pair
|
|
105
|
-
articleSummary: { ja: (a) => `本文:ファイル ${a.files}、節 ${a.sections}、名前 ${a.labels}`, en: (a) => `article: ${a.files} file
|
|
104
|
+
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` },
|
|
105
|
+
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` },
|
|
106
|
+
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')}` },
|
|
106
107
|
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)` },
|
|
107
108
|
};
|
|
108
109
|
|
package/kit/core/attachments.mjs
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// attachmentName(path) ダウンロードの名前(パスの最後。危ない字を _ に)
|
|
12
12
|
// problems:{code, path?, …}。code は kit/check-messages.mjs の attach…(品質チェックと書き出しの知らせが同じ言葉を使う)
|
|
13
13
|
import { FORMAT } from './format.mjs';
|
|
14
|
+
import { plural } from './plural.mjs';
|
|
14
15
|
import { pathProblem, excludedReason, foldPath } from './portable.mjs';
|
|
15
16
|
import { inspectAttachment, nameProblem, roleProblem, blocking, kindOfName, roleAllows, attachmentMime, ROLE_KINDS, TITLE_CHARS, DESCRIPTION_CHARS, titleProblem, descriptionProblem, clipChars } from './attach-content.mjs';
|
|
16
17
|
export { inspectAttachment, nameProblem, roleProblem, blocking, kindOfName, roleAllows, attachmentMime, ROLE_KINDS, titleProblem, descriptionProblem, clipChars };
|
|
@@ -246,7 +247,7 @@ export function problemText(x) {
|
|
|
246
247
|
case 'attachPolyglot': return `attachment ${p} is also ${x.also} (a file of two types); not included`;
|
|
247
248
|
case 'attachUnsafe': return `attachment ${p}: ${UNSAFE_TEXT[x.what] || x.what}${x.detail ? ` (${x.detail})` : ''}, not allowed for attachments (§3.8); not included`;
|
|
248
249
|
case 'attachUnchecked': return `attachment ${p} cannot be checked (${x.why}); not included`;
|
|
249
|
-
case 'attachInjection': return `attachment ${p}: ${x.n} value
|
|
250
|
+
case 'attachInjection': return `attachment ${p}: ${x.n} ${plural(x.n, 'value')} ${x.n === 1 ? 'starts' : 'start'} with = + - @ or a tab and may be read as formulas by a spreadsheet${x.row ? ` (first at row ${x.row}, column ${x.col})` : x.where ? ` (in ${x.where})` : ''}; check before sharing`;
|
|
250
251
|
case 'attachPrivate': return `attachment ${p} seems to contain a ${x.what}; check before sharing`;
|
|
251
252
|
case 'attachBadDescription': return `attachment ${p}: the description ${x.why}; it is left out`;
|
|
252
253
|
case 'attachNoRole': return `attachment ${p} has no role in ${FORMAT.CONFIG_FILE} (${ATTACH_ROLES.join(', ')}); it is included but not listed for readers`;
|
package/kit/core/build-core.mjs
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// 書式・記法は kit/build.mjs の頭の注釈、約束事は docs/contract.md
|
|
21
21
|
import { parse } from 'parse5';
|
|
22
22
|
import { short } from './sha1.mjs';
|
|
23
|
+
import { plural } from './plural.mjs';
|
|
23
24
|
import { innerJa } from './quote-ja.mjs';
|
|
24
25
|
import { applyMetrics, DEFAULT_METRICS } from './theme-metrics.mjs';
|
|
25
26
|
import { RUNTIME_FORMAT, FORMAT } from './format.mjs';
|
|
@@ -725,7 +726,7 @@ export function buildBudget(limits = {}, start = 0) {
|
|
|
725
726
|
export { NotRegularFileError, ReadOverError };
|
|
726
727
|
// 大きさを読んだ後に、ファイルが大きくなった(読む前の大きさより多く読めた)
|
|
727
728
|
export class FileChangedError extends Error {
|
|
728
|
-
constructor(p, was, now) { super(`build: ${p} changed while reading (${was}
|
|
729
|
+
constructor(p, was, now) { super(`build: ${p} changed while reading (${was} ${plural(was, 'byte')} before, ${now} read); refusing to build`); this.name = 'FileChangedError'; this.code = 'build-too-large'; this.what = 'changed file'; }
|
|
729
730
|
}
|
|
730
731
|
// env の読み取り(readText・readBase64・readBytes)のたびに bud.read で数える。env.size(p) があれば読む前に(大きすぎるものは読まずに断る)、
|
|
731
732
|
// 読んだ後にも実際の大きさで数え直す(数えるのは max(読む前の大きさ, 実際の大きさ)。env.size は見積もりで、嘘をつくことも、読むまでに
|
|
@@ -13,11 +13,13 @@ export const IN_EDITOR = Object.freeze([
|
|
|
13
13
|
'slideId', 'legacyDataKey', 'legacyIndex', 'legacyColorClass', 'legacyStepAttr', 'legacyLectureMode', 'colorOutside', 'narrHeadingDiffers',
|
|
14
14
|
'narrNote', 'narrFormula', 'turnLong', 'narrLang', 'predictAnswerWithCount', 'predictAnswerNeverShown',
|
|
15
15
|
// app/main.js・app/llm.js(作業場所の原稿と台本から)
|
|
16
|
-
'refVoice', 'audioStale', 'narrPlaceholder', 'templateText', 'readingExpr', 'readingSeveral',
|
|
16
|
+
'refVoice', 'audioStale', 'narrPlaceholder', 'templateText', 'readingExpr', 'readingSeveral', 'readingGap',
|
|
17
17
|
// 体裁の検査(kit/core/layout-scan.mjs。bodyBottom・bodyRight は EDITOR_ALIAS)
|
|
18
18
|
'titleLong', 'titleLongEn', 'titleColon', 'tateTitle', 'conclLong', 'conclLongEn', 'conclOverflow', 'tateBodyHead', 'bodyConclCol', 'bodyLeft',
|
|
19
19
|
'smallText', 'smallSvgText', 'textClipped', 'svgTextOut', 'svgTextBox', 'outsideBody', 'textOffSlide', 'textOverlap', 'cellWordBreak',
|
|
20
20
|
'secHeading', 'textContrast', 'cardsHint',
|
|
21
|
+
// 描いた図の形(kit/core/geometry-check.mjs。R-geometry)
|
|
22
|
+
'geoEdgeThroughBox', 'geoLineOverLabel', 'geoLabelOverlap', 'geoLabelOutsideBox', 'geoTateSlides',
|
|
21
23
|
// プレビューの中(app/frame-shim.js)
|
|
22
24
|
'themeMetricsDrift', 'metricsFontLoad', 'fontNotEmbedded', 'desuMasu', 'rawMath', 'katexError', 'punctMixed', 'narrRecheck',
|
|
23
25
|
'linkEmpty', 'linkUnknown', 'linkNumberRange', 'linkNoConcl', 'linkStepRange', 'linkBadStep', 'linkNumber', 'linkNoId', 'linkCount',
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// kit/check.mjs の結果(終了コードと --json の出力)を読む側の共通の部品。Node にもブラウザにも依存しない
|
|
2
2
|
// 検査が終わっていない(ブラウザが起動できない・落ちた)ときは、終了コード 2・JSON は status: "crashed"(指摘なし)。
|
|
3
|
+
// 決まりの数え上げ(kit/core/check-rules.mjs)でどれにもならない決まりが残ったときは、終了コード 3・JSON は status: "incomplete"(その結果も「エラー 0」ではない)。
|
|
3
4
|
// 「指摘 0」「エラー 0」と取り違えないように、結果を読むところはこの関数を通す(無効な結果は例外)
|
|
4
5
|
// parseCheck(stdout, status?) → check --json の結果({ok, lang, counts, results})。status は終了コード(分かれば)
|
|
5
6
|
// checkFinished(result, status?) → bool:検査が終わった結果か
|
|
6
7
|
export function checkFinished(result, status) {
|
|
7
|
-
return status !== 2 && !!result && result.status !== 'crashed' && Array.isArray(result.results);
|
|
8
|
+
return status !== 2 && status !== 3 && !!result && result.status !== 'crashed' && result.status !== 'incomplete' && Array.isArray(result.results);
|
|
8
9
|
}
|
|
9
10
|
export function parseCheck(stdout, status) {
|
|
10
11
|
let j = null;
|