mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
docs: add document about local development
This commit is contained in:
parent
da09ee8565
commit
952c0184ca
42
docs/local-development.md
Normal file
42
docs/local-development.md
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
## Prerequesites
|
||||||
|
|
||||||
|
* [Node.js](https://nodejs.org/) v12+
|
||||||
|
* [npm](https://www.npmjs.com/package/npm)
|
||||||
|
* [npx](https://www.npmjs.com/package/npx)
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
Building your clone of the repository is easy:
|
||||||
|
|
||||||
|
1. run `npm install`.
|
||||||
|
1. run `npx grunt build` (see [`Gruntfile.js`][gruntfile]). This command:
|
||||||
|
|
||||||
|
1. Cleans the repo.
|
||||||
|
1. Checks code quality ([JSHint](https://jshint.com/) and [ESLint](https://eslint.org/)).
|
||||||
|
1. Runs tests.
|
||||||
|
1. Creates the [distributable][sd-dist] and [minified][sd-min] files in the [`dist`][dist-folder] folder.
|
||||||
|
|
||||||
|
## Test
|
||||||
|
|
||||||
|
A suite of tests is available which require Node.js. Once Node is installed, run the following command from
|
||||||
|
the project root to install the dependencies:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Once installed, run tests from the project root:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
You can easily add new tests:
|
||||||
|
|
||||||
|
1. Create a markdown file (ending in `.md`) that contains the markdown to test.
|
||||||
|
1. Create a `.html` file with the same name as the markdown one from the previous step. This `html` file will automatically be tested when the tests are executed with `mocha`.
|
||||||
|
|
||||||
|
[gruntfile]: https://github.com/showdownjs/showdown/blob/master/Gruntfile.js
|
||||||
|
[sd-dist]: https://github.com/showdownjs/showdown/blob/master/dist/showdown.js
|
||||||
|
[sd-min]: https://github.com/showdownjs/showdown/blob/master/dist/showdown.min.js
|
||||||
|
[dist-folder]: https://github.com/showdownjs/showdown/tree/master/dist
|
|
@ -48,4 +48,5 @@ nav:
|
||||||
- Overview: extensions.md
|
- Overview: extensions.md
|
||||||
- Create an extension: create-extension.md
|
- Create an extension: create-extension.md
|
||||||
- List of known extensions: extensions-list.md
|
- List of known extensions: extensions-list.md
|
||||||
- Tutorials: tutorials/index.md
|
- Tutorials: tutorials/index.md
|
||||||
|
- Local development: local-development.md
|
Loading…
Reference in New Issue
Block a user