From ea97d61a5c6987cbff14112792e93738afbc43e2 Mon Sep 17 00:00:00 2001 From: Keyman Build Server Date: Tue, 27 Oct 2026 13:29:07 -0500 Subject: [PATCH] auto: Keyman for web help deployment --- .../engine/web/20.0/guide/adding-keyboards.md | 87 ++++++++++++------- .../web/20.0/reference/core/addKeyboards.md | 9 +- .../reference/core/addKeyboardsForLanguage.md | 4 +- 3 files changed, 66 insertions(+), 34 deletions(-) diff --git a/developer/engine/web/20.0/guide/adding-keyboards.md b/developer/engine/web/20.0/guide/adding-keyboards.md index f294bee24..0787f340f 100644 --- a/developer/engine/web/20.0/guide/adding-keyboards.md +++ b/developer/engine/web/20.0/guide/adding-keyboards.md @@ -4,57 +4,82 @@ title: Adding Keyboards There are multiple ways to add and install keyboards into your KeymanWeb installation. -## Directly linking a local copy +## Requesting from the Keyman cloud (CDN) -The most efficient way to utilize a keyboard is to obtain a local copy of it and place this copy in a static location on your website. Once this is done, it can be directly linked into KeymanWeb as follows. +The easiest way to utilize a keyboard is to request it from the Keyman cloud. -```js -await keyman.addKeyboards({ - id:'us', // The keyboard's unique identification code. - name:'English', // The keyboard's user-readable name. - language:{ - id:'en', // A BCP 47 code uniquely identifying the language. - name:'English (US)' // The language's name. - }, - filename:'./us-1.0.js' // A valid path to the compiled *.js file representing the keyboard. -}); -``` +### Requested from the CDN by keyboard name -Custom fonts may also be utilized via the `language.font` property. For example: +To obtain a specific keyboard by name or by keyboard name and language code as a pair, see the +following: -```js -font:{ - family:'LaoWeb', - source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot'] -} +```typescript +await keyman.addKeyboards('khmer_angkor','sil_euro_latin@sv','sil_euro_latin@no') ``` -## Requested from the CDN by language name +This will install three keyboards - the Khmer Angkor one for Khmer and two copies +of the EuroLatin keyboard - one for Swedish and one for Norwegian. + +### Requested from the CDN by language name -To obtain the default Keyman keyboard for a given language, call the following function. +To obtain the default Keyman keyboard for a given language, call the following function: -```js +```typescript await keyman.addKeyboardsForLanguage('Dzongkha'); ``` -This example would find the default keyboard for the Dzongkha language. This method will fail if the name doesn't perfectly match any language found in the CDN's repository. +This example would find the default keyboard for the Dzongkha language. This method will fail if +the name doesn't perfectly match any language found in the CDN's repository. Alternatively, languages may be looked up via their BCP 47 language code as follows: -```js -await keyman.addKeyboards('@he'); +```typescript +await keyman.addKeyboards('@he') ``` -The `@` prefix indicates the use of the BCP 47 language code, which in this case corresponds with Hebrew. +The `@` prefix indicates the use of the BCP 47 language code, which in this case corresponds with +Hebrew. -## Requested from the CDN by keyboard name + -```js -await keyman.addKeyboards('french', 'sil_euro_latin@sv', 'sil_euro_latin@no'); +## Directly linking a local copy + +The most efficient way to utilize a keyboard is to obtain a local copy of it and place this copy +in a static location on your website. Once this is done, it can be directly linked into KeymanWeb +as follows: + +```typescript +await keyman.addKeyboards({ + id: 'us', // The keyboard's unique identification code. + name: 'English', // The keyboard's user-readable name. + languages: { + id: 'en', // A BCP 47 code uniquely identifying the language. + name: 'English (US)' // The language's name. + }, + filename: './us.js' // A valid path to the compiled *.js file representing the keyboard. +}); ``` -This will install three keyboards - one for French (named, quite simply, "French") and two copies of the EuroLatin keyboard - one for Swedish and one for Norwegian. +Custom fonts may also be utilized via the `languages.font` property. For example: + +```typescript +languages: { + id: 'lo', + name: 'Lao', + font: { + family: 'LaoWeb', + source: ['../font/saysettha_web.ttf','../font/saysettha_web.woff'] + } +} +``` [Previous: What is a Keyboard?](what-is-a-keyboard) | [Next: Additional Examples](examples/) diff --git a/developer/engine/web/20.0/reference/core/addKeyboards.md b/developer/engine/web/20.0/reference/core/addKeyboards.md index e5f48680a..a048e7a0f 100644 --- a/developer/engine/web/20.0/reference/core/addKeyboards.md +++ b/developer/engine/web/20.0/reference/core/addKeyboards.md @@ -4,7 +4,7 @@ title: addKeyboards function ## Summary -Adds keyboards to KeymanWeb. +Adds keyboards to KeymanWeb. Note that this is an asynchronous operation. ## Syntax @@ -53,6 +53,11 @@ The string format is one of the following: The keyboard catalogue is online at [https://keyman.com/developer/keymanweb/keyboards](https://keyman.com/developer/keymanweb/keyboards). + + ### Using an `object` When keyboard spec is an object, then more parameters can be specified, @@ -182,4 +187,4 @@ The `spec.languages.font` object contains the following members: ### Not passing any parameter -Not passing any parameter will obtain all Keyman keyboards from the CDN. \ No newline at end of file +Not passing any parameter will obtain all Keyman keyboards from the CDN. diff --git a/developer/engine/web/20.0/reference/core/addKeyboardsForLanguage.md b/developer/engine/web/20.0/reference/core/addKeyboardsForLanguage.md index e3a1e553c..6812ea3ae 100644 --- a/developer/engine/web/20.0/reference/core/addKeyboardsForLanguage.md +++ b/developer/engine/web/20.0/reference/core/addKeyboardsForLanguage.md @@ -4,7 +4,8 @@ title: addKeyboardsForLanguage function ## Summary -Add default or all keyboards for a given language to KeymanWeb. +Add default or all keyboards for a given language to KeymanWeb. Note that this is an asynchronous +operation. ## Syntax @@ -30,6 +31,7 @@ The promise is an array containing the following: * successfully registered keyboard objects which define some or all of these [properties](../keyboard_properties) +* [ErrorStub](../keyboard_registration_errors) objects for keyboards that failed to register ## Description