diff --git a/plugins/allinc/.npmignore b/plugins/allinc/.npmignore new file mode 120000 index 0000000..b4359f6 --- /dev/null +++ b/plugins/allinc/.npmignore @@ -0,0 +1 @@ +../../.npmignore \ No newline at end of file diff --git a/plugins/allinc/README.md b/plugins/allinc/README.md new file mode 100644 index 0000000..a94c0df --- /dev/null +++ b/plugins/allinc/README.md @@ -0,0 +1,38 @@ +# PIMD Allinc Plugin + +Load all PIMD plugins at once: + +- [Classes](https://github.com/hagenburger/pimd/tree/master/plugins/classes#readme) +- [ID](https://github.com/hagenburger/pimd/tree/master/plugins/id#readme) +- [Preview](https://github.com/hagenburger/pimd/tree/master/plugins/preview#readme) +- [Highlight](https://github.com/hagenburger/pimd/tree/master/plugins/highlight#readme) +- [Showmore](https://github.com/hagenburger/pimd/tree/master/plugins/showmore#readme) +- [HTML injector](https://github.com/hagenburger/pimd/tree/master/plugins/html-injector#readme) + +## Usage + +```sh +npm install --save-dev pimd @pimd/allinc-plugin +``` + +```javascript +highlight=/allincPlugin/g,"require(\"@pimd/allinc-plugin\")",/(? (https://twitter.com/hagenburger)", + "keywords": [ + "markdown", + "pimd-plugin" + ], + "publishConfig": { + "access": "public" + }, + "license": "MIT", + "devDependencies": { + "@pimd/classes-plugin": "0.1.5", + "@pimd/highlight-plugin": "0.1.3", + "@pimd/html-injector-plugin": "0.1.1", + "@pimd/id-plugin": "0.1.4", + "@pimd/preview-plugin": "0.1.5", + "@pimd/prism-plugin": "0.1.1", + "@pimd/showmore-plugin": "0.1.1", + "pimd": "^0.5.0" + } +} diff --git a/plugins/allinc/test.js b/plugins/allinc/test.js new file mode 100644 index 0000000..edbf0b0 --- /dev/null +++ b/plugins/allinc/test.js @@ -0,0 +1,23 @@ +const { Document } = require("../..") +const plugin = require(".") + +describe("Allinc", () => { + it("should have all plugins loaded", () => { + const input = unindent` + # Test + + ~~~html +preview +highlight="x" +showmore=1 +

x

+ ~~~ + ` + const doc = new Document(input) + doc.config.use(plugin) + const html = doc.render() + expect(html).to.have.selector("h1.my-class") + expect(html).to.have.selector("h1#my-id") + expect(html).to.have.selector(".pimd-preview p") + expect(html).to.have.selector(".pimd-highlight") + expect(html).to.have.selector(".pimd-example div[style='display: none']") + expect(html).to.have.selector("code span.token.punctuation") + }) +})