From d92a600f45c534a88afcefdf35021e328dd0db26 Mon Sep 17 00:00:00 2001 From: Sri Panyam Date: Mon, 21 Sep 2026 09:22:53 +0000 Subject: [PATCH 1/2] Make every docs example parse, and add a test that keeps it that way 39 of the 148 live examples in docs/content did not parse. NotationBlock.updatePreview renders nothing when load() reports errors, so those were blank boxes on the site with the reason only in the browser console. Five more parsed but contained ___, which lexes as an ordinary identifier and renders as visible text where a silent space was meant. The examples were written against a syntax the parser does not implement. Rather than guess at the grammar changes, this rewrites them onto what works today and files issue 27 with the impact analysis for each construct, to be evaluated once the site renders. Rewrites, applied inside bodies and never to a line starting with >, which is a raw markdown embedding: | and || removed. beatviews.ts already draws a bar line at the end of each bar and a double line at the end of the avartanam, from the cycle, so these characters were redundant with what gets drawn anyway. ___ and _ one comma per underscore, which keeps the duration the example was written with at the cost of showing the commas. M#, GM#P quoted, so the text renders as written. Sharps are excluded from IdentChar and carry no meaning to the layout engine either way. \accidentals, \noTala removed. Neither command exists, and both threw out of load() rather than reporting an error, see issue 28. Four examples using the paren gamaka syntax, ((S R G) kampitam) and (R~G), are rewritten with the ~ operators that exist. Those are the ones whose meaning changed, since the two notations are not equivalent. Four more in reference/embellishments had the operator in a position the grammar does not allow, since every embellishment attaches to the literal that follows it. Prose that described the removed constructs is corrected rather than left claiming things that do not work. The Comments section of the syntax reference was the one feature on that page shown as a dead code block while its fourteen neighbours were live examples. It is live now, as are the two example pages whose "Using Comments" sections used \line() titles instead of comments. docs/tests/examples.spec.ts asserts both properties for every example and runs in CI with the rest of the suite. --- docs/.claude/settings.local.json | 15 ++++ docs/content/api/integration-guide/index.html | 2 +- .../api/integration-guide/nodejs/index.html | 8 +-- .../api/integration-guide/react/index.html | 4 +- .../api/integration-guide/vue/index.html | 4 +- .../web-components/index.html | 2 +- docs/content/api/styling/index.html | 6 +- .../demos/playgrounds/model-events/index.html | 2 +- docs/content/examples/basic-varnam/index.html | 2 +- .../examples/complex-gamakas/index.html | 4 +- .../organizing-compositions/index.html | 67 +++++++++--------- docs/content/examples/percussion/index.html | 60 ++++++++-------- .../examples/ragam-tanam-pallavi/index.html | 51 ++++++-------- docs/content/examples/tisram/index.html | 26 +++---- docs/content/index.html | 2 +- .../reference/embellishments/index.html | 8 +-- docs/content/reference/syntax/index.html | 24 ++++--- docs/content/tutorials/01-basics/index.html | 6 +- docs/content/tutorials/02-commands/index.html | 20 +++--- docs/tests/examples.spec.ts | 68 +++++++++++++++++++ 20 files changed, 230 insertions(+), 151 deletions(-) create mode 100644 docs/.claude/settings.local.json create mode 100644 docs/tests/examples.spec.ts diff --git a/docs/.claude/settings.local.json b/docs/.claude/settings.local.json new file mode 100644 index 0000000..e45680a --- /dev/null +++ b/docs/.claude/settings.local.json @@ -0,0 +1,15 @@ +{ + "permissions": { + "allow": [ + "Bash(pnpm build:*)", + "Bash(npm info:*)", + "Bash(cat:*)", + "Bash(ls:*)", + "Bash(grep:*)", + "Bash(pnpm run buildbase:*)", + "Bash(xargs basename:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/docs/content/api/integration-guide/index.html b/docs/content/api/integration-guide/index.html index a73ecbb..519552e 100644 --- a/docs/content/api/integration-guide/index.html +++ b/docs/content/api/integration-guide/index.html @@ -83,7 +83,7 @@

CDN / Vanilla HTML

\cycle("|4|2|2|") Sw: S R G M P D N S. Sh: sa ri ga ma pa dha ni sa -
+
diff --git a/docs/content/api/integration-guide/nodejs/index.html b/docs/content/api/integration-guide/nodejs/index.html index c6a2525..900bc4b 100644 --- a/docs/content/api/integration-guide/nodejs/index.html +++ b/docs/content/api/integration-guide/nodejs/index.html @@ -86,11 +86,11 @@

Accessing Notation Structure

\cycle("|4|2|2|") \line("Pallavi") -Sw: S , R , | G , M , | P , D , | N , S. , || -Sh: ni , nnu , | ko , ri , | va , ra , | nam , ma , || +Sw: S , R , G , M , P , D , N , S. , +Sh: ni , nnu , ko , ri , va , ra , nam , ma , \line("Anupallavi") -Sw: S. , N , | D , P , | M , G , | R , S , || -Sh: en , na , | gu , ru , | sva , mi , | ra , ya , || +Sw: S. , N , D , P , M , G , R , S , +Sh: en , na , gu , ru , sva , mi , ra , ya ,

Validation

diff --git a/docs/content/api/integration-guide/react/index.html b/docs/content/api/integration-guide/react/index.html index ffcbc66..882582a 100644 --- a/docs/content/api/integration-guide/react/index.html +++ b/docs/content/api/integration-guide/react/index.html @@ -73,7 +73,7 @@

Basic NotationViewer Component

\cycle("|4|2|2|") Sw: S R G M P D N S. Sh: sa ri ga ma pa dha ni sa - + @@ -156,7 +156,7 @@

Component with Source Display and Editing

\line("Pallavi") Sw: S , R , G , M , P , D , N , S. , Sh: ni , nnu , ko , ri , va , ra , nam , ma , - + diff --git a/docs/content/api/integration-guide/vue/index.html b/docs/content/api/integration-guide/vue/index.html index a74a3b3..48f5e4f 100644 --- a/docs/content/api/integration-guide/vue/index.html +++ b/docs/content/api/integration-guide/vue/index.html @@ -79,7 +79,7 @@

Basic NotationViewer Component

\cycle("|4|2|2|") Sw: S R G M P D N S. Sh: sa ri ga ma pa dha ni sa - + @@ -191,7 +191,7 @@

Component with Source Display and Editing

\line("Pallavi") Sw: S , R , G , M , P , D , N , S. , Sh: ni , nnu , ko , ri , va , ra , nam , ma , - + diff --git a/docs/content/api/integration-guide/web-components/index.html b/docs/content/api/integration-guide/web-components/index.html index 8ba297d..8070d4d 100644 --- a/docs/content/api/integration-guide/web-components/index.html +++ b/docs/content/api/integration-guide/web-components/index.html @@ -189,7 +189,7 @@

Advanced: External Source

\beatDuration(4) \line("Pallavi") Sw: S , R , G , M , P , D , N , S. , -Sh: ni , nnu , ko , ri , va , ra , nam , ma , +Sh: ni , nnu , ko , ri , va , ra , nam , ma ,

Interactive Features

diff --git a/docs/content/api/styling/index.html b/docs/content/api/styling/index.html index fb116b0..74449ee 100644 --- a/docs/content/api/styling/index.html +++ b/docs/content/api/styling/index.html @@ -156,7 +156,7 @@

Ocean Theme

\cycle("|4|2|2|") \beatDuration(4) Sw: S R G M , P D , N S. - +
@@ -165,7 +165,7 @@

Forest Theme

\cycle("|4|2|2|") \beatDuration(4) Sw: S R G M , P D , N S. - +
@@ -174,7 +174,7 @@

Sunset Theme

\cycle("|4|2|2|") \beatDuration(4) Sw: S R G M , P D , N S. - +

CSS for Scoped Themes

diff --git a/docs/content/demos/playgrounds/model-events/index.html b/docs/content/demos/playgrounds/model-events/index.html index 1e8c7c0..b72fde5 100644 --- a/docs/content/demos/playgrounds/model-events/index.html +++ b/docs/content/demos/playgrounds/model-events/index.html @@ -94,7 +94,7 @@

Notation Syntax

S R G MIndividual notes S. or S'Higher octave .S or S,Lower octave - , or _Space/silence + ,Space/silence [ G M P ]Group (atoms share duration) 2 SDuration prefix (S has duration 2) diff --git a/docs/content/examples/basic-varnam/index.html b/docs/content/examples/basic-varnam/index.html index 37e6bf6..65cbca9 100644 --- a/docs/content/examples/basic-varnam/index.html +++ b/docs/content/examples/basic-varnam/index.html @@ -163,7 +163,7 @@

Tips for Varnam Notation

diff --git a/docs/content/examples/complex-gamakas/index.html b/docs/content/examples/complex-gamakas/index.html index 099cc09..550ee89 100644 --- a/docs/content/examples/complex-gamakas/index.html +++ b/docs/content/examples/complex-gamakas/index.html @@ -94,8 +94,8 @@

Combining with Speed Changes

Practical Tips