|
| 1 | +# How to Edit the Draft for Publication |
| 2 | + |
| 3 | +In each sub directory, you can find the relevant files for the publication process. |
| 4 | +In general, you should always consult the W3C Guide page at <https://www.w3.org/Guide>. |
| 5 | + |
| 6 | +## Checklist |
| 7 | + |
| 8 | +* Make sure that you update the recent specification changes |
| 9 | + |
| 10 | +## Files |
| 11 | + |
| 12 | +* Overview.html - static HTML for publication |
| 13 | +* diff.html - diff between the previous published version and Overview.html |
| 14 | +* index.html - same as the index.html at <https://w3c.github.io/wot-scripting-api/> ([or at the root of the repository](../index.html)), except for changing the respec option from ED to the version you are aiming at such as CR, WD, etc. |
| 15 | +* static.html - static HTML generated by ReSpec from the index.html above |
| 16 | + |
| 17 | +## How to Generate Each File |
| 18 | + |
| 19 | +Overview.html is generated as follows: |
| 20 | + |
| 21 | +1. Copy index.html from [the root of the repository](../index.html). |
| 22 | +2. Change `specStatus` to `"NOTE"` from `"ED"` (or `"REC"`, `"PR"`, etc.). |
| 23 | +3. Generate static.html by ReSpec from <https://w3c.github.io/wot-scripting-api/> (click "ReSpec" top right and choose "Export" then export as "HTML"). Make sure that you disable browser extensions or open in private window. |
| 24 | +4. Output Overview.html as a result of [HTML Tidy](https://www.html-tidy.org/). Use the following command (`tidy -ashtml -i static.html > Overview.html`). The `-ashtml` option is needed until [this issue](https://github.com/htacg/tidy-html5/issues/660) is resolved at HTML Tidy. |
| 25 | +5. Fix duplicate IDs (see [fix-id.pl](fix-id.pl)) caused by ReSpec not supporting conformance classes |
| 26 | + * `cp Overview.html backup.html; ./fix-id.pl backup.html > Overview.html` |
| 27 | + |
| 28 | +## How to Add your Edits based on the Pubrules Errors and Warnings |
| 29 | + |
| 30 | +After checking Overview.html using the [Pubrules checker](https://www.w3.org/pubrules/), we have to edit index.html and then |
| 31 | +regenerate the static HTML based on the procedure above to make it easier to generate a Pull Request to update the original |
| 32 | +at <https://w3c.github.io/wot-scripting-api/> later. |
| 33 | + |
| 34 | +1. Edit index.html, |
| 35 | +2. Generate static.html by ReSpec from the index.html (click "ReSpec" top right and choose "Export" then export as "HTML", |
| 36 | +3. copy static.html to Overview.html and tidy it up, |
| 37 | +4. If there are any remaining errors/warnings with the Pubrules checker results, repeat the edit by going back to #1. |
| 38 | +5. Generate diff.html via <http://services.w3.org/htmldiff> |
| 39 | + |
| 40 | +Note: You cannot use a tool like <https://htmlpreview.github.io> since they do not have static html as a resource that the pubrule |
| 41 | +checkers can use. |
| 42 | + |
| 43 | +## Manual Link Corrections |
| 44 | + |
| 45 | +Some redirects come from [specref](https://www.specref.org/) not being up to date. In those cases, you need to manually update the final Overview.html. |
0 commit comments