forked from mathjax/MathJax-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added
previews
make target which uses NPM package usus
and a loca…
…l installed Chrome browser to render the demo/test pages to static HTML. This produces much better output (IMHO) than the `mathjax_node` package.
- Loading branch information
1 parent
2cb1961
commit fcc3104
Showing
4 changed files
with
1,015 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#! /bin/bash | ||
# | ||
# Generate static HTML preview pages for every demo page. | ||
# | ||
# NOTE/WARNING: this script should be executed from the Makefile, which in turn | ||
# is invoked through `npm run previews` or eqv. command, so that the NODE SEARCH PATH | ||
# includes the local node_modules/ directory and `usus` will be found there! | ||
# | ||
|
||
|
||
|
||
if test -d "$1" ; then cd "$1" ; else | ||
echo <<EOT | ||
generate-previews.sh MATHJAXBASEPATH | ||
Error: missing BASEPATH argument. | ||
EOT | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
if test -d ./test/ ; then cd ./test/ ; else | ||
echo <<EOT | ||
generate-previews.sh MATHJAXBASEPATH | ||
Error: BASEPATH argument must point at the MathJax repository BASE PATH, | ||
which is expected to contain a /test/ directory, among others... | ||
EOT | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
mkdir -p StaticPreviewPages | ||
|
||
for f in *.html ; do | ||
# detect platform and call cygpath only where applicable: | ||
if $( cygpath -w -a . &> /dev/null ) ; then | ||
# Windows OS/cygwin/MingW/Wingit dev platform: | ||
usus render --url file://$( cygpath -w -a ./$f ) > StaticPreviewPages/$f | ||
else | ||
# Linux et al: | ||
usus render --url file://$( realpath ./$f ) > StaticPreviewPages/$f | ||
fi | ||
done | ||
|
Oops, something went wrong.