document more commands; long description hook

This commit is contained in:
Jörg Breitbart
2019-08-19 22:54:55 +02:00
parent 66709e6f22
commit 8b2d85c823
2 changed files with 236 additions and 20 deletions
+97 -7
View File
@@ -89,65 +89,150 @@ To denote the sequences the lists use the same abbreviations as xterm does:
| Mnemonic | Name | Sequence | Short Description | Status |
| -------- | ---- | -------- | ----------------- | ------ |
{{#C0}}
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/C0}}
{{#C0.hasLongDescriptions}}
{{#C0}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/C0}}
{{/C0.hasLongDescriptions}}
{{/C0.length}}
{{#C1.length}}
### C1
| Mnemonic | Name | Sequence | Short Description | Status |
| -------- | ---- | -------- | ----------------- | ------ |
{{#C1}}
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/C1}}
{{#C1.hasLongDescriptions}}
{{#C1}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/C1}}
{{/C1.hasLongDescriptions}}
{{/C1.length}}
{{#CSI.length}}
### CSI
| Mnemonic | Name | Sequence | Short Description | Status |
| -------- | ---- | -------- | ----------------- | ------ |
{{#CSI}}
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/CSI}}
{{#CSI.hasLongDescriptions}}
{{#CSI}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/CSI}}
{{/CSI.hasLongDescriptions}}
{{/CSI.length}}
{{#DCS.length}}
### DCS
| Mnemonic | Name | Sequence | Short Description | Status |
| -------- | ---- | -------- | ----------------- | ------ |
{{#DCS}}
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/DCS}}
{{#DCS.hasLongDescriptions}}
{{#DCS}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/DCS}}
{{/DCS.hasLongDescriptions}}
{{/DCS.length}}
{{#ESC.length}}
### ESC
| Mnemonic | Name | Sequence | Short Description | Status |
| -------- | ---- | -------- | ----------------- | ------ |
{{#ESC}}
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | {{name}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/ESC}}
{{#ESC.hasLongDescriptions}}
{{#ESC}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/ESC}}
{{/ESC.hasLongDescriptions}}
{{/ESC.length}}
{{#OSC.length}}
### OSC
| Identifier | Sequence | Short Description | Status |
| ---------- | -------- | ----------------- | ------ |
{{#OSC}}
| {{mnemonic}} | \`{{sequence}}\` | {{shortDescription}} | {{status}} |
| {{mnemonic}} | \`{{sequence}}\` | {{{shortDescription}}} {{#longDescription.length}}_[more](#{{longTarget}})_{{/longDescription.length}} | {{status}} |
{{/OSC}}
{{#OSC.hasLongDescriptions}}
{{#OSC}}
{{#longDescription.length}}
#### {{name}}
{{#longDescription}}
{{{.}}}
{{/longDescription}}
{{/longDescription.length}}
{{/OSC}}
{{/OSC.hasLongDescriptions}}
{{/OSC.length}}
### TODO
- specific notes on several commands (long description)
- improve table sorting:
- sort C0/C1 in byte order
- sort OSC in numerical order
- sort CSI/ESC/DCS in final byte order
- references
`
function createAnchorSlug(s) {
return s.toLowerCase().split(' ').join('-');
}
function parseMultiLine(filename, s) {
if (!~s.indexOf('@vt:')) {
return;
@@ -170,6 +255,7 @@ function parseMultiLine(filename, s) {
}
if (feature) {
feature.longDescription = longDescription;
feature.longTarget = createAnchorSlug(feature.name);
return feature;
}
}
@@ -189,6 +275,7 @@ function parseSingleLine(filename, s) {
sequence: match[5],
shortDescription: match[6],
longDescription: [],
longTarget: '',
source: filename
};
}
@@ -201,6 +288,9 @@ function postProcessData(features) {
featureTable[feature.type] = [];
}
featureTable[feature.type].push(feature);
if (feature.longDescription) {
featureTable[feature.type].hasLongDescriptions = true;
}
}
for (const entry in featureTable) {
featureTable[entry].sort((a, b) => a.sequence.slice(-1) > b.sequence.slice(-1));