Skip to content

Commit 4d9d6e7

Browse files
Merge pull request #2378 from keymanapp/auto/A19S18-merge-master-into-staging
auto: A19S18 merge master into staging
2 parents a39510e + c68729f commit 4d9d6e7

File tree

168 files changed

+11762
-515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+11762
-515
lines changed

_includes/includes/index-content.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,50 @@
11
<?php
22

3+
/**
4+
* Sort the list of file titles according to the predefined order in
5+
* __index.txt. If a filename in __index.txt is prefixed with a hyphen (-), then
6+
* exclude it from the list. If a filename is missing from __index.txt, it will
7+
* be appended to the bottom of the list.
8+
*/
9+
function get_file_titles_by_index($base, $unsorted_items) {
10+
$order = str_replace("\r\n", "\n", @file_get_contents($base.'__index.txt'));
11+
$order = explode("\n", $order);
12+
foreach($order as $item) {
13+
if(substr($item, 0, 1) == '-') {
14+
// remove the item from the list
15+
$item = substr($item, 1);
16+
if(array_key_exists($item, $unsorted_items)) {
17+
$unsorted_items[$item] = '';
18+
}
19+
}
20+
else if(array_key_exists($item, $unsorted_items)) {
21+
$items[$item] = $unsorted_items[$item];
22+
$unsorted_items[$item] = '';
23+
}
24+
}
25+
26+
asort($unsorted_items, SORT_FLAG_CASE|SORT_STRING);
27+
foreach($unsorted_items as $item => $title) {
28+
if($title != '') {
29+
$items[$item] = $title;
30+
}
31+
}
32+
return $items;
33+
}
34+
335
function get_file_titles($base) {
36+
$hasIndex = false;
437
$files = glob($base.'*');
538
$items = array(); $dirs = array();
639
foreach($files as $file) {
740
$basefile = basename($file);
841
if($basefile == '.' || $basefile == '..') {
942
continue;
1043
}
44+
if($basefile == '__index.txt') {
45+
$hasIndex = true;
46+
continue;
47+
}
1148
if($basefile == '_nav.php' || $basefile == 'index.php' || $basefile == 'index.md') {
1249
continue;
1350
}
@@ -37,6 +74,10 @@ function get_file_titles($base) {
3774
}
3875
}
3976

77+
if($hasIndex) {
78+
return get_file_titles_by_index($base, $items + $dirs);
79+
}
80+
4081
asort($items, SORT_FLAG_CASE|SORT_STRING);
4182
asort($dirs, SORT_FLAG_CASE|SORT_STRING);
4283

developer/19.0/guides/develop/tutorial/step-1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ accent, and one for the vowel.
6262
| `Â, â, ...` | caret (<kbd>^</kbd>), then the vowel key. |
6363
| `Ä, ä, ...` | double-quote (<kbd>"</kbd>), then the vowel key. |
6464
| `Ç, ç` | quote (<kbd>'</kbd>), then lower- or uppercase C. |
65-
| `«, »` | two less-than (<kbd>&lt;&lt;</kbd>) or greater-than (<kbd>&gt;&gt;</kbd>) symbols. |
65+
| `«, »` | two less-than (<kbd>&lt;</kbd><kbd>&lt;</kbd>) or greater-than (<kbd>&gt;</kbd><kbd>&gt;</kbd>) symbols. |
6666

6767
Now that we have decided which character to use and how the user can
6868
enter them, we can start to write the keyboard.
6969

7070
- [Continue with Step 2: Writing the Header](step-2)
71-
- [Back to the Introduction](index)
71+
- [Back to the Introduction](index)

developer/19.0/reference/api/index.md

Lines changed: 97 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,101 @@
66

77
## Packages
88

9-
| Package | Description |
10-
| --- | --- |
11-
| [@keymanapp/kmc-analyze](./kmc-analyze.md) | kmc-analyze - keyboard analysis classes, including tools for <code>&amp;displayMap</code>. |
12-
| [@keymanapp/kmc-copy](./kmc-copy.md) | |
13-
| [@keymanapp/kmc-generate](./kmc-generate.md) | |
14-
| [@keymanapp/kmc-keyboard-info](./kmc-keyboard-info.md) | |
15-
| [@keymanapp/kmc-kmn](./kmc-kmn.md) | kmc-kmn - Keyman keyboard compiler |
16-
| [@keymanapp/kmc-ldml](./kmc-ldml.md) | |
17-
| [@keymanapp/kmc-model](./kmc-model.md) | |
18-
| [@keymanapp/kmc-model-info](./kmc-model-info.md) | |
19-
| [@keymanapp/kmc-package](./kmc-package.md) | |
9+
<table><thead><tr><th>
10+
11+
Package
12+
13+
14+
</th><th>
15+
16+
Description
17+
18+
19+
</th></tr></thead>
20+
<tbody><tr><td>
21+
22+
[@keymanapp/kmc-analyze](./kmc-analyze.md)
23+
24+
25+
</td><td>
26+
27+
kmc-analyze - keyboard analysis classes, including tools for `&displayMap`<!-- -->.
28+
29+
30+
</td></tr>
31+
<tr><td>
32+
33+
[@keymanapp/kmc-copy](./kmc-copy.md)
34+
35+
36+
</td><td>
37+
38+
39+
</td></tr>
40+
<tr><td>
41+
42+
[@keymanapp/kmc-generate](./kmc-generate.md)
43+
44+
45+
</td><td>
46+
47+
48+
</td></tr>
49+
<tr><td>
50+
51+
[@keymanapp/kmc-keyboard-info](./kmc-keyboard-info.md)
52+
53+
54+
</td><td>
55+
56+
57+
</td></tr>
58+
<tr><td>
59+
60+
[@keymanapp/kmc-kmn](./kmc-kmn.md)
61+
62+
63+
</td><td>
64+
65+
kmc-kmn - Keyman keyboard compiler
66+
67+
68+
</td></tr>
69+
<tr><td>
70+
71+
[@keymanapp/kmc-ldml](./kmc-ldml.md)
72+
73+
74+
</td><td>
75+
76+
77+
</td></tr>
78+
<tr><td>
79+
80+
[@keymanapp/kmc-model](./kmc-model.md)
81+
82+
83+
</td><td>
84+
85+
86+
</td></tr>
87+
<tr><td>
88+
89+
[@keymanapp/kmc-model-info](./kmc-model-info.md)
90+
91+
92+
</td><td>
93+
94+
95+
</td></tr>
96+
<tr><td>
97+
98+
[@keymanapp/kmc-package](./kmc-package.md)
99+
100+
101+
</td><td>
102+
103+
104+
</td></tr>
105+
</tbody></table>
20106

developer/19.0/reference/api/kmc-analyze.analyzeoskcharacteruse._constructor_.md

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,51 @@ constructor(callbacks: CompilerCallbacks, options?: AnalyzeOskCharacterUseOption
1414

1515
## Parameters
1616

17-
| Parameter | Type | Description |
18-
| --- | --- | --- |
19-
| callbacks | CompilerCallbacks | |
20-
| options | [AnalyzeOskCharacterUseOptions](./kmc-analyze.analyzeoskcharacteruseoptions.md) | _(Optional)_ |
17+
<table><thead><tr><th>
18+
19+
Parameter
20+
21+
22+
</th><th>
23+
24+
Type
25+
26+
27+
</th><th>
28+
29+
Description
30+
31+
32+
</th></tr></thead>
33+
<tbody><tr><td>
34+
35+
callbacks
36+
37+
38+
</td><td>
39+
40+
CompilerCallbacks
41+
42+
43+
</td><td>
44+
45+
46+
</td></tr>
47+
<tr><td>
48+
49+
options
50+
51+
52+
</td><td>
53+
54+
[AnalyzeOskCharacterUseOptions](./kmc-analyze.analyzeoskcharacteruseoptions.md)
55+
56+
57+
</td><td>
58+
59+
_(Optional)_
60+
61+
62+
</td></tr>
63+
</tbody></table>
2164

developer/19.0/reference/api/kmc-analyze.analyzeoskcharacteruse.analyze.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,39 @@ analyze(file: string): Promise<boolean>;
1616

1717
## Parameters
1818

19-
| Parameter | Type | Description |
20-
| --- | --- | --- |
21-
| file | string | relative or absolute path to a Keyman source file |
19+
<table><thead><tr><th>
20+
21+
Parameter
22+
23+
24+
</th><th>
25+
26+
Type
27+
28+
29+
</th><th>
30+
31+
Description
32+
33+
34+
</th></tr></thead>
35+
<tbody><tr><td>
36+
37+
file
38+
39+
40+
</td><td>
41+
42+
string
43+
44+
45+
</td><td>
46+
47+
relative or absolute path to a Keyman source file
48+
49+
50+
</td></tr>
51+
</tbody></table>
2252

2353
**Returns:**
2454

developer/19.0/reference/api/kmc-analyze.analyzeoskcharacteruse.getstrings.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,39 @@ getStrings(format?: '.txt' | '.md' | '.json'): string[];
2222

2323
## Parameters
2424

25-
| Parameter | Type | Description |
26-
| --- | --- | --- |
27-
| format | '.txt' \| '.md' \| '.json' | _(Optional)_ file format to return - can be '.txt', '.md', or '.json' |
25+
<table><thead><tr><th>
26+
27+
Parameter
28+
29+
30+
</th><th>
31+
32+
Type
33+
34+
35+
</th><th>
36+
37+
Description
38+
39+
40+
</th></tr></thead>
41+
<tbody><tr><td>
42+
43+
format
44+
45+
46+
</td><td>
47+
48+
'.txt' \| '.md' \| '.json'
49+
50+
51+
</td><td>
52+
53+
_(Optional)_ file format to return - can be '.txt', '.md', or '.json'
54+
55+
56+
</td></tr>
57+
</tbody></table>
2858

2959
**Returns:**
3060

0 commit comments

Comments
 (0)