* Create a separate entry point for webpack
Created a webpack entry point for KaTeX, which imports katex.less. As
flow[1] and jest[2] doesn't support CSS modules natively, a separate
entry point is used and it is not flowtyped.
[1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
[2] https://facebook.github.io/jest/docs/en/webpack.html
* Use webpack to build files
* Made webpack.config.js export valid webpack configuration
* Use:
browserify -> webpack
babelify -> babel-loader
UglifyJS CLI -> UglifyJsPlugin
Less CLI -> less-loader
cleancss -> cssnano in css-loader
build/fonts -> file-loader
* Inline CSS(Less) using style-loader and export them using
ExtractTextPlugin
* Add `watch` npm script calling `webpack --watch`
* Improve local testing(webpack-dev-server)
* Made webpackDevServer export a valid webpack configuration
* Compile Less and inline CSS using less-loader and style-loader
* Instead of copying files serve files from /static and use file-loader
* Remove old server.js and its dependencies
* Use webpack-dev-server in Screenshotter
* Include contrib in webpack-dev-server
+ Moved common configurations to webpack.common.js
* Rename webpackDevServer.js to webpack.dev...
to be consistent, avoid confusion with webpack-dev-server and follow
webpack configuration naming convention.
* Remove unnecessary conditional output.path
* Use map instead of reduce
+ Add comments regarding function arguments
* Remove unnecessary mkdir and clean build/* before build
* Use katex as external dependency instead of global variable in contrib
Fixes #692.
* Unblock codes as they are built as a module
* Update package-lock.json
* Add comments regarding devServer option
* Lint renamed webpack.dev.js
a0d8b33
* Export ES6 module and expose its default export
* Revert "Browserify hotfix (#1057)"
This reverts commit f6b509123b
.
* Enables colors on the console when running the dev server in Screenshotter
* Add context to webpack configuration
Allows webpack to be run from other directories
* Move `rm -rf build/*` to npm scripts
* Check dependencies before build
* Move UglifyJsPlugin into config creation
* Let webpack handle ES6 modules
Do not transform modules to commonjs in Babel. However Jest doesn't not
support ES6 modules, so transfrom modules to commonjs when NODE_ENV is
`test`.
* Add documentation on testing in IE 9 and 10 using webpack-dev-server
Changed version range to include IE-compatible version
How to generate screenshotter images
Automatic generation of screen shots
Now you too can generate screenshots from your own computer, and (hopefully)
have them look mostly the same as the current ones! Make sure you have docker
installed and running.
If all you want is (re)create
all the snapshots for all the browsers, then you can do so by running the
screenshotter.sh
script:
dockers/Screenshotter/screenshotter.sh
It will fetch all required selenium docker images, and use them to take screenshots.
Manual generation
If you are creating screenshots on a regular basis, you can keep the
docker containers with the selenium setups running. Essentially you
are encouraged to reproduce the steps from screenshotter.sh
manually. Example run for Firefox:
container=$(docker run -d -P selenium/standalone-firefox:2.46.0)
node dockers/Screenshotter/screenshotter.js -b firefox -c ${container}
# possibly repeat the above command as often as you need, then eventually
docker stop ${container}
docker rm ${container}
For Chrome, simply replace both occurrences of firefox
with chrome
.
Use without docker
It is possible to run screenshotter.js
without the use of Docker:
npm install selenium-webdriver
node dockers/Screenshotter/screenshotter.js
This will generate screenshots using the Firefox installed on your system.
Browsers other than Firefox can be targeted using the --browser
option.
For a complete list of options pass --help
as an argument to
screenshotter.js
. Using these it should be possible to have the script
connect to almost any Selenium web driver you might have access to.
Note that screenshots taken without Docker are very likely to disagree from the ones stored in the repository, due to different versions of various software components being used. The screenshots taken in this fashion are well suited for visual inspection, but for exact binary comparisons it would be neccessary to carefully set up the environment to match the one used by the Docker approach.
Choosing the list of test cases
Both screenshotter.js
and screenshotter.sh
will accept
an --include
option (short -i
) which can be used to specify
a list of test cases to be processed, as a comma separated list.
Conversely, the --exclude
option (short -x
) can be used
to specify a list of cases which are not being processed.
Examples:
node dockers/Screenshotter/screenshotter.js -i Sqrt,SqrtRoot
dockers/Screenshotter/screenshotter.sh --exclude=GreekLetters