Skip to content

Commit

Permalink
more bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGaukler committed Aug 8, 2018
1 parent d03c1b4 commit d34caed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions BUGS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- order of output PDF is not optimal, cannot be configured
- font size is often too small
- dead links to nonexisting wiki pages aren't ignored (WONTFIX)
4 changes: 4 additions & 0 deletions example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
set -e
./all-wikis-to-html.sh https://gitlab.cs.fau.de/ ezs/ezs-board
echo "the output is in output/..."
5 changes: 3 additions & 2 deletions gitlabwiki-to-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for i in */assets/*.css; do cat "$scriptdir"/remove-dynamic-content.css >> $i; d
for depth in $(seq 1 100); do
path_to_top=$(for i in $(seq 1 $(($depth-4))); do echo -n "../"; done)
# TODO BUG: wikipages accidentaly named "something.txt" are excluded from this transformation (same for the copied regexp some lines below)
find -maxdepth $depth -mindepth $depth -type f \( -name '*.html' -o -name '*.1' -o -not -regex ".*\.[a-z][a-z][a-z]?" \) -exec sed 's/src="data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="//g;s| data-src="'/$2/'| src="'$path_to_top'|g;s| data-src="| src="|g' -i '{}' ';'
find -maxdepth $depth -mindepth $depth -type f \( -name '*.html' -o -name '*.1' -o -not -regex ".*\.[a-zA-Z][a-zA-Z][a-zA-Z]?" \) -exec sed 's/src="data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="//g;s| data-src="'/$2/'| src="'$path_to_top'|g;s| data-src="| src="|g' -i '{}' ';'
done

xdg-open */$2/wikis/index.html
Expand All @@ -27,12 +27,13 @@ xdg-open */$2/wikis/index.html
### 2.1 PREPROCESS HTML

cd ..
zip html.zip -r html/
cp -r html temp-for-pdf
cd temp-for-pdf

# work around a few bugs where gitlab doesn't enforce canonic URLs:
# force ending as .html, force filename as lowercase (except files already ending in .html), "-" is equal to " "
find -type f \( -name '*.1' -o -not -regex ".*\.[a-z][a-z][a-z]?" \) -execdir cp '{}' '{}.copy.html' ';' -execdir rename -f 'y/A-Z\-/a-z /' '{}.copy.html' ';'
find */$2/wikis/ -type f \( -name '*.1' -o -not -regex ".*\.[a-zA-Z][a-zA-Z][a-zA-Z]?" \) -execdir cp '{}' '{}.copy.html' ';' -execdir rename -f 'y/A-Z\-/a-z /' '{}.copy.html' ';'

# deduplication: x.1 == x/index.html
for dir in $(find -mindepth 1 -type d); do
Expand Down

0 comments on commit d34caed

Please sign in to comment.