Skip to content

Commit 119d1a9

Browse files
committed
Quickly hack up the conversion in JS
1 parent 99077f5 commit 119d1a9

File tree

8 files changed

+807
-18
lines changed

8 files changed

+807
-18
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ html/
44
output/
55
mdn/.id-list
66
mdn/developer.mozilla.org/
7+
node_modules/
78
highlighter/
89

910

build.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ function processCommandLineArgs {
183183
;;
184184
-b|--bikeshed)
185185
USE_BIKESHED=true
186+
SINGLE_PAGE_ONLY=true
186187
;;
187188
-d|--docker)
188189
USE_DOCKER=true
@@ -672,9 +673,14 @@ function processSource {
672673
fi
673674

674675
if [[ $USE_BIKESHED == "true" ]]; then
675-
echo "BIKESHED!!!"
676-
bikeshed spec --byos "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/bikeshed-output" --md-Text-Macro="SHA $HTML_SHA"
677-
exit 0
676+
clearDir "$HTML_TEMP/bikeshed-output"
677+
678+
# TODO: port to html-build Rust code
679+
node wattsi2bikeshed.js "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/source-whatwg-complete.bs"
680+
681+
local bikeshed_args=( --force )
682+
$DO_UPDATE || bikeshed_args+=( --no-update )
683+
bikeshed "${bikeshed_args[@]}" spec "$HTML_TEMP/source-whatwg-complete.bs" "$HTML_TEMP/bikeshed-output/index.html" --md-Text-Macro="SHA $HTML_SHA" --md-Text-Macro="COMMIT-SHA $HTML_SHA"
678684
else
679685
runWattsi "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/wattsi-output"
680686
if [[ $WATTSI_RESULT == "0" ]]; then
@@ -704,7 +710,11 @@ function processSource {
704710

705711
if [[ $build_type == "default" ]]; then
706712
# Singlepage HTML
707-
mv "$HTML_TEMP/wattsi-output/index-html" "$HTML_OUTPUT/index.html"
713+
if [[ $USE_BIKESHED == "true" ]]; then
714+
mv "$HTML_TEMP/bikeshed-output/index.html" "$HTML_OUTPUT/index.html"
715+
else
716+
mv "$HTML_TEMP/wattsi-output/index-html" "$HTML_OUTPUT/index.html"
717+
fi
708718

709719
if [[ $SINGLE_PAGE_ONLY == "false" ]]; then
710720
# Singlepage Commit Snapshot
@@ -720,7 +730,9 @@ function processSource {
720730
fi
721731

722732
cp -p entities/out/entities.json "$HTML_OUTPUT"
723-
cp -p "$HTML_TEMP/wattsi-output/xrefs.json" "$HTML_OUTPUT"
733+
if [[ $USE_BIKESHED == "false" ]]; then
734+
cp -p "$HTML_TEMP/wattsi-output/xrefs.json" "$HTML_OUTPUT"
735+
fi
724736

725737
clearDir "$HTML_TEMP"
726738

0 commit comments

Comments
 (0)