diff --git a/docs/local-development.md b/docs/local-development.md new file mode 100644 index 0000000..0d220bb --- /dev/null +++ b/docs/local-development.md @@ -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 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 1f75413..b194513 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -48,4 +48,5 @@ nav: - Overview: extensions.md - Create an extension: create-extension.md - List of known extensions: extensions-list.md - - Tutorials: tutorials/index.md \ No newline at end of file + - Tutorials: tutorials/index.md + - Local development: local-development.md \ No newline at end of file