Skip to content

Commit

Permalink
Add commands to generate Working Draft (#872)
Browse files Browse the repository at this point in the history
* `make WD-tar`: Generate the Working Draft tar file to submit
* `make WD-echidna`: Publish the Working Draft via Echidna
  • Loading branch information
binji authored Sep 12, 2018
1 parent 4ccad09 commit fda397a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
30 changes: 30 additions & 0 deletions document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ usage:
@echo " pdf to make standalone PDF file"
@echo " bikeshed to make a bikeshed wrapped single large HTML file"
@echo " diff to make a diff of the bikeshed HTML file with the latest TR"
@echo " WD-tar generate tar file for updating the Working Draft"
@echo " WD-echidna publish the Working Draft tar file via Echidna"
@echo " all to make all 3"
@echo " publish to make all and push to gh-pages"
@echo " help to see more options"
Expand Down Expand Up @@ -156,6 +158,34 @@ bikeshed:
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/."

.PHONY: WD-tar
WD-tar: bikeshed
@echo "Building tar file..."
tar cvf \
$(BUILDDIR)/WD.tar \
--transform='s|$(BUILDDIR)/html/bikeshed/||' \
--transform='s|index.html|Overview.html|' \
$(BUILDDIR)/html/bikeshed/index.html \
$(BUILDDIR)/html/bikeshed/pygments.css \
$(BUILDDIR)/html/bikeshed/katex/dist/katex.css \
$(BUILDDIR)/html/bikeshed/katex/dist/fonts
@echo "Built $(BUILDDIR)/WD.tar."

.PHONY: WD-echidna
WD-echidna: WD-tar
@if [ -z $(W3C_USERNAME) ] || \
[ -z $(W3C_PASSWORD) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_USERNAME, W3C_PASSWORD, and DECISION_URL environment variables"; \
exit 1; \
fi
curl 'https://labs.w3.org/echidna/api/request' \
--user '$(W3C_USERNAME):$(W3C_PASSWORD)' \
-F "tar=@$(BUILDDIR)/WD.tar" \
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
@echo
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

.PHONY: diff
diff: bikeshed
@echo "Downloading the old single-file html spec..."
Expand Down
16 changes: 16 additions & 0 deletions document/js-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ diff: all
@echo "Diffing new against old..."
perl ../util/htmldiff.pl $(BUILDDIR)/html/old.html $(BUILDDIR)/html/index.html $(BUILDDIR)/html/diff.html
@echo "Done. The diff is at $(BUILDDIR)/html/diff.html"

.PHONY: WD-tar
WD-tar:
bikeshed echidna --just-tar index.bs $(BUILDDIR)/html/index.html
mv test.tar $(BUILDDIR)/WD.tar
@echo "Built $(BUILDDIR)/WD.tar."

.PHONY: WD-echidna
WD-echidna:
@if [ -z $(W3C_USERNAME) ] || \
[ -z $(W3C_PASSWORD) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_USERNAME, W3C_PASSWORD, and DECISION_URL environment variables"; \
exit 1; \
fi
bikeshed echidna index.bs --u $(W3C_USERNAME) --p $(W3C_PASSWORD) --d $(DECISION_URL)
16 changes: 16 additions & 0 deletions document/web-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,19 @@ diff: all
@echo "Diffing new against old..."
perl ../util/htmldiff.pl $(BUILDDIR)/html/old.html $(BUILDDIR)/html/index.html $(BUILDDIR)/html/diff.html
@echo "Done. The diff is at $(BUILDDIR)/html/diff.html"

.PHONY: WD-tar
WD-tar:
bikeshed echidna --just-tar index.bs $(BUILDDIR)/html/index.html
mv test.tar $(BUILDDIR)/WD.tar
@echo "Built $(BUILDDIR)/WD.tar."

.PHONY: WD-echidna
WD-echidna:
@if [ -z $(W3C_USERNAME) ] || \
[ -z $(W3C_PASSWORD) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_USERNAME, W3C_PASSWORD, and DECISION_URL environment variables"; \
exit 1; \
fi
bikeshed echidna index.bs --u $(W3C_USERNAME) --p $(W3C_PASSWORD) --d $(DECISION_URL)

0 comments on commit fda397a

Please sign in to comment.