web/dreamstop.openfp.net · commit
Lead with the menu and explain each position
parents: 2123ab3396
Lead with the menu and explain each position The menu of positions now comes first and the clear ChangeLog entry follows it. Each tab ends with a plain note on what its position records. Prose that names a code holds it as a code segment, so every code on the page is coloured, and a build check fails on any code left uncoloured. Release 0.4.0.0.
9 files changed
Diff
dreamstop-openfp-net-web/ChangeLog.md | 6 + dreamstop-openfp-net-web/README.md | 13 +- .../dreamstop-openfp-net-web.cabal | 2 +- dreamstop-openfp-net-web/src/Site/Content.hs | 147 ++++++++++++++++++--- dreamstop-openfp-net-web/src/Site/View.hs | 35 +++-- dreamstop.css | 1 + horizon.lock | 6 +- nix/horizon/pkgs/dreamstop-openfp-net-web.nix | 4 +- nix/site.nix | 12 ++ 9 files changed, 186 insertions(+), 40 deletions(-) diff --git a/dreamstop-openfp-net-web/ChangeLog.md b/dreamstop-openfp-net-web/ChangeLog.md index 8ef8d0c..72abed1 100644 @@ -1,5 +1,11 @@ # ChangeLog +## 0.4.0.0 — 2026-12-06 + +- The menu of positions now comes first on the front page, and the clear ChangeLog entry now follows it. +- Each position's tab now ends with a short plain note on what the position records, naming its codes. +- Every code on the front page is now shown in its position's colour, including codes inside notes. The build now fails if a code appears outside a coloured code. + ## 0.3.1.0 — 2026-12-06 - The front page no longer names a source under its examples or its ChangeLog entry, so each example stands on its own. diff --git a/dreamstop-openfp-net-web/README.md b/dreamstop-openfp-net-web/README.md index 633d7d6..67246db 100644 @@ -1,10 +1,12 @@ # dreamstop-openfp-net-web The dreamstop.openfp.net website: the front page of dreamstop, a language -for disambiguating text. The page says what dreamstop is, shows a clear -ChangeLog entry and, for each codepoint position, a clear, an ambiguous and a -nonsense example where a real example exists, and teaches minimal pairs -with one pair from a real ChangeLog. It links the dreamstop user manual, a +for disambiguating text. The page says what dreamstop is and shows, for +each codepoint position, a clear, an ambiguous and a nonsense example where +a real example exists, with a plain note on what the position records. It +then shows a clear ChangeLog entry and teaches minimal pairs with one pair +from a real ChangeLog. Every code on the page is shown in its position's +colour. It links the dreamstop user manual, a PDF served at `/manual/dreamstop.pdf`. ## What it gives you @@ -14,7 +16,8 @@ The dreamstop.openfp.net page as one design-kit `Site` in Miso. - `Site.Page` is the document head: the title, the description, the icon, the stylesheets and the preview card. - `Site.Content` is what the page says that is data: the links, the ChangeLog - entry, the examples for each position and the minimal pair. + entry, the examples and note for each position, and the minimal pair. Prose + that names a code holds it as a code, so the page always colours it. - `Site.View` is the body. Its one state is the position the menu shows, which a click or the arrow, Home and End keys on a tab change. - `dreamstop-openfp-net-web-render` writes the page to stdout as diff --git a/dreamstop-openfp-net-web/dreamstop-openfp-net-web.cabal b/dreamstop-openfp-net-web/dreamstop-openfp-net-web.cabal index 2f0e24b..f1f7161 100644 @@ -1,6 +1,6 @@ cabal-version: 3.0 name: dreamstop-openfp-net-web -version: 0.3.1.0 +version: 0.4.0.0 synopsis: The dreamstop.openfp.net page, pre-rendered and hydrated description: The dreamstop page as one design-kit Site: rendered to static HTML diff --git a/dreamstop-openfp-net-web/src/Site/Content.hs b/dreamstop-openfp-net-web/src/Site/Content.hs index 87a5d46..9cbbf59 100644 @@ -19,6 +19,9 @@ module Site.Content , verdictName , LayerExample (MkLayerExample, layerVerdict, layerExample, layerDecides, layerSource) , layerExamples + , Segment (Words, Code) + , Prose + , positionNote , pair , pairSlot ) where @@ -161,7 +164,7 @@ type LayerExample :: Type data LayerExample = MkLayerExample { layerVerdict :: Verdict , layerExample :: Example - , layerDecides :: MisoString + , layerDecides :: Prose , layerSource :: MisoString } @@ -174,80 +177,80 @@ layerExamples = \case Force -> [ example Clear "This edition retires QC.DescribeCheckCoverage." [MkReading "[DEC·PFV]" "saying it makes it so: the edition retires the rule"] - "DEC: the sentence retires the rule by being said, rather than reporting that it was retired." + [Code "DEC", Words ": the sentence retires the rule by being said, rather than reporting that it was retired."] "From the ChangeLog of quality-control, release 0.7.0.0." , example Ambiguous "Split vortex-shell from the vortex repository into its own repository." [ MkReading "[ASR·PFV]" "reports that the release moved vortex-shell into its own repository" , MkReading "[DIR·PFV]" "tells the reader to move it" ] - "ASR or DIR: the codes decide whether the sentence reports a change or gives an instruction." + [Code "ASR", Words " or ", Code "DIR", Words ": the codes decide whether the sentence reports a change or gives an instruction."] "From the ChangeLog of vortex-shell, release 0.1.0." ] Mood -> [ example Clear "This would have caught the dead buttons." [MkReading "[ASR·COU·PFV]" "it did not catch them, and it would have if it had been in place"] - "COU: the event is known not to have happened." + [Code "COU", Words ": the event is known not to have happened."] "From the unsafePerformApocalypse estate plan." ] Aspect -> [ example Clear "Added a console that preserves bindings between commands." [MkReading "[ASR·PFV] [ASR·HAB]/rel1" "the release added the console, and preserving bindings is what the console does"] - "PFV against HAB: the adding is one event, and the preserving is standing behaviour." + [Code "PFV", Words " against ", Code "HAB", Words ": the adding is one event, and the preserving is standing behaviour."] "From the Quality Control Handbook, CLG.ChooseEntryForms." ] Phase -> [ example Clear "A project or group called `sw.js` is not yet refused." [MkReading "[ASR·HAB·EXP]" "not refused before the release or in it, and refusal is expected later"] - "EXP: false before the release, false after it, and expected to change." + [Code "EXP", Words ": false before the release, false after it, and expected to change."] "From the ChangeLog of nixlab-shell, release 0.98.0.0." , example Nonsense "Removed the legacy importer, which reads the old export format." [] - "Under the release action, the relative clause says the importer reads the format from this release on, but the same release removed it." + [Words "Under the release action, the relative clause says the importer reads the format from this release on, but the same release removed it."] "From the Quality Control Handbook, CLG.DescribeAddedThingsInPresent." ] Modality -> [ example Clear "Callers of `runScript` must now pass a `Charge` record." [MkReading "[ASR·HAB·INC·DEO·NEC]" "a rule now requires callers to pass one"] - "DEO·NEC: a rule requires it." + [Code "DEO", Words "·", Code "NEC", Words ": a rule requires it."] "From the Quality Control Handbook, CLG.StateReaderObligations." , example Ambiguous "A site's `root` may now be a package or an absolute path." [ MkReading "[ASR·HAB·INC·DEO·POS]" "a rule now allows either" , MkReading "[ASR·HAB·INC·ABL·POS]" "the program can now take either" ] - "DEO or ABL: the codes decide whether a rule allows it or the program is able to do it." + [Code "DEO", Words " or ", Code "ABL", Words ": the codes decide whether a rule allows it or the program is able to do it."] "From the ChangeLog of skettis, release 0.2.60." ] Negation -> [ example Clear "Maintainers must not edit the generated file by hand." [MkReading "[ASR·HAB·DEO·NEC·NEG]" "a rule requires that they do not edit it"] - "NEG after DEO·NEC negates the edit, not the rule, so the sentence prohibits editing." + [Code "NEG", Words " after ", Code "DEO", Words "·", Code "NEC", Words " negates the edit, not the rule, so the sentence prohibits editing."] "From the Quality Control Handbook, QC.ClarifyExceptionsAndNegation." ] Bound -> [ example Clear "The store now imports the SQLite review and sign-off tables once, at its first use." [MkReading "[ASR·PFV·INC·ONE] {review: OBJ} {sign-off: OBJ}" "a one-off import, new in this release, at the store's first use"] - "ONE: the import happens one time in the program's life." + [Code "ONE", Words ": the import happens one time in the program's life."] "From the ChangeLog of nixlab-shell, release 0.122.0.0." , example Ambiguous "`MovesNotFollowed` or `CheckpointFailed` after the import is reported once and tried again with the next to-do call." [ MkReading "[ASR·PFV·ONE] [ASR·HAB] {import: BSC} {call: BSC}" "the error is reported one time only" , MkReading "[ASR·HAB] [ASR·HAB] {import: BSC} {call: BSC}" "the error is reported once for each failure" ] - "ONE or none: the codes decide whether the report happens one time ever or each time." + [Code "ONE", Words " or none: the codes decide whether the report happens one time ever or each time."] "From the deployment guide of systems/shattrath." ] Evidence -> [ example Clear "Median startup time fell from 800 ms to 200 ms with a warm library cache in the recorded benchmark." [MkReading "[ASR·PFV·PUP]" "a measured fall, which the recorded benchmark lets anyone check"] - "PUP: a record someone else can check backs the figure." + [Code "PUP", Words ": a record someone else can check backs the figure."] "From the Quality Control Handbook, CLG.ChooseEntryForms." ] Nominalisation -> [ example Clear "On first start the forge now imports every review from the SQLite database once." [MkReading "[ASR·PFV·INC·ONE] {start: BSC} {review: OBJ}" "a review here is a record, what reviewing produced"] - "OBJ: review names the record, not the act of reviewing." + [Code "OBJ", Words ": review names the record, not the act of reviewing."] "From the Quality Control Handbook, CLG.DescribeAddedThingsInPresent." ] where - example :: Verdict -> MisoString -> [Reading] -> MisoString -> MisoString -> LayerExample + example :: Verdict -> MisoString -> [Reading] -> Prose -> MisoString -> LayerExample example v s rs = MkLayerExample v (MkExample (verdictName v) s rs) -- | The handbook's contrast for CLG.DescribeAddedThingsInPresent as a @@ -273,3 +276,117 @@ storeMoves = MkReading "[ASR·PFV] {review: OBJ} [ASR·HAB]/rel1 {reviews: OBJ}" -- | The review-store relative clause read as a migration that already happened. storeMoved :: Reading storeMoved = MkReading "[ASR·PFV] {review: OBJ} [ASR·PFV·ONE]/rel1 {reviews: OBJ}" "reviews and sign-offs were moved out of SQLite once, a migration that already happened" + +-- | A piece of prose: plain words, or a code, which the page always shows in +-- its position's colour. Prose that names a code holds it as a @Code@, never +-- inside @Words@. +-- +-- @since 0.4.0.0 +type Segment :: Type +data Segment + = Words MisoString + | Code MisoString + +-- | Prose made of words and codes. +-- +-- @since 0.4.0.0 +type Prose :: Type +type Prose = [Segment] + +-- | What a position records, in one or two plain sentences that name its +-- codes. +-- +-- @since 0.4.0.0 +positionNote :: Layer -> Prose +positionNote = \case + Force -> + [ Words "Force says what a sentence does: it states something (" + , Code "ASR" + , Words "), tells the reader to act (" + , Code "DIR" + , Words "), asks a question (" + , Code "IRG" + , Words "), makes something so by saying it (" + , Code "DEC" + , Words "), warns of a risk (" + , Code "ADM" + , Words ") or makes a promise (" + , Code "CMS" + , Words ")." + ] + Mood -> + [ Words "Mood says whether the writer stands behind a clause (" + , Code "FAC" + , Words "), only considers it without taking a side (" + , Code "HYP" + , Words "), or considers something known to be false (" + , Code "COU" + , Words ")." + ] + Aspect -> + [ Words "Aspect says whether a clause reports one finished event (" + , Code "PFV" + , Words "), a state reached (" + , Code "PRF" + , Words "), something in progress (" + , Code "PRG" + , Words "), or something that happens regularly (" + , Code "HAB" + , Words ")." + ] + Phase -> + [ Words "Phase compares a release with the one before it: something is now true (" + , Code "INC" + , Words "), has stopped being true (" + , Code "CSS" + , Words "), stays true (" + , Code "CNT" + , Words "), or is expected but still not true (" + , Code "EXP" + , Words ")." + ] + Modality -> + [ Words "Modality says what a clause rests on, a rule (" + , Code "DEO" + , Words "), what a thing can do (" + , Code "ABL" + , Words ") or what a goal needs (" + , Code "TEL" + , Words "), and how strongly: always (" + , Code "NEC" + , Words "), ideally (" + , Code "WNC" + , Words ") or possibly (" + , Code "POS" + , Words ")." + ] + Negation -> + [ Words "Negation (" + , Code "NEG" + , Words ") says what a clause denies: the “may” or “must” itself, or the thing that may or must happen." + ] + Bound -> + [ Words "Bound (" + , Code "ONE" + , Words ") marks something that happens exactly once in the program’s life, such as an import on first start, rather than every time." + ] + Evidence -> + [ Words "Evidence says how the writer knows: they saw it (" + , Code "OBS" + , Words "), a record anyone can check shows it (" + , Code "PUP" + , Words "), someone told them (" + , Code "RPR" + , Words "), they worked it out (" + , Code "INF" + , Words "), or they remember it (" + , Code "REC" + , Words ")." + ] + Nominalisation -> + [ Words "Nominalisation says what a noun made from a verb means: the act itself (" + , Code "BSC" + , Words "), such as a check being run, or what the act produces (" + , Code "OBJ" + , Words "), such as a review." + ] diff --git a/dreamstop-openfp-net-web/src/Site/View.hs b/dreamstop-openfp-net-web/src/Site/View.hs index 4b59e09..82ebcfe 100644 @@ -39,8 +39,9 @@ import Site.Content (Entry (entryHeading, entrySentences), Layer, LayerExample (layerDecides, layerExample), Reading (readingCodes, readingGloss), - entry, layerExamples, layerName, layers, - manual, package, pair, pairSlot, + Segment (Code, Words), entry, + layerExamples, layerName, layers, manual, + package, pair, pairSlot, positionNote, repository) import Site.Page (name) @@ -135,26 +136,26 @@ view (MkModel selected) = ] ] , section_ - [classList ["band"], id_ "entry"] + [classList ["band"], id_ "verdicts"] [ div_ [classList ["container"]] - [ h2_ [classList ["section-title"], fontDisplay] ["A clear ChangeLog entry"] + [ h2_ [classList ["section-title"], fontDisplay] ["Clear, ambiguous or nonsense"] , div_ - [classList ["changelog"]] - [ p_ [classList ["entry-heading"]] [text (entryHeading entry)] - , ul_ [classList ["entry-bullets"]] (map bullet (entrySentences entry)) - ] + [classList ["tabs"], role_ "tablist", aria_ "label" "Kinds of meaning"] + (map tab layers) + , div_ [classList ["panels"]] (map panel layers) ] ] , section_ - [classList ["band"], id_ "verdicts"] + [classList ["band"], id_ "entry"] [ div_ [classList ["container"]] - [ h2_ [classList ["section-title"], fontDisplay] ["Clear, ambiguous or nonsense"] + [ h2_ [classList ["section-title"], fontDisplay] ["A clear ChangeLog entry"] , div_ - [classList ["tabs"], role_ "tablist", aria_ "label" "Kinds of meaning"] - (map tab layers) - , div_ [classList ["panels"]] (map panel layers) + [classList ["changelog"]] + [ p_ [classList ["entry-heading"]] [text (entryHeading entry)] + , ul_ [classList ["entry-bullets"]] (map bullet (entrySentences entry)) + ] ] ] , section_ @@ -227,6 +228,7 @@ view (MkModel selected) = ] [ h3_ [classList ["panel-title", layerClass l]] [text (layerName l)] , ul_ [classList ["readings"]] (map layerCard (layerExamples l)) + , p_ [classList ["position-note"]] (map notePart (positionNote l)) ] layerCard :: LayerExample -> View Model Action @@ -237,7 +239,7 @@ view (MkModel selected) = , blockquote_ [classList ["entry"]] [text (exampleSentence (layerExample x))] ] <> readings (exampleReadings (layerExample x)) - <> [p_ [classList ["decides"]] [text (layerDecides x)]] + <> [p_ [classList ["decides"]] (map notePart (layerDecides x))] ) example :: Example -> View Model Action @@ -259,6 +261,11 @@ view (MkModel selected) = , ol_ [classList ["annotation"]] (map (li_ [] . reading) rs) ] + notePart :: Segment -> View Model Action + notePart = \case + Words w -> text w + Code c -> codepoints c + reading :: Reading -> [View Model Action] reading r = [codepoints (readingCodes r), text (": " <> readingGloss r)] diff --git a/dreamstop.css b/dreamstop.css index ca960ab..b363bb3 100644 @@ -151,6 +151,7 @@ ul.entry-bullets blockquote.entry { margin: 0 0 .4rem; } ul.readings h4 { font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--title); margin: .2rem 0 .4rem; } ul.readings p.decides { color: var(--text); font-size: .9rem; } +.panel p.position-note { margin-top: 1.25rem; max-width: 60ch; color: var(--text); } html:not(.dk-js) .tabs { display: none; } html.dk-js .panel.inactive { display: none; } html.dk-js .panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; } diff --git a/horizon.lock b/horizon.lock index 4d0c6f4..bc028ad 100644 @@ -1,8 +1,8 @@ -- Generated by horizon-gen-nix. Do not edit. lock "design-kit-miso" "ec93f8c68921b8da55887a33b0bd925338bf925be19b0df4517050b7e98d905e" -lock "dreamstop-openfp-net-web" "acba1e34e8a9463f32d0f5b3dce5e37ed292925156d480a494caddd660740f23" +lock "dreamstop-openfp-net-web" "dce6e5b1dc4985734bee3980719320a8a7483aba0acaec23f3062c5cf5c1aa33" stage "Release" role "Project" -snapshot 1 "970541b1ebf276b59a3f38f1195c9b03d058ee6a4f7e235c0da538a4518a1a07" "role Policy.Project\ncompiler \"ghc-10.0.0.20260917\"\nplatform \"javascript-ghcjs\"\nindexState \"2026-10-08T00:00:00Z\"\nwarnings \"werrorwolf\"\ndevShellWith [\"cabal-install\", \"nodejs-slim\"]\nrepository \"openfp\" \"https://jungle.openfp.net\" 2 [\"e71cf1e29851e14e8688f1f6df8db454c6448bb9385ab77cacce2347f4afa763\", \"b3bb9400c3f1f8f0905f14ac957e8a67050dbb2f1c83ec5e9d7e9560d6611804\", \"32c150cd3ca6a71899423da88ebc5f82f4e114113889e78d99211a290aa2d0bd\"]\noverlay \"overlay.nix\"\nhackageFrom \"openfp\" \"design-kit-miso\" \"0.4.0\"\nlocal \"dreamstop-openfp-net-web\" \"dreamstop-openfp-net-web/\"\n" [] +snapshot 1 "89331c8d88badbead1d2471091e1db68b81f21b7186a868b271390e2978f543b" "role Policy.Project\ncompiler \"ghc-10.0.0.20260917\"\nplatform \"javascript-ghcjs\"\nindexState \"2026-10-08T00:00:00Z\"\nwarnings \"werrorwolf\"\ndevShellWith [\"cabal-install\", \"nodejs-slim\"]\nrepository \"openfp\" \"https://jungle.openfp.net\" 2 [\"e71cf1e29851e14e8688f1f6df8db454c6448bb9385ab77cacce2347f4afa763\", \"b3bb9400c3f1f8f0905f14ac957e8a67050dbb2f1c83ec5e9d7e9560d6611804\", \"32c150cd3ca6a71899423da88ebc5f82f4e114113889e78d99211a290aa2d0bd\"]\noverlay \"overlay.nix\"\nhackageFrom \"openfp\" \"design-kit-miso\" \"0.4.0\"\nlocal \"dreamstop-openfp-net-web\" \"dreamstop-openfp-net-web/\"\n" [] resolved "design-kit-miso" "{ mkDerivation, base, bytestring, containers, fetchurl, lib, miso }:\n mkDerivation {\n pname = \"design-kit-miso\";\n version = \"0.4.0\";\n src = fetchurl {\n url = \"https://jungle.openfp.net/package/design-kit-miso-0.4.0.tar.gz\";\n sha256 = \"1fe65b16f18991680097d312f9c6e59fc9fd53bd5afc795227a1722a1c082525\";\n };\n passthru.openfpRelease = {\n repository = \"https://nixlab.openfp.net/design/design-kit\";\n tag = \"0.4.0\";\n ref = \"refs/tags/0.4.0\";\n commit = \"dacec0ae2ee95cef02001432aab7965f9226400f\";\n subdir = \"design-kit-miso\";\n archiveSha256 = \"1fe65b16f18991680097d312f9c6e59fc9fd53bd5afc795227a1722a1c082525\";\n };\n isLibrary = true;\n isExecutable = false;\n enableSeparateDataOutput = false;\n libraryHaskellDepends = [ base bytestring containers miso ];\n enableLibraryProfiling = false;\n enableExecutableProfiling = false;\n doHaddock = true;\n jailbreak = false;\n doCheck = false;\n doBenchmark = false;\n hyperlinkSource = false;\n description = \"The design kit as Miso: pages pre-rendered at build time, then hydrated\";\n license = lib.meta.getLicenseFromSpdxId \"MIT\";\n broken = false;\n }" -resolved "dreamstop-openfp-net-web" "{ mkDerivation, base, design-kit-miso, lib, miso }:\n mkDerivation {\n pname = \"dreamstop-openfp-net-web\";\n version = \"0.3.1.0\";\n src = config.horizon.local.source (local.self) \"dreamstop-openfp-net-web\";\n passthru = {\n cabalFile = config.horizon.local.file (local.self) \"dreamstop-openfp-net-web/dreamstop-openfp-net-web.cabal\";\n cabalSha256 = \"2c491025329347ed4cfbc467a147aaeb11934109bea9fc6c2e468a950bfd0e7f\";\n };\n isLibrary = true;\n isExecutable = true;\n enableSeparateDataOutput = false;\n libraryHaskellDepends = [ base design-kit-miso miso ];\n executableHaskellDepends = [ base design-kit-miso ];\n enableLibraryProfiling = false;\n enableExecutableProfiling = false;\n doHaddock = true;\n jailbreak = false;\n doCheck = true;\n doBenchmark = false;\n hyperlinkSource = false;\n description = \"The dreamstop.openfp.net page, pre-rendered and hydrated\";\n license = lib.meta.getLicenseFromSpdxId \"MIT\";\n broken = false;\n }" +resolved "dreamstop-openfp-net-web" "{ mkDerivation, base, design-kit-miso, lib, miso }:\n mkDerivation {\n pname = \"dreamstop-openfp-net-web\";\n version = \"0.4.0.0\";\n src = config.horizon.local.source (local.self) \"dreamstop-openfp-net-web\";\n passthru = {\n cabalFile = config.horizon.local.file (local.self) \"dreamstop-openfp-net-web/dreamstop-openfp-net-web.cabal\";\n cabalSha256 = \"7000e551d111dbfce8a3d1014bfd45056ea0b81efc9ca584c6318a19e88885d4\";\n };\n isLibrary = true;\n isExecutable = true;\n enableSeparateDataOutput = false;\n libraryHaskellDepends = [ base design-kit-miso miso ];\n executableHaskellDepends = [ base design-kit-miso ];\n enableLibraryProfiling = false;\n enableExecutableProfiling = false;\n doHaddock = true;\n jailbreak = false;\n doCheck = true;\n doBenchmark = false;\n hyperlinkSource = false;\n description = \"The dreamstop.openfp.net page, pre-rendered and hydrated\";\n license = lib.meta.getLicenseFromSpdxId \"MIT\";\n broken = false;\n }" diff --git a/nix/horizon/pkgs/dreamstop-openfp-net-web.nix b/nix/horizon/pkgs/dreamstop-openfp-net-web.nix index 79af5f6..dd7d2ee 100644 @@ -13,11 +13,11 @@ local: , miso }: mkDerivation { pname = "dreamstop-openfp-net-web"; - version = "0.3.1.0"; + version = "0.4.0.0"; src = config.horizon.local.source (local.self) "dreamstop-openfp-net-web"; passthru = { cabalFile = config.horizon.local.file (local.self) "dreamstop-openfp-net-web/dreamstop-openfp-net-web.cabal"; - cabalSha256 = "2c491025329347ed4cfbc467a147aaeb11934109bea9fc6c2e468a950bfd0e7f"; + cabalSha256 = "7000e551d111dbfce8a3d1014bfd45056ea0b81efc9ca584c6318a19e88885d4"; }; isLibrary = true; isExecutable = true; diff --git a/nix/site.nix b/nix/site.nix index f022f99..08cb25e 100644 @@ -231,6 +231,17 @@ local: ]; }; + # Every code on the page sits in a coloured code element: with those + # elements, scripts and styles taken out, no code from the table is left. + codesColoured = pkgs.runCommand "dreamstop.openfp.net-codes-coloured" { } '' + codes="${lib.concatStringsSep "|" (lib.concatMap (p: p.codes) (lib.attrValues codepoints.layers))}" + left=$(tr "\n" " " < ${site.package}/index.html \ + | sed -E "s#<(script|style)[^>]*>[^<]*</(script|style)>##g; s#<code>([^<]|<span[^>]*>[^<]*</span>)*</code>##g; s#<[^>]*># #g" \ + | { grep -owE "$codes" || true; } | sort -u | tr "\n" " ") + [ -z "$left" ] || { echo "codes-coloured: uncoloured codes on the page: $left" >&2; exit 1; } + touch $out + ''; + cardCopy = pkgs.runCommand "dreamstop.openfp.net-card-copy" { } '' tagline=$(tr '\n' ' ' < ${../og.svg} | grep -oE '<text id="tagline".*' | sed -E 's#</text>.*##; s#<[^>]*># #g' | tr -s ' ' | sed -E 's/^ //; s/ $//') [ "$tagline" = "a language for disambiguating text" ] || { echo "card: the card must say the tagline, not '$tagline'" >&2; exit 1; } @@ -258,6 +269,7 @@ local: checks = site.checks // { card-copy = cardCopy; + codes-coloured = codesColoured; manual-says = manualSays; }; };