From 3607f06fd2d5a846a4e806486dd7ae4d9aed3403 Mon Sep 17 00:00:00 2001 From: Andreas Hildebrandt Date: Mon, 25 Oct 2021 18:21:41 +0200 Subject: [PATCH] Moved submodule to regular folder --- .gitmodules | 3 - nb-mermaid/static/nb-mermaid | 1 - nb-mermaid/static/nb-mermaid/index.html | 65 ++++++++++++++++++ nb-mermaid/static/nb-mermaid/init.js | 11 ++++ .../static/nb-mermaid/lib/mermaid/.bower.json | 39 +++++++++++ .../static/nb-mermaid/lib/mermaid/LICENSE | 22 +++++++ .../static/nb-mermaid/lib/mermaid/bower.json | 28 ++++++++ nb-mermaid/static/nb-mermaid/nb-mermaid.css | 4 ++ nb-mermaid/static/nb-mermaid/nb-mermaid.js | 66 +++++++++++++++++++ 9 files changed, 235 insertions(+), 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 nb-mermaid/static/nb-mermaid create mode 100644 nb-mermaid/static/nb-mermaid/index.html create mode 100644 nb-mermaid/static/nb-mermaid/init.js create mode 100644 nb-mermaid/static/nb-mermaid/lib/mermaid/.bower.json create mode 100644 nb-mermaid/static/nb-mermaid/lib/mermaid/LICENSE create mode 100644 nb-mermaid/static/nb-mermaid/lib/mermaid/bower.json create mode 100644 nb-mermaid/static/nb-mermaid/nb-mermaid.css create mode 100644 nb-mermaid/static/nb-mermaid/nb-mermaid.js diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index afea788..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "mermaid/static/nb-mermaid"] - path = mermaid/static/nb-mermaid - url = https://github.com/bollwyvl/nb-mermaid.git diff --git a/nb-mermaid/static/nb-mermaid b/nb-mermaid/static/nb-mermaid deleted file mode 160000 index c52be96..0000000 --- a/nb-mermaid/static/nb-mermaid +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c52be964e23f366cc40889a3fe8b8055ca95e63d diff --git a/nb-mermaid/static/nb-mermaid/index.html b/nb-mermaid/static/nb-mermaid/index.html new file mode 100644 index 0000000..ca19d60 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/index.html @@ -0,0 +1,65 @@ +nb-mermaid — Mermaid diagrams in the Jupyter Notebook

nb-mermaid

+
+

Make mermaid diagrams in your +Jupyter Notebook Markdown

+
+
graph TD + here[this page] --> bookmarklet(use bookmarklet) + bookmarklet --> make + here --> pip(pip) + here --> clone + pip --> installed + clone(clone) --> installed + clone --> fork(fork) + fork --> profit((profit)) + make(make diagrams) --> profit + installed --> make

see more examples

test drive

+drag this nb-mermaid bookmarklet to your bookmark bar, and click to use live on tmpnb.org ... or your own, local notebooks

install (easy, IPython-integrated)

pip install nb-mermaid 
%reload_ext mermaid

install (less easy, Jupyter)

git clone -b gh-pages \
+  https://github.com/bollwyvl/nb-mermaid.git \
+  ~/.ipython/nbextensions/nb-mermaid
+
+
%%javascript
+IPython.load_ipython_extensions([
+  "nb-mermaid/nb-mermaid"
+]);
+
+

code

+

GitHub Repo

+

license

+

BSD

+
\ No newline at end of file diff --git a/nb-mermaid/static/nb-mermaid/init.js b/nb-mermaid/static/nb-mermaid/init.js new file mode 100644 index 0000000..d89ab74 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/init.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 1.9.3 +(function() { + require({ + paths: { + "nb-mermaid": ["/nbextensions/nb-mermaid/nb-mermaid", "https://bollwyvl.github.io/nb-mermaid/nb-mermaid"] + } + }, ["nb-mermaid"], function(nbmermaid) { + return nbmermaid(); + }); + +}).call(this); diff --git a/nb-mermaid/static/nb-mermaid/lib/mermaid/.bower.json b/nb-mermaid/static/nb-mermaid/lib/mermaid/.bower.json new file mode 100644 index 0000000..eb28c10 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/lib/mermaid/.bower.json @@ -0,0 +1,39 @@ +{ + "name": "mermaid", + "authors": [ + "knsv " + ], + "description": "Markdownish syntax for generating flowcharts, sequence diagrams and gantt charts.", + "main": "dist/mermaid.slim.js", + "keywords": [ + "diagram", + "markdown", + "flowchart", + "sequence diagram", + "gantt" + ], + "license": "MIT", + "ignore": [ + "*", + "!dist/", + "!dist/*", + "!LICENSE" + ], + "devDependencies": { + "jasmine": "~2.0.4", + "dagre": "0.6.2", + "d3": "3.3.8", + "dagre-d3": "0.3.3" + }, + "homepage": "https://github.com/knsv/mermaid", + "version": "0.5.1", + "_release": "0.5.1", + "_resolution": { + "type": "version", + "tag": "0.5.1", + "commit": "0dc983d04ab9400e604a460eea3a409570961ab2" + }, + "_source": "git://github.com/knsv/mermaid.git", + "_target": "~0.5.1", + "_originalSource": "mermaid" +} \ No newline at end of file diff --git a/nb-mermaid/static/nb-mermaid/lib/mermaid/LICENSE b/nb-mermaid/static/nb-mermaid/lib/mermaid/LICENSE new file mode 100644 index 0000000..faae921 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/lib/mermaid/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Knut Sveidqvist + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/nb-mermaid/static/nb-mermaid/lib/mermaid/bower.json b/nb-mermaid/static/nb-mermaid/lib/mermaid/bower.json new file mode 100644 index 0000000..85601b6 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/lib/mermaid/bower.json @@ -0,0 +1,28 @@ +{ + "name": "mermaid", + "authors": [ + "knsv " + ], + "description": "Markdownish syntax for generating flowcharts, sequence diagrams and gantt charts.", + "main": "dist/mermaid.slim.js", + "keywords": [ + "diagram", + "markdown", + "flowchart", + "sequence diagram", + "gantt" + ], + "license": "MIT", + "ignore": [ + "*", + "!dist/", + "!dist/*", + "!LICENSE" + ], + "devDependencies": { + "jasmine": "~2.0.4", + "dagre": "0.6.2", + "d3": "3.3.8", + "dagre-d3": "0.3.3" + } +} diff --git a/nb-mermaid/static/nb-mermaid/nb-mermaid.css b/nb-mermaid/static/nb-mermaid/nb-mermaid.css new file mode 100644 index 0000000..ba60278 --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/nb-mermaid.css @@ -0,0 +1,4 @@ +.mermaid { + width: auto; + text-align: center; +} diff --git a/nb-mermaid/static/nb-mermaid/nb-mermaid.js b/nb-mermaid/static/nb-mermaid/nb-mermaid.js new file mode 100644 index 0000000..abb640e --- /dev/null +++ b/nb-mermaid/static/nb-mermaid/nb-mermaid.js @@ -0,0 +1,66 @@ +// Generated by CoffeeScript 1.9.3 +(function() { + var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + + define(["module"], function(module) { + var NotebookMermaid, _dot, d3, init, mermaid; + _dot = module.uri.replace(/\/[^\/]*$/, ""); + mermaid = d3 = null; + NotebookMermaid = (function() { + function NotebookMermaid() { + this.initNotebook = bind(this.initNotebook, this); + this.initDeps = bind(this.initDeps, this); + require([this.toUrl(this.mmp("mermaid.min.js"))], this.initDeps); + } + + NotebookMermaid.prototype.toUrl = function(url) { + return _dot + "/" + url; + }; + + NotebookMermaid.prototype.mmp = function(f) { + return "lib/mermaid/dist/" + f; + }; + + NotebookMermaid.prototype.initDeps = function(_m) { + mermaid = _m; + d3 = window.d3; + this.initCSS(); + return this.initEnv(); + }; + + NotebookMermaid.prototype.initCSS = function() { + return d3.select("head").selectAll("link.mermaid_style").data(["./nb-mermaid.css"]).enter().append("link").attr({ + rel: "stylesheet", + href: this.toUrl + }); + }; + + NotebookMermaid.prototype.initEnv = function() { + return require(["base/js/events"], this.initNotebook, this.initStatic); + }; + + NotebookMermaid.prototype.initStatic = function() { + return mermaid.init(); + }; + + NotebookMermaid.prototype.initNotebook = function(events) { + this.initStatic(); + return events.on("rendered.MarkdownCell", this.markdownRendered); + }; + + NotebookMermaid.prototype.markdownRendered = function(evt, arg) { + var cell; + cell = arg.cell; + return mermaid.init(void 0, cell.element.find(".mermaid")); + }; + + return NotebookMermaid; + + })(); + init = function() { + return new NotebookMermaid; + }; + return init.load_ipython_extension = init; + }); + +}).call(this);