Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
99077f5
Add experimental support to build using Bikeshed
foolip Feb 8, 2025
119d1a9
Quickly hack up the conversion in JS
foolip Mar 4, 2025
a2b84bc
Work towards working <dfn>s and their use
foolip Mar 7, 2025
b03fbd6
Improve cross-linking further (still broken)
foolip Mar 10, 2025
c49c398
Unwrap <pre><code> to just <pre>
foolip Mar 10, 2025
9660bdc
Move <a> simplification to a final pass
foolip Mar 12, 2025
2e7888d
Preserve Wattsi IDs
foolip Mar 12, 2025
78a15b2
Don't use data-x to populate lt, just remove them
foolip Mar 13, 2025
19fc283
Remove "new" from the linking text of constructors
foolip Mar 13, 2025
b140019
Rewrite data-lt to lt
foolip Mar 13, 2025
017385d
Handle data-lt in more places
foolip Mar 13, 2025
0e8e03e
Handle <i data-x> links
foolip Mar 13, 2025
03bfae7
Make Bikeshed find the right <dfn> more often
foolip Mar 14, 2025
330630b
Use noexport="" to silence some Bikeshed warnings
foolip Mar 14, 2025
94ade7e
Use data-x attribute as local-lt to make more links work
foolip Mar 14, 2025
004e014
Fix up document.write/writeln cases
foolip Mar 17, 2025
15d1327
Handle <dfn data-x=""> better
foolip Mar 17, 2025
b4254fc
Lowercase linking texts to detect more clashes
foolip Mar 18, 2025
2dafc45
Use local-lt="xxx-...." to ensure links
foolip Mar 19, 2025
d60175e
Remove getTopicAndSource()
foolip Mar 19, 2025
a266ce4
Update permalink
foolip Mar 19, 2025
5ed37ae
Revert Rust changes (unused)
foolip Sep 4, 2025
cb9f529
Merge remote-tracking branch 'origin/main' into bikeshed-experiment
foolip Sep 4, 2025
233c63a
Strip all markup inside code blocks
foolip Sep 10, 2025
1f6b200
Handle w-nodev and similar attributes
foolip Sep 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ html/
output/
mdn/.id-list
mdn/developer.mozilla.org/
node_modules/
highlighter/


Expand Down
72 changes: 48 additions & 24 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ declare -r WATTSI_LATEST=140
# Shared state variables throughout this script
LOCAL_WATTSI=true
WATTSI_RESULT=0
USE_BIKESHED=false
DO_UPDATE=true
DO_LINT=true
DO_HIGHLIGHT=true
Expand Down Expand Up @@ -85,14 +86,16 @@ function main {
exit 0
fi

checkWattsi
ensureHighlighterInstalled
if [[ $USE_BIKESHED != "true" ]]; then
checkWattsi
ensureHighlighterInstalled

doLint
doLint

updateRemoteDataFiles
updateRemoteDataFiles

startHighlightServer
startHighlightServer
fi

processSource "source" "default"

Expand Down Expand Up @@ -146,6 +149,7 @@ function processCommandLineArgs {
echo " $0 help Show this usage statement."
echo
echo "Build options:"
echo " -b|--bikeshed Use Bikeshed instead of Wattsi. (experimental)"
echo " -d|--docker Use Docker to build in a container."
echo " -r|--remote Use the build server."
echo " -s|--serve After building, serve the results on http://localhost:$SERVE_PORT."
Expand Down Expand Up @@ -176,6 +180,10 @@ function processCommandLineArgs {
DO_HIGHLIGHT=false
SINGLE_PAGE_ONLY=true
;;
-b|--bikeshed)
USE_BIKESHED=true
SINGLE_PAGE_ONLY=true
;;
-d|--docker)
USE_DOCKER=true
;;
Expand Down Expand Up @@ -663,34 +671,48 @@ function processSource {
cargo run "${cargo_args[@]}" <"$HTML_SOURCE/$source_location" >"$HTML_TEMP/source-whatwg-complete"
fi

runWattsi "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/wattsi-output"
if [[ $WATTSI_RESULT == "0" ]]; then
if [[ $LOCAL_WATTSI != "true" ]]; then
"$QUIET" || grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
fi
if [[ $USE_BIKESHED == "true" ]]; then
clearDir "$HTML_TEMP/bikeshed-output"

node wattsi2bikeshed.js "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/source-whatwg-complete.bs"

local bikeshed_args=( --force )
$DO_UPDATE || bikeshed_args+=( --no-update )
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"
else
if [[ $LOCAL_WATTSI != "true" ]]; then
"$QUIET" || grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
fi
if [[ $WATTSI_RESULT == "65" ]]; then
echo
echo "There were errors. Running again to show the original line numbers."
echo
runWattsi "$HTML_SOURCE/$source_location" "$HTML_TEMP/wattsi-raw-source-output"
runWattsi "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/wattsi-output"
if [[ $WATTSI_RESULT == "0" ]]; then
if [[ $LOCAL_WATTSI != "true" ]]; then
"$QUIET" || grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
fi
else
if [[ $LOCAL_WATTSI != "true" ]]; then
grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
"$QUIET" || grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
fi
if [[ $WATTSI_RESULT == "65" ]]; then
echo
echo "There were errors. Running again to show the original line numbers."
echo
runWattsi "$HTML_SOURCE/$source_location" "$HTML_TEMP/wattsi-raw-source-output"
if [[ $LOCAL_WATTSI != "true" ]]; then
grep -v '^$' "$HTML_TEMP/wattsi-output.txt" # trim blank lines
fi
fi
echo
echo "There were errors. Stopping."
exit "$WATTSI_RESULT"
fi
echo
echo "There were errors. Stopping."
exit "$WATTSI_RESULT"
fi

# Keep the list of files copied from $HTML_SOURCE in sync with `doServerBuild`

if [[ $build_type == "default" ]]; then
# Singlepage HTML
mv "$HTML_TEMP/wattsi-output/index-html" "$HTML_OUTPUT/index.html"
if [[ $USE_BIKESHED == "true" ]]; then
mv "$HTML_TEMP/bikeshed-output/index.html" "$HTML_OUTPUT/index.html"
else
mv "$HTML_TEMP/wattsi-output/index-html" "$HTML_OUTPUT/index.html"
fi

if [[ $SINGLE_PAGE_ONLY == "false" ]]; then
# Singlepage Commit Snapshot
Expand All @@ -706,7 +728,9 @@ function processSource {
fi

cp -p entities/out/entities.json "$HTML_OUTPUT"
cp -p "$HTML_TEMP/wattsi-output/xrefs.json" "$HTML_OUTPUT"
if [[ $USE_BIKESHED == "false" ]]; then
cp -p "$HTML_TEMP/wattsi-output/xrefs.json" "$HTML_OUTPUT"
fi

clearDir "$HTML_TEMP"

Expand Down
Loading