mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Update NPM scripts and documentation (#1146)
* Group more test npm scripts into `test:` * Update documentations on the development workflow * Update .travis.yml to match updated NPM scripts * Run npm install in Travis
This commit is contained in:
committed by
Kevin Barabash
parent
d80be86015
commit
3f69de5036
@@ -37,7 +37,7 @@ your symbol in TeX surrounded by other different kinds of symbols, and seeing
|
||||
whether your spacing matches the spacing that TeX produces.
|
||||
|
||||
Once your symbol works, check the JavaScript console to make sure you don't get
|
||||
a message like "Can't find character metrics for _" when you render your symbol.
|
||||
a message like "Can't find character metrics for \_" when you render your symbol.
|
||||
If you do, check out [extract_ttfs.py](metrics/extract_ttfs.py).
|
||||
|
||||
#### Adding new functions
|
||||
@@ -87,6 +87,12 @@ tests when you submit a pull request, in case you forget.
|
||||
|
||||
If you make any changes to Parser.js, add Jest tests to ensure they work.
|
||||
|
||||
Some tests verify the structure of the output tree using [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html).
|
||||
Those snapshots can be updated by running `npm run test:jest:update`.
|
||||
|
||||
Also, test code coverage can be collected by `npm run test:jest:coverage`.
|
||||
You can view the report in `coverage/lcov-report/index.html`.
|
||||
|
||||
#### Screenshot tests
|
||||
|
||||
To ensure the final output looks good, we screenshot different expressions.
|
||||
@@ -117,6 +123,11 @@ is hard to test new changes in many browsers. If you can, please test your
|
||||
changes in as many browsers as possible. In particular, if you make CSS changes,
|
||||
try to test in IE 9, using [modern.ie](http://modern.ie) VMs.
|
||||
|
||||
## Building
|
||||
|
||||
KaTeX is built using webpack with configuration `webpack.config.js`. Run
|
||||
`npm run build` to build the project.
|
||||
|
||||
## Style guide
|
||||
|
||||
Code
|
||||
@@ -130,6 +141,13 @@ Code
|
||||
|
||||
In general, try to make your code blend in with the surrounding code.
|
||||
|
||||
The code can be linted by running `npm run test:lint`, which lints JavaScript
|
||||
files using ESLint and stylesheets using stylelint. They must pass to commit
|
||||
the changes.
|
||||
|
||||
Some files have flowtype annotations and can be checked for type errors using
|
||||
Flow by running `npm run test:flow`. See [Flow](https://flow.org/) for more details.
|
||||
|
||||
## Pull Requests
|
||||
|
||||
- link back to the original issue(s) whenever possible
|
||||
@@ -137,7 +155,7 @@ In general, try to make your code blend in with the surrounding code.
|
||||
- commits should be squashed before merging
|
||||
- large pull requests should be broken into separate pull requests (or multiple logically cohesive commits), if possible
|
||||
|
||||
## Working with submodules
|
||||
## Working with submodules
|
||||
|
||||
The fonts for KaTeX live in a submodule which appears in submodules/katex-fonts.
|
||||
Most of the time you won't have to worry about this unless you're making
|
||||
@@ -160,6 +178,7 @@ about how to use git submodules see https://chrisjean.com/git-submodules-adding-
|
||||
|
||||
When submitting pull requests, that update katex-fonts, you'll need to submit
|
||||
two pull requests: one for [KaTeX/katex-fonts](https:/github.com/KaTeX/katex-fonts) and one for [Khan/KaTeX](https://github.com/Khan/KaTeX).
|
||||
|
||||
## CLA
|
||||
|
||||
In order to contribute to KaTeX, you must first sign the CLA, found at www.khanacademy.org/r/cla
|
||||
|
Reference in New Issue
Block a user