Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:

# CI-time smoke tests for the scripts that publish this registry: they drive the
# real release script end to end against a throwaway repo whose `gh` is a stub,
# as opposed to validate.yml, which checks the registry data itself.
# as opposed to validate.yml, which checks the registry data itself. The same
# run checks each official dictionary's word list with the app's spell-check
# engine, the one dependency package-lock.json pins.
permissions:
contents: read

Expand All @@ -19,4 +21,5 @@ jobs:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- run: npm ci --ignore-scripts
- run: node --test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 2 additions & 2 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const font = await ctx.assets.readBinary("assets/font.woff2");

## `ctx.spellcheck`

Contribute a spell-check dictionary; it appears in Settings → Editor's language picker, and `load` runs only when the user first selects the language. Registering an existing code (including the built-in `en`) replaces it; unloading the plugin removes it.
Contribute a spell-check dictionary; it appears in Settings → Editor's language picker, and `load` runs only when the user first selects the language. Registering an existing code (including `en`, which the English dictionary core plugin registers) replaces it; unloading the plugin removes it and brings back the dictionary it replaced. Since Glyph 0.28.0 the app checks with Hunspell itself, compiled to WebAssembly, so the whole affix format works, compound words included; earlier versions ignored the compound flags. The two texts together may be at most 32 million characters.

```ts
ctx.spellcheck.registerDictionary({
Expand All @@ -408,7 +408,7 @@ ctx.spellcheck.registerDictionary({
});
```

Real dictionaries are megabytes of Hunspell text; ship them as package assets and read them with `ctx.assets` (see the [recipe](recipes.md#spell-check-dictionary)) rather than embedding them in `main.js`.
Real dictionaries are megabytes of Hunspell text; ship them as package assets and read them with `ctx.assets` (see the [recipe](recipes.md#spell-check-dictionary)) rather than embedding them in `main.js`. The app takes the text as already decoded and ignores the affix file's `SET` line, and `ctx.assets.readText` decodes UTF-8, so convert an ISO-8859 dictionary to UTF-8 first (or read it with `readBinary` and decode it with its own charset).

The optional `scripts` field declares the ISO 15924 script codes the dictionary covers, e.g. `scripts: ["Arab"]`. When omitted the host infers it from `language` via CLDR likely-subtags, so `fa` already covers Arabic-script words. Words are checked only against dictionaries covering their script and skipped entirely when no enabled dictionary does, which keeps mixed-language notes clean. Casing is normalized, composite codes (`Jpan`, `Kore`, `Hans`, `Hant`) expand to their constituent scripts, and an unknown name logs a warning and contributes no coverage. Hosts that predate the field ignore it and infer instead, so declaring it is always safe.

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ pnpm typecheck && pnpm check && pnpm test
cd src-tauri && cargo clippy --all-targets -- -D warnings
```

Codecov patch coverage must stay green; run `pnpm test:coverage` before pushing. This repo runs `validate.yml` on every PR: schema validation, sorted unique ids, https URLs, and a catalog entry for every published id.
Codecov patch coverage must stay green; run `pnpm test:coverage` before pushing. This repo runs `validate.yml` on every PR: schema validation, sorted unique ids, https URLs, and a catalog entry for every published id. It also runs `smoke.yml` (`npm ci --ignore-scripts && node --test` locally): the release scripts end to end, and each official dictionary's word list checked with the app's spell-check engine.
4 changes: 2 additions & 2 deletions docs/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ glyph-md/plugins (plugins/<id>/) ────────┘

## Core and community plugins

Glyph ships some of its own features as **core plugins**: bundled in the app, listed under **Settings, Plugins, Core plugins**, and switched on or off there. A disabled core plugin never loads its code. Core plugins register only through the same public plugin API documented here, so every capability they use is available to community plugins too; when one needs something the API lacks, the API grows first. D2 diagrams, Mermaid diagrams, math (KaTeX), the tags pane, backlinks, daily notes, and the Sepia, Solarized, and High contrast theme presets are core plugins today. The presets appear in the **Settings > Appearance** color scheme picker, and community plugins add more schemes there through `ctx.ui.addColorScheme`.
Glyph ships some of its own features as **core plugins**: bundled in the app, listed under **Settings, Plugins, Core plugins**, and switched on or off there. A disabled core plugin never loads its code. Core plugins register only through the same public plugin API documented here, so every capability they use is available to community plugins too; when one needs something the API lacks, the API grows first. D2 diagrams, Mermaid diagrams, math (KaTeX), the tags pane, backlinks, daily notes, the Sepia, Solarized, and High contrast theme presets, and the US English spell-check dictionary are core plugins today. The presets appear in the **Settings > Appearance** color scheme picker, and community plugins add more schemes there through `ctx.ui.addColorScheme`.

The dividing line: a feature is core when it is first-party, works offline, and is useful to most users. It belongs in this marketplace as a community plugin when it is a per-user variant (a spell-check language, a website theme) or depends on a third-party network service. Core plugin ids use the `glyph.core.` prefix, which the app refuses for installed plugins.
The dividing line: a feature is core when it is first-party, works offline, and is useful to most users. It belongs in this marketplace as a community plugin when it is a per-user variant (a spell-check language, a website theme) or depends on a third-party network service. English is the one dictionary in the app: it shipped built in before dictionaries were plugins, so as a core plugin it adds nothing to the download, while every other language stays here. Core plugin ids use the `glyph.core.` prefix, which the app refuses for installed plugins.

## Version flow

Expand Down
12 changes: 12 additions & 0 deletions docs/plugin-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ Present a document as slides, or export it as a reveal.js deck. Horizontal rules

## Language

### [German Dictionary](https://github.com/glyph-md/plugins/tree/main/plugins/com.glyph.dictionary-de)

`com.glyph.dictionary-de` v1.0.0 · official · sandboxed · no permissions

German (Germany) spell-check dictionary, based on igerman98.

### [Spanish Dictionary](https://github.com/glyph-md/plugins/tree/main/plugins/com.glyph.dictionary-es)

`com.glyph.dictionary-es` v1.0.0 · official · sandboxed · no permissions

Spanish spell-check dictionary, based on RLA-ES.

### [Persian Dictionary](https://github.com/glyph-md/plugins/tree/main/plugins/com.glyph.dictionary-fa)

`com.glyph.dictionary-fa` v1.0.0 · official · sandboxed · no permissions
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default {

## Spell-check dictionary

Add a language to Settings → Editor → Spell Check. Ship the Hunspell files as package assets and read them through `ctx.assets`; `load` is lazy, so nothing is read until the user picks the language. No permissions needed: bundled assets are the plugin's own content.
Add a language to Settings → Editor → Spell Check. Ship the Hunspell files as package assets and read them through `ctx.assets`; `load` is lazy, so nothing is read until the user picks the language. No permissions needed: bundled assets are the plugin's own content. List the dictionary's license in `files` too, so it ships in the package with the data. A dictionary that builds words from compound flags (German, Dutch, the Nordic languages) declares `"apiVersion": "0.28.0"`: older apps ignore those flags and would underline every compound.

```json
{
Expand All @@ -207,7 +207,7 @@ Add a language to Settings → Editor → Spell Check. Ship the Hunspell files a
"version": "1.0.0",
"apiVersion": "0.16.0",
"main": "main.js",
"files": ["main.js", "assets/fa.aff", "assets/fa.dic"],
"files": ["main.js", "assets/fa.aff", "assets/fa.dic", "LICENSE"],
"permissions": []
}
```
Expand Down
34 changes: 34 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
{
"$schema": "https://raw.githubusercontent.com/glyph-md/plugins/main/index.schema.json",
"plugins": [
{
"id": "com.glyph.dictionary-de",
"name": "German Dictionary",
"description": "German (Germany) spell-check dictionary, based on igerman98.",
"version": "1.0.0",
"apiVersion": "0.28.0",
"category": "language",
"keywords": [
"spellcheck",
"dictionary",
"german",
"deutsch"
],
"official": true,
"packageUrl": "https://github.com/glyph-md/plugins/releases/download/com.glyph.dictionary-de-v1.0.0/com.glyph.dictionary-de.zip",
"sha256": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"id": "com.glyph.dictionary-es",
"name": "Spanish Dictionary",
"description": "Spanish spell-check dictionary, based on RLA-ES.",
"version": "1.0.0",
"apiVersion": "0.16.0",
"category": "language",
"keywords": [
"spellcheck",
"dictionary",
"spanish",
"español"
],
"official": true,
"packageUrl": "https://github.com/glyph-md/plugins/releases/download/com.glyph.dictionary-es-v1.0.0/com.glyph.dictionary-es.zip",
"sha256": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"id": "com.glyph.dictionary-fa",
"name": "Persian Dictionary",
Expand Down
34 changes: 34 additions & 0 deletions index/language.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"plugins": [
{
"id": "com.glyph.dictionary-de",
"name": "German Dictionary",
"description": "German (Germany) spell-check dictionary, based on igerman98.",
"version": "1.0.0",
"apiVersion": "0.28.0",
"category": "language",
"keywords": [
"spellcheck",
"dictionary",
"german",
"deutsch"
],
"official": true,
"packageUrl": "https://github.com/glyph-md/plugins/releases/download/com.glyph.dictionary-de-v1.0.0/com.glyph.dictionary-de.zip",
"sha256": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"id": "com.glyph.dictionary-es",
"name": "Spanish Dictionary",
"description": "Spanish spell-check dictionary, based on RLA-ES.",
"version": "1.0.0",
"apiVersion": "0.16.0",
"category": "language",
"keywords": [
"spellcheck",
"dictionary",
"spanish",
"español"
],
"official": true,
"packageUrl": "https://github.com/glyph-md/plugins/releases/download/com.glyph.dictionary-es-v1.0.0/com.glyph.dictionary-es.zip",
"sha256": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"id": "com.glyph.dictionary-fa",
"name": "Persian Dictionary",
Expand Down
2 changes: 1 addition & 1 deletion index/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"exporters": 1,
"tools": 1,
"integrations": 0,
"language": 1,
"language": 3,
"ai": 0
}
}
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "glyph-plugins-registry",
"private": true,
"description": "Test-only dependencies for the registry's own scripts; nothing here ships in a plugin.",
"devDependencies": {
"hunspell-wasm": "0.3.0"
}
}
Loading