mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Update README with steps to run in the browser.
This commit is contained in:
parent
51f420cfe1
commit
4a5ea23ff7
1 changed files with 28 additions and 3 deletions
31
README.md
31
README.md
|
@ -38,9 +38,6 @@ cases come directly from that project.
|
|||
[`markdownlint` demo](http://dlaa.me/markdownlint/), an interactive, in-browser
|
||||
playground for learning and exploring.
|
||||
|
||||
> *Note*: `markdownlint` is not intended for use in the browser; the demo has
|
||||
> polyfills and avoids referencing the `fs` module.
|
||||
|
||||
## Rules
|
||||
|
||||
* **MD001** - Header levels should only increment by one level at a time
|
||||
|
@ -364,6 +361,34 @@ bad.md: 3: MD018 No space after hash on atx style header
|
|||
Use --force to continue.
|
||||
```
|
||||
|
||||
## Browser
|
||||
|
||||
`markdownlint` works in the browser.
|
||||
|
||||
Generate normal and minified scripts with:
|
||||
|
||||
```shell
|
||||
npm run build-demo
|
||||
```
|
||||
|
||||
Then reference `markdown-it` and `markdownlint`:
|
||||
|
||||
```html
|
||||
<script src="demo/markdown-it.min.js"></script>
|
||||
<script src="demo/markdownlint-browser.min.js"></script>
|
||||
```
|
||||
|
||||
And call it like so:
|
||||
|
||||
```js
|
||||
var options = {
|
||||
"strings": {
|
||||
"content": "Some Markdown to lint."
|
||||
}
|
||||
};
|
||||
var results = window.markdownlint.sync(options).toString();
|
||||
```
|
||||
|
||||
## History
|
||||
|
||||
* 0.0.1 - Initial release, includes tests MD001-MD032.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue