From 661073b249eae1b4b183337eb000109100e6adec Mon Sep 17 00:00:00 2001 From: David Anson Date: Thu, 7 May 2015 09:15:41 -0700 Subject: [PATCH] Add introductory text to demo, default all links to target=_blank. --- demo/default.css | 22 ++++++++++++++++++++++ demo/default.htm | 1 + demo/default.js | 36 ++++++++++++++++++++++++++++++++++-- package.json | 2 +- 4 files changed, 58 insertions(+), 3 deletions(-) diff --git a/demo/default.css b/demo/default.css index 7a93298e..26249ddd 100644 --- a/demo/default.css +++ b/demo/default.css @@ -6,6 +6,27 @@ body { font-family: "Segoe UI", GillSans, Helvetica, sans-serif; font-weight: lighter; } +blockquote { + background: rgba(0, 0, 0, 0.05); +} +h1 { + font-size: 130%; +} +h2 { + font-size: 125%; +} +h3 { + font-size: 120%; +} +h4 { + font-size: 115%; +} +h5 { + font-size: 110%; +} +h6 { + font-size: 105%; +} header { font-size: 140%; font-weight: bold; @@ -50,6 +71,7 @@ textarea { .outlined { border: 1px solid black; margin: 2px; + padding-left: 3px; } .overflow-auto-scroll { overflow-x: auto; diff --git a/demo/default.htm b/demo/default.htm index 4d0248e8..5a6b21ff 100644 --- a/demo/default.htm +++ b/demo/default.htm @@ -6,6 +6,7 @@ markdownlint demo +
diff --git a/demo/default.js b/demo/default.js index 8e634f43..4fff87fc 100644 --- a/demo/default.js +++ b/demo/default.js @@ -35,6 +35,9 @@ var options = { "strings": { "content": content + }, + "config": { + "MD013": false } }; var results = window.markdownlint.sync(options).toString(); @@ -44,8 +47,8 @@ function replacer(match, p1, p2, p3) { var ruleRef = rulesMd + "#" + p2.toLowerCase() + "---" + p3.toLowerCase().replace(/ /g, "-"); - return " " + p1 + " - " + - "" + p2 + " " + p3; + return "" + p1 + " - " + + "" + p2 + " " + p3; }); }).join("
"); } @@ -110,4 +113,33 @@ openFile.addEventListener("change", onOpenFileChange); markdown.addEventListener("input", onMarkdownInput); violations.addEventListener("click", onLineNumberClick, true); + + /*eslint-disable max-len */ + markdown.value = [ + "## Introduction", + "", + "`markdownlint` is a [Node.js](https://nodejs.org/)/[io.js](https://iojs.org/) style checker and lint tool for [Markdown](http://en.wikipedia.org/wiki/Markdown) files to automatically validate content, prevent rendering problems, and promote consistency.", + "This page offers an easy way to try it out interactively!", + "", + "#### Instructions", + "", + "Type or paste `Markdown ` content in the upper-left box, drag-and-drop a file, or open one with the chooser at the top.", + "Content gets parsed and displayed in the upper-right box; rule violations (if any) show up in the lower-right box.", + "Click a violation for information about it or click its line number to highlighted it in the lower-left box.", + "", + "> *Note*: [All rules](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md) are enabled except for [MD013 Line length](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013---line-length). ", + "", + "", + "#### Resources", + "* [`markdownlint` on GitHub](https://github.com/DavidAnson/markdownlint)", + "* [`markdownlint` on npm](https://www.npmjs.com/package/markdownlint)", + "* [Markdown specification](http://daringfireball.net/projects/markdown/)", + "*\t[CommonMark specification](http://commonmark.org/)", + "", + "#### Thanks", + "", + "[`markdownlint/Ruby`](https://github.com/mivok/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!" + ].join("\n"); + /*eslint-enable max-len */ + onMarkdownInput(); }()); diff --git a/package.json b/package.json index 1e4d51d6..b52dc23e 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "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\" demo & eslint --rule \"no-console: 0, no-shadow: 0\" example", + "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", "example": "npm install through2 & cd example & node standalone.js & grunt markdownlint & gulp markdownlint" },