Skip to content

Commit

Permalink
Revert recent changes for syntax highlighting
Browse files Browse the repository at this point in the history
Attempts to fix #169.
  • Loading branch information
domenic committed Jul 23, 2018
1 parent 349edd8 commit ffe6f19
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 28 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM debian:sid
## dependency installation: nginx, wattsi, and other build tools
## cleanup freepascal since it is no longer needed after wattsi build
RUN apt-get update && \
apt-get install -y ca-certificates curl git unzip fp-compiler fp-units-fcl fp-units-net libc6-dev nginx python2.7 python-pip && \
apt-get install -y ca-certificates curl git unzip fp-compiler fp-units-fcl fp-units-net libc6-dev nginx && \
git clone https://github.com/whatwg/wattsi.git /whatwg/wattsi && \
cd /whatwg/wattsi && \
/whatwg/wattsi/build.sh && \
Expand Down
19 changes: 5 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ HTML_OUTPUT=${HTML_OUTPUT:-$DIR/output}
export HTML_OUTPUT

SHA_OVERRIDE=${SHA_OVERRIDE:-}
HIGHLIGHT_SERVER_URL="http://127.0.0.1:8080"

for arg in "$@"
do
Expand Down Expand Up @@ -367,10 +366,8 @@ function processSource {
perl .pre-process-tag-omission.pl < "$HTML_TEMP/source-expanded-2" | perl .pre-process-index-generator.pl > "$HTML_TEMP/source-whatwg-complete" # this one could be merged

function runWattsi {
# Input arguments:
# - $1 is the file to run Wattsi on
# - $2 is a directory for Wattsi to write output to
# - $3 is the URL for the syntax-highlighter server
# Input arguments: $1 is the file to run wattsi on, $2 is a directory for wattsi to write output
# to
# Output:
# - Sets global variable $WATTSI_RESULT to an exit code (or equivalent, for HTTP version)
# - $HTML_TEMP/wattsi-output directory will contain the output from wattsi on success
Expand All @@ -383,9 +380,9 @@ function processSource {
if $QUIET; then
WATTSI_ARGS+=( --quiet )
fi
WATTSI_ARGS+=( "$1" "$HTML_SHA" "$2" "$BUILD_TYPE" "$HTML_CACHE/caniuse.json" "$HTML_CACHE/w3cbugs.csv" "$HIGHLIGHT_SERVER_URL" )
WATTSI_ARGS+=( "$1" "$HTML_SHA" "$2" "$BUILD_TYPE" "$HTML_CACHE/caniuse.json" "$HTML_CACHE/w3cbugs.csv")
if hash wattsi 2>/dev/null; then
if [[ "$(wattsi --version | cut -d' ' -f2)" -lt "$WATTSI_LATEST" ]]; then
if [ "$(wattsi --version | cut -d' ' -f2)" -lt "$WATTSI_LATEST" ]; then
echo
echo "Warning: Your wattsi version is out of date. You should to rebuild an"
echo "up-to-date wattsi binary from the wattsi sources."
Expand Down Expand Up @@ -437,10 +434,7 @@ function processSource {
fi
}

"$DIR/highlighter/server.py" &
HIGHLIGHT_SERVER_PID=$!

runWattsi "$HTML_TEMP/source-whatwg-complete" "$HTML_TEMP/wattsi-output" "$HIGHLIGHT_SERVER_URL"
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
Expand All @@ -462,9 +456,6 @@ function processSource {
echo "There were errors. Stopping."
exit "$WATTSI_RESULT"
fi
kill "$HIGHLIGHT_SERVER_PID"
# suppresses 'Terminated: 15 "$DIR/highlighter/server.py"' message
wait "$HIGHLIGHT_SERVER_PID" 2>/dev/null || # ignore non-zero exit code

function generateBacklinks {
perl .post-process-partial-backlink-generator.pl "$HTML_TEMP/wattsi-output/index-$1" > "$2/index.html";
Expand Down
2 changes: 0 additions & 2 deletions ci-deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ RUN apt-get update && \
fp-compiler fp-units-fcl fp-units-net libc6-dev \
default-jre \
libfontconfig1 libgomp1 libxml2 \
python2.7 python-pip \
fonts-dejavu fonts-droid-fallback fonts-liberation fonts-symbola fonts-unfonts-core

# Dependency lines above are:
# - General
# - Wattsi
# - validator
# - Prince
# - Highlighter
# - fonts

# Dependecies of prince_11.3-1_debian8.0_amd64.deb (not used) are libc6 libcurl3 libfontconfig1
Expand Down
7 changes: 0 additions & 7 deletions ci-deploy/outside-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:-false}
# - DOCKER_PASSWORD is set from the outside
# - ENCRYPTION_LABEL is set from the outside

# Initialize the highlighter submodule for html-build
(
cd html-build
git submodule init
git submodule update
)

git clone --depth 1 https://github.com/whatwg/wattsi.git wattsi

git clone --depth 1 https://github.com/pts/pdfsizeopt.git pdfsizeopt
Expand Down
1 change: 0 additions & 1 deletion highlighter
Submodule highlighter deleted from dea61f

0 comments on commit ffe6f19

Please sign in to comment.