Skip to content

Commit

Permalink
[Framework] Add more flexible table definition mechanism
Browse files Browse the repository at this point in the history
This update gets rid of the HTML table templates that did not serve any useful
purpose, since the logic that goes with a table needs to be implemented in
the code one way or the other. Said differently, the code needs to know the
structure of the tables it is to generate, so hiding that structure in an HMTL
template is useless and error-prone.

The table column headers now need to appear in translation files in a `columns`
property (see `translations.json` for reference).

The types of tables and the columns to display for each of them can now be
customized on a roadmap per roadmap basis, in the `toc.json` file, in a
`tables` property that lists the columns to use per type of table. This
mechanism can be used to override the default tables or to create new types
of tables.

For instance, to add the "group" column to the columns generated in
"well-deployed" sections, one can simply add the following to the `toc.json`
file:

```json
{
  "tables": {
    "well-deployed": ["feature", "spec", "group", "maturity", "impl"]
  }
}
```

I created a new "versions" type of column, which should eventually become what
@r12a needs in w3c#90 (not quite the case now because the framework does not
yet know how to gather the Editor's Draft and the GitHub repo of a spec)
  • Loading branch information
tidoust committed Oct 29, 2017
1 parent d60858b commit 38068c9
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 200 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ The `js/translations.xx.json` file, where `xx` is the BCP47 language code, needs
"not-covered": "",
"discontinued": ""
},
"columns": {
"feature": "",
"spec": "",
"group": "",
"maturity": "",
"impl": "",
"implintents": "",
"versions": ""
},
"implstatus": {
"shipped": "",
"experimental": "",
Expand All @@ -221,7 +230,7 @@ The `js/translations.xx.json` file, where `xx` is the BCP47 language code, needs
}
```

The translations of section titles (`sections`), implementation status (`implstatus`) and labels (`labels`) are required. Translations of group names, specification titles and feature names are optional, although recommended. The framework will default to English when a translation is missing.
The translations of section titles (`sections`), table columns headers (`columns`), implementation status (`implstatus`) and labels (`labels`) are required. Translations of group names, specification titles and feature names are optional, although recommended. The framework will default to English when a translation is missing.

Note the framework will also write the English version of specification titles and of group names next to their translations in the generated tables, because the English version is often used when referring to specs and groups in Web pages, regardless of the language of the page.

Expand Down
Loading

0 comments on commit 38068c9

Please sign in to comment.