Skip to content

Commit

Permalink
Meta: Commit Snapshot and Review Draft support
Browse files Browse the repository at this point in the history
See whatwg/meta#92 for details. And whatwg/html-build#151 and whatwg/wattsi#70 for changes that are needed as well.
  • Loading branch information
annevk authored May 29, 2018
1 parent 3876e4b commit f9d325f
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 101 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source text eol=lf diff=html linguist-language=HTML
*.wattsi text eol=lf diff=html linguist-language=HTML

*.css text eol=lf
*.html text eol=lf
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
- secure: "qI0QEOmT3P3x9MfWwY0F43CxV8MRvuYDUtGRXIXs1Utpk/1wJv4zsebyHabuusEai9QakRo1kexwAuAcbyeiFTXKwn8DKIId2BDx14/fzmHSsyj86W1Tao5HAoD4NDQReI+c3LX5ipDtInlBXip0NgMMmQiT4+IzVkf9itAewCg="
- ENCRYPTION_LABEL="1536cf00117f"
script:
- shellcheck review-draft.sh
- cd .. &&
git clone https://github.com/whatwg/html-build.git html-build &&
bash html-build/ci-deploy/outside-container.sh
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To preview your changes locally, follow the instructions in the [html-build repo

In addition to generating the [singlepage](https://html.spec.whatwg.org/) and [multipage](https://html.spec.whatwg.org/multipage/) specifications, we also generate an [edition for developers](https://html.spec.whatwg.org/dev/). This is meant to exclude content that is of interest only to implementers. We can always use community help in properly enforcing this distinction, especially since for a long period the developer's edition was not working and so we made a lot of changes without properly considering their impact on it.

To mark an element as being omitted from the developer's edition, use a `w-nodev` attribute. Similarly, to mark something up as being omitted from the singlepage and multipage versions, use a `w-nohtml` attribute. This may require introducing container `<div>`s or `<span>`s; that's fine. Note that Web IDL blocks (`<pre class="idl">`) are automatically omitted by the build process, and so don't need `w-nodev` attributes.
To mark an element as being omitted from the developer's edition, use a `w-nodev` attribute. To only include it in the developer's edition, use a `w-dev` attribute. This may require introducing container `<div>`s or `<span>`s; that's fine. Note that Web IDL blocks (`<pre class="idl">`) are automatically omitted by the build process, and so don't need `w-nodev` attributes. (There also exist `w-nohtml`, `w-nosnap`, and `w-noreview` attributes which exclude information from the Living Standard, the Commit Snapshot, and the Review Draft respectively. Day-to-day changes will not require them.)

Another interesting feature is the `subdfn` attribute. This is useful for when something is defined inside text that is not present in the developer's edition (such as a Web IDL block). In that case, we can use the `subdfn` attribute on something which has a matching `data-x` attribute, to indicate the definition of the term for the purposes of the developer's edition.

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
default:
@echo "Please see CONTRIBUTING.md for instructions on building HTML."

review: source
@./review-draft.sh
23 changes: 23 additions & 0 deletions review-draft.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -o errexit
set -o nounset

# This is based on a script named review.sh over at
# https://github.com/whatwg/whatwg.org/tree/master/resources.whatwg.org/build
#
# Please see https://github.com/whatwg/meta/blob/master/MAINTAINERS.md for information on creating
# and announcing Review Drafts.

INPUT="source"

mkdir -p "review-drafts"
REVIEW_DRAFT="review-drafts/$(date +'%Y-%m').wattsi"

# Note that %B in date is locale-specific. Let's hope for English.
sed -e 's/^ <title w-nodev>HTML Standard<\/title>$/ <title w-nodev>HTML Standard Review Draft '"$(date +'%B %Y')"'<\/title>/' \
-e 's/^ <h2 w-nohtml w-nosnap id="living-standard" class="no-num no-toc">Review Draft &mdash; Published <span class="pubdate">\[DATE: 01 Jan 1901\]<\/span><\/h2>$/ <h2 w-nohtml w-nosnap id="living-standard" class="no-num no-toc">Review Draft \&mdash; Published '"$(date +'%d %B %Y')"'<\/h2>/' \
-e 's/<span class="pubyear">\[DATE: 1901\]<\/span>/'"$(date +'%Y')"'/' \
< "$INPUT" > "$REVIEW_DRAFT"
echo "Created Review Draft at $REVIEW_DRAFT"
echo "Please verify that only three lines changed relative to $INPUT:"
diff -up "$INPUT" "$REVIEW_DRAFT" || exit 0
Loading

0 comments on commit f9d325f

Please sign in to comment.