{"_id":"@anhdhbn/hexo-filter-mermaid-diagrams","_rev":"3-31c008e8f1cc974f0988977de14a2c66","name":"@anhdhbn/hexo-filter-mermaid-diagrams","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.6":{"name":"@anhdhbn/hexo-filter-mermaid-diagrams","version":"1.0.6","description":"mermaid diagrams for hexo","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/webappdevelp/hexo-filter-mermaid-diagrams.git"},"keywords":["hexo-filter-mermaid-diagrams","hexo-filter-mermaid","hexo-filter","mermaid"],"author":{"name":"https://webappdevelp.github.io"},"license":"MIT","bugs":{"url":"https://github.com/webappdevelp/hexo-filter-mermaid-diagrams/issues"},"homepage":"https://github.com/webappdevelp/hexo-filter-mermaid-diagrams#readme","dependencies":{"deep-assign":"^2.0.0"},"directories":{"lib":"lib"},"devDependencies":{},"gitHead":"48770737a9583d37669d8cc81b05373002eedb0e","_id":"@anhdhbn/hexo-filter-mermaid-diagrams@1.0.6","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Lrw765j8DCGcNaY/fG/24HRWCsWUF/sp9flv5ZyxfJPQLiWmtwF6V/gi0FzJfZszcpvhQvBCVFWJWEosb9JFhg==","shasum":"642331a266762804692d9f80f149c13e8449c903","tarball":"https://registry.npmjs.org/@anhdhbn/hexo-filter-mermaid-diagrams/-/hexo-filter-mermaid-diagrams-1.0.6.tgz","fileCount":10,"unpackedSize":173579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeghv5CRA9TVsSAnZWagAAGHYQAIS6bCNRN+WxBIwqnaCQ\nDgQ2vurpHG2t0hA6N1+LSF9P6M8fsfMGLgoJhrISGB+Vfuy1fR/7DL+h/7tC\nvZnz95a7OIN991yYk+9bEOzc70rPG6y9S8KAk7fXsw4gkOG07mxvlKz+h+Ge\nlRqQLPcbooyyUihs9xFOqAbiQaeRpNShAxgLjL15Y390xA9s34RtjtCh1oAV\nioeUTyVvYKRi6cJvrp0V0o1pohZHl0uQeCD47baWzGCQO8ES4c2qOlzFWGSx\n1ChWYDXawi+2NknQe0uMm4M9PteCyPFMcBeg0gVbiV27OxGG4WtjLkmn4aaF\nju9WooOjfhBUJsehNzDDGCr0GZqALPncgs84EfPx3VLFfnuXw+qg5QJmf4iL\nsyVtjKU6WLfb35xZzcEr+leDXW7dbFjT7LUy+e0Rx6YO7SaePsx4Qb/NvNLL\nnC3DFJ+DFKe1nE7jW+vLyNGpuW5jQabMULKyU7sErPDz7dx01l2uuxiZY7P4\nG5oHC9AkuAvWxq5iKS8txKeYNswnb6PA3y5ui6Hl+8TNj2/p49rDhAQn49h+\nOn0Pv0u9enpyyW1YM4ouTBMc85I91xzNGW19TEaCVibok/nb/egVaAhFpXl9\nd6zPHz76LF3HpyBnhuLJlot6Wfb4UoNzUnTi5bKnOa4y1imJcdwRlgAd8vT/\n/kdd\r\n=MUPL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPd4uLSNuE3c3xN96U5q3MKCU3EbVKd4Ckp3VOHV2y+AiBc5mCyTt+AY/3Kc+aaSJoXUQ9dT9jLG+zBdx27UOWBbg=="}]},"maintainers":[{"name":"anhdhbn","email":"anhdhbn@gmail.com"}],"_npmUser":{"name":"anhdhbn","email":"anhdhbn@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hexo-filter-mermaid-diagrams_1.0.6_1585585144546_0.6545447846378163"},"_hasShrinkwrap":false},"1.0.7":{"name":"@anhdhbn/hexo-filter-mermaid-diagrams","version":"1.0.7","description":"mermaid diagrams for hexo","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/webappdevelp/hexo-filter-mermaid-diagrams.git"},"keywords":["hexo-filter-mermaid-diagrams","hexo-filter-mermaid","hexo-filter","mermaid"],"author":{"name":"https://webappdevelp.github.io"},"license":"MIT","bugs":{"url":"https://github.com/webappdevelp/hexo-filter-mermaid-diagrams/issues"},"homepage":"https://github.com/webappdevelp/hexo-filter-mermaid-diagrams#readme","dependencies":{"deep-assign":"^2.0.0"},"directories":{"lib":"lib"},"devDependencies":{},"gitHead":"969055e1d92a0b01a2056991ef47f92763d00a0d","_id":"@anhdhbn/hexo-filter-mermaid-diagrams@1.0.7","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-G58hTvcl3WfuT763P9XL5n2iu3PzFfWrgmwhjfrl1dCr0agmTNMfvWBEXPwq4bcvSMeGSnqZjMCGxC49WF2GhQ==","shasum":"033323cb528111e10ce6bd074f32ed7d996175db","tarball":"https://registry.npmjs.org/@anhdhbn/hexo-filter-mermaid-diagrams/-/hexo-filter-mermaid-diagrams-1.0.7.tgz","fileCount":10,"unpackedSize":173579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeghzICRA9TVsSAnZWagAAA/AP/jPmcAkVvODa0omwWIXD\nvJSEg/jkqCwLObJt/0HWhBKaIcNDiE10/V65SSxzkVeyt4/XachvCGCJij8h\nWGstEqRio3lQPAKn7Ig2PZbGpJlS1ejUp/yHNEX9HLJ+6No+EHJqccSS9y2M\n6OI7V/noC8F+uQKujWesL6TSROFT10zaq+Dr3uSadR1AvbEbb1vXEhlkT5Rr\nDpMNi9ISFZywGL9AXb4S7nIV3YSlbgDy62TWyQFoDQTTsGNe/bFSYfhdDJV2\nDFINFP0dQQEG/ZmzGCbITnoB/WgA3N5DwYD8yK2wnwvmj4lHSIYCo5uTDWH+\nnPpOIWQG6A7Jske5V7ai7pHUF7xHz9C7iIMXcSYgCYm1W/rG/jzW7FziA3En\n6qXo4C9jbBmDCtGQo3xNxg7EaUDaQFyGgopgYJ4y3WT9MJQtiIDG3IyuWSgg\n5Pil5iMaC7pB3owiBTRZzQC8Mcc12tru4ZDn7SgSm/TYnDaTlqhrub0Q54tR\nU7wChNDkLwRS9EXJ7tzK8jNw6KlufAy9Tx5PfNQ+wHyxGIfDu/Rvx+c8j0qw\ng/w5wf/zD+qzUmrYQ8Lh/kNgmagHFBv/KbNRtUoget1t0QaVYIi9Ny0WQU/4\nXh2sOXLtXL/x1mydjEPdX2KQrlEZs8BNB5J4iCphR8cbBMKU7qlqJGEeoJ8c\nPEqL\r\n=j5MX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHiVlAD7jC6/kUqp79+C84d8Y4aT0DaNjkgbirQcrOqnAiAhe9KAPCCIi28QE9YUHn78n+R+Qe7eCIE/DT0Xsy4cOQ=="}]},"maintainers":[{"name":"anhdhbn","email":"anhdhbn@gmail.com"}],"_npmUser":{"name":"anhdhbn","email":"anhdhbn@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hexo-filter-mermaid-diagrams_1.0.7_1585585351697_0.17242727052921425"},"_hasShrinkwrap":false},"1.0.8":{"name":"@anhdhbn/hexo-filter-mermaid-diagrams","version":"1.0.8","description":"mermaid diagrams for hexo","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/anhdhbn/hexo-filter-mermaid-diagrams.git"},"keywords":["hexo-filter-mermaid-diagrams","hexo-filter-mermaid","hexo-filter","mermaid"],"author":{"name":"https://anhdh.me"},"license":"MIT","bugs":{"url":"https://github.com/anhdhbn/hexo-filter-mermaid-diagrams"},"homepage":"https://github.com/anhdhbn/hexo-filter-mermaid-diagrams#readme","dependencies":{"deep-assign":"^2.0.0"},"directories":{"lib":"lib"},"devDependencies":{},"gitHead":"43b5d0dec348b61d833df99a2c2234d09b82655b","_id":"@anhdhbn/hexo-filter-mermaid-diagrams@1.0.8","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-a+hU6gy1I0w73g6yx9fTYoPWSi106QhtBewq0wg9eMaZuOd5rXjWNT/t92+1pJqnBDZiTDYZiGRCF3urDs/l2A==","shasum":"fd5e0aa725ce532fce98185d6a0977a963b6b3c1","tarball":"https://registry.npmjs.org/@anhdhbn/hexo-filter-mermaid-diagrams/-/hexo-filter-mermaid-diagrams-1.0.8.tgz","fileCount":10,"unpackedSize":173539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegh2FCRA9TVsSAnZWagAA6GwP/2V/hEPU2XK7TzUAMzou\nVsD0iBh7bA/dQhvMbR1soy6me1uXIs4AChETWQ6CGxvGMg+i8wz6zvkSrzmz\nuM1LNGuOyJVD2iP+a+NJh6ZDtHwTvQHU+98uCS17xrApta47GqDX4gNJmnsr\nGLn4ZNu6LlETctusRgwPy5vW3KFU0POBLxsBlBUZkcQTnNbdDlMqxYfveQBn\ncZFsmc+Gnz4k76qZjRjEAFdtEd796Znaf35EHib6F80GALyZe8Hrep80FeNU\nPlZFoPrlbEUVRKTMsqc0ulA9RHjDbviGyDBm0nq67M4UbXA7OsfXahwrrbJP\nuAIZbFo9COgt0fAl2Qmkx3iZlEQSZRRJoV5u7ywLTpBL91hqZ/gFr2b95xxJ\nDRRF1fDjLaaEYIPpKWU1vii3hdb1JwiOA0WViLe/tsi/hr0DJWtlqZSkgGOf\nwatYgEGMYGaeWamMYgnxI1bPBbUBAEJUQypD/qGFoUBSqDWApq9iEU+mQteb\nqpkW+6xiBIvA7dwUHJAZujPUbLtg3cCSrLdzawxZMPnyspozI9MVKL4u29sj\nuSolorTTNO0e4SxgUcyk2PEySiuoudEViZbZdxeeO2VTU4a3y23whmO/9F75\nVjGyvK+N8wCoVVGABMBCflVYnkEb6iZQ2lTtzMEehH4M4OJ/hsl9gW1sn1rC\n6I35\r\n=UmRO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICcQMw4M+8tfgouc7wbZzO5m5ws20b34iGBoCmz/R+7qAiEAzcvUFFsOIuGy3tmXtIpWswE1aVPrhvojMo++JRR/cv0="}]},"maintainers":[{"name":"anhdhbn","email":"anhdhbn@gmail.com"}],"_npmUser":{"name":"anhdhbn","email":"anhdhbn@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hexo-filter-mermaid-diagrams_1.0.8_1585585540840_0.29600386439142357"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-30T16:19:04.325Z","1.0.6":"2020-03-30T16:19:04.682Z","modified":"2022-04-04T14:10:29.464Z","1.0.7":"2020-03-30T16:22:31.836Z","1.0.8":"2020-03-30T16:25:41.020Z"},"maintainers":[{"name":"anhdhbn","email":"anhdhbn@gmail.com"}],"description":"mermaid diagrams for hexo","homepage":"https://github.com/anhdhbn/hexo-filter-mermaid-diagrams#readme","keywords":["hexo-filter-mermaid-diagrams","hexo-filter-mermaid","hexo-filter","mermaid"],"repository":{"type":"git","url":"git+https://github.com/anhdhbn/hexo-filter-mermaid-diagrams.git"},"author":{"name":"https://anhdh.me"},"bugs":{"url":"https://github.com/anhdhbn/hexo-filter-mermaid-diagrams"},"license":"MIT","readme":"# hexo-filter-mermaid-diagrams\r\n![](/img/header.png)\r\nGeneration of diagrams and flowcharts from text in a similar manner as markdown.\r\nMermaid plugin is using [mermaid.js](https://mermaidjs.github.io/) fro hexo!\r\n### flowchart\r\n```mermaid\r\ngraph TD;\r\n    A-->B;\r\n    A-->C;\r\n    B-->D;\r\n    C-->D;\r\n```\r\n![](/img/flow.png)\r\n### Sequence diagram\r\n```mermaid\r\nsequenceDiagram\r\n    participant Alice\r\n    participant Bob\r\n    Alice->>John: Hello John, how are you?\r\n    loop Healthcheck\r\n        John->>John: Fight against hypochondria\r\n    end\r\n    Note right of John: Rational thoughts <br/>prevail...\r\n    John-->>Alice: Great!\r\n    John->>Bob: How about you?\r\n    Bob-->>John: Jolly good!\r\n```\r\n![](/img/sequence.png)\r\n### Gantt diagram\r\n```mermaid\r\ngantt\r\ndateFormat  YYYY-MM-DD\r\ntitle Adding GANTT diagram to mermaid\r\n\r\nsection A section\r\nCompleted task            :done,    des1, 2014-01-06,2014-01-08\r\nActive task               :active,  des2, 2014-01-09, 3d\r\nFuture task               :         des3, after des2, 5d\r\nFuture task2               :         des4, after des3, 5d\r\n```\r\n![](/img/gantt.png)\r\n### Class diagram - ❗️ experimental\r\n```mermaid\r\nclassDiagram\r\nClass01 <|-- AveryLongClass : Cool\r\nClass03 *-- Class04\r\nClass05 o-- Class06\r\nClass07 .. Class08\r\nClass09 --> C2 : Where am i?\r\nClass09 --* C3\r\nClass09 --|> Class07\r\nClass07 : equals()\r\nClass07 : Object[] elementData\r\nClass01 : size()\r\nClass01 : int chimp\r\nClass01 : int gorilla\r\nClass08 <--> C2: Cool label\r\n```\r\n![](/img/class.png)\r\n### Git graph - ❗️ experimental\r\n```mermaid\r\ngitGraph:\r\noptions\r\n{\r\n    \"nodeSpacing\": 150,\r\n    \"nodeRadius\": 10\r\n}\r\nend\r\ncommit\r\nbranch newbranch\r\ncheckout newbranch\r\ncommit\r\ncommit\r\ncheckout master\r\ncommit\r\ncommit\r\nmerge newbranch\r\n```\r\n![](/img/git.png)\r\n\r\n> Click here [Mermaid](https://github.com/knsv/mermaid) to learn more official discriptions! \r\n\r\n## Step1 Install Package\r\n```bash\r\n$ yarn add hexo-filter-mermaid-diagrams\r\n```\r\n> In your blog floder, not hexo floder\r\n\r\n## Step2 Edit Config\r\nAfter installed, you should edit hexo config file: `_config.yml`:\r\n```yaml\r\n# mermaid chart\r\nmermaid: ## mermaid url https://github.com/knsv/mermaid\r\n  enable: true  # default true\r\n  version: \"7.1.2\" # default v7.1.2\r\n  options:  # find more api options from https://github.com/knsv/mermaid/blob/master/src/mermaidAPI.js\r\n    #startOnload: true  // default true\r\n```\r\n> ❗️❗️❗️Notice: if you want to use 'Class diagram', please edit your '_config.yml' file, set `external_link: false`. - hexo bug.\r\n\r\n## Step3 include mermaid.js in pug or ejs\r\nAfter edited `_config.yml`, you shou edit your blog page component like `after_footer.pug` , `after-footer.ejs` or `swig`.\r\n\r\nWhere is it?\r\n\r\nOpen your theme folder, you can see the `layout` folder, open it and then you could see it.\r\n\r\nOkey! if your blog is used pug, you can copy the below codes in `after_footer.pug`:\r\n\r\n```pug\r\nif theme.mermaid.enable == true\r\n  script(type='text/javascript', id='maid-script' mermaidoptioins=theme.mermaid.options src='https://unpkg.com/mermaid@'+ theme.mermaid.version + '/dist/mermaid.min.js' + '?v=' + theme.version)\r\n  script.\r\n    if (window.mermaid) {\r\n      var options = JSON.parse(document.getElementById('maid-script').getAttribute('mermaidoptioins'));\r\n      mermaid.initialize(options);\r\n    }\r\n```\r\n\r\n`after-footer.ejs` should copy below codes:\r\n```\r\n<% if (theme.mermaid.enable) { %>\r\n  <script src='https://unpkg.com/mermaid@<%= theme.mermaid.version %>/dist/mermaid.min.js'></script>\r\n  <script>\r\n    if (window.mermaid) {\r\n      mermaid.initialize({theme: 'forest'});\r\n    }\r\n  </script>\r\n<% } %>\r\n```\r\n\r\nswig template engine:\r\n```swig\r\n{% if theme.mermaid.enable %}\r\n  <script src='https://unpkg.com/mermaid@{{ theme.mermaid.version }}/dist/mermaid.min.js'></script>\r\n  <script>\r\n    if (window.mermaid) {\r\n      mermaid.initialize({{ JSON.stringify(theme.mermaid.options) }});\r\n    }\r\n  </script>\r\n{% endif %}\r\n```\r\n\r\n## Fixed\r\n- className 'mermaid' can be showed mermaid diagrams everywhere\r\n- Keep dom right;\r\n- ~~Article preview lists can show code, and post show diagrams;~~\r\n\r\n## Credits\r\nThanks to the [Mermaid](https://mermaidjs.github.io/) project!\r\n","readmeFilename":"README.md"}