mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Simplify the mechanics of using markdownlint in a browser.
This commit is contained in:
parent
d263a955f3
commit
070eb19177
5 changed files with 14 additions and 16 deletions
|
@ -31,9 +31,7 @@
|
|||
<footer>Copyright © 2015 by <a href="//dlaa.me/">David Anson</a></footer>
|
||||
</div>
|
||||
</div>
|
||||
<script src="browser-polyfills.js"></script>
|
||||
<script src="markdown-it.min.js"></script>
|
||||
<script src="require-stub.js"></script>
|
||||
<script src="markdownlint-browser.js"></script>
|
||||
<script src="default.js"></script>
|
||||
</body>
|
||||
|
|
7
demo/markdown-it-stub.js
Normal file
7
demo/markdown-it-stub.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
// Alias "markdown-it" (expected) to "markdownit" (exported)
|
||||
module.exports = window.markdownit;
|
||||
if (!module.exports) {
|
||||
console.error("markdown-it must be loaded before markdownlint.");
|
||||
}
|
|
@ -1,12 +1,10 @@
|
|||
CACHE MANIFEST
|
||||
# 2015-05-08
|
||||
browser-polyfills.js
|
||||
# 2015-06-17
|
||||
default.css
|
||||
default.htm
|
||||
default.js
|
||||
favicon.ico
|
||||
markdown-it.min.js
|
||||
markdownlint-browser.js
|
||||
require-stub.js
|
||||
NETWORK:
|
||||
*
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
// Aliases "markdown-it" (expected) for "markdownit" (exported)
|
||||
function require(module) {
|
||||
if (module === "markdown-it") {
|
||||
return window.markdownit;
|
||||
}
|
||||
}
|
|
@ -15,8 +15,8 @@
|
|||
"test": "nodeunit",
|
||||
"test-cover": "istanbul cover node_modules/nodeunit/bin/nodeunit",
|
||||
"debug": "node debug node_modules/nodeunit/bin/nodeunit",
|
||||
"lint": "eslint lib test & eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0\" demo & eslint --rule \"no-console: 0, no-shadow: 0\" example",
|
||||
"build-demo": "copy node_modules\\markdown-it\\dist\\markdown-it.min.js demo & browserify lib/markdownlint.js --standalone markdownlint --exclude markdown-it --outfile demo/markdownlint-browser.js",
|
||||
"lint": "eslint lib test & eslint --env browser --global markdownit --global markdownlint --rule \"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0\" demo & eslint --rule \"no-console: 0, no-shadow: 0\" example",
|
||||
"build-demo": "copy node_modules\\markdown-it\\dist\\markdown-it.min.js demo & browserify demo/browser-polyfills.js lib/markdownlint.js --standalone markdownlint --outfile demo/markdownlint-browser.js",
|
||||
"example": "npm install through2 & cd example & node standalone.js & grunt markdownlint & gulp markdownlint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -35,5 +35,8 @@
|
|||
"md",
|
||||
"check",
|
||||
"validate"
|
||||
]
|
||||
],
|
||||
"browser": {
|
||||
"markdown-it": "./demo/markdown-it-stub.js"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue