{"_id":"@aolney/metadata-html-extension","_rev":"1-c767225d4ea26f1b4095dc8da0f44f45","name":"@aolney/metadata-html-extension","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aolney/metadata-html-extension","version":"0.1.0","description":"An JupyterLab extension with Fable tooling that uses cell metadata to define html that should be injected into markdown cells.","keywords":["jupyter","jupyterlab","jupyterlab-extension","metadata","html"],"homepage":"https://github.com/aolney/metadata-html-extension","bugs":{"url":"https://github.com/aolney/metadata-html-extension/issues"},"license":"Apache-2.0","author":{"name":"Andrew M. Olney"},"main":"lib/index.js","style":"style/index.css","repository":{"type":"git","url":"git+https://github.com/aolney/metadata-html-extension.git"},"scripts":{"build":"fable-splitter src -o lib","watch":"fable-splitter src -o lib -w"},"dependencies":{"@babel/runtime-corejs2":"^7.0.0","@jupyterlab/application":"^1.0.0","@jupyterlab/apputils":"^1.2.1","@jupyterlab/notebook":"^1.2.2","@phosphor/coreutils":"^1.3.1","@phosphor/widgets":"^1.9.3"},"devDependencies":{"@babel/core":"^7.3.4","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","babel-loader":"^8.0.6","copy-webpack-plugin":"^6.0.3","core-js":"^3.0.0","css-loader":"^2.1.1","fable-compiler":"^2.1.12","fable-loader":"^2.1.9","fable-splitter":"^2.2.1","file-loader":"^4.0.0","gh-pages":"^2.0.1","html-webpack-plugin":"^3.2.0","isomorphic-fetch":"^3.0.0","jsdom":"^15.1.0","jsdom-global":"^3.0.2","loglevel":"^1.5.0","mini-css-extract-plugin":"^0.5.0","raf-stub":"^2.0.2","remotedev":"^0.2.9","resolve-url-loader":"^3.1.2","rimraf":"^2.6.1","style-loader":"^0.18.2","typescript":"~3.5.2","webpack":"^4.29.3","webpack-cli":"^3.2.3","webpack-dev-server":"^3.11.0"},"sideEffects":["style/*.css"],"jupyterlab":{"extension":true},"gitHead":"932861e27243dfaa66ff492506c1eb9e642a4c20","_id":"@aolney/metadata-html-extension@0.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-L9kTU6G3NDnLPxGKR/EAo9AOO8R/GW3eWHe6Felco2hi8cddus7AQEY+8ZMJGH3yBEsILg15d9NspvjbKPPOlg==","shasum":"4f9b027acf6616d4cf01f3c672ff685b9e0242c9","tarball":"https://registry.npmjs.org/@aolney/metadata-html-extension/-/metadata-html-extension-0.1.0.tgz","fileCount":6,"unpackedSize":36317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfpXplCRA9TVsSAnZWagAAiqoP/jLPpPIbHqOeOzmCCxwc\nVNbPB55H7c/MglJUK2ITFYfBGP2XqAkfr53BNMn9K1mQwiHbVNx86w1V8MEj\nhBQmbwp99loUmFmpgiyBv8UDDckMXPxSkBZ0T6OAKymTg4NRjGwN4MOO9X7y\nFAfMq+BDjezEvHYBSuFbDZ+waIbaSQ/0Vx72+QX8uL4S7DfrASEGzqZLZnfF\nnou5e78ZDPYk2XuBPRk3et9nXt5qwtroBQLO7v+Oe0fbav+AZFehadMEjYCC\njtJcCJ64VjN6LMWgFLM1AnpCDBLbSQ0g9yW4GnB0zrcMdRRt+wj8Sfk1cnZr\ndTVamO6dehsvdHLIhp8SnF0cdYHrva8tKBgYisPwdd/CE4Jk3GhVdJ3gskXz\nQOaoxcD13rmjg/VtD8PcDKGdsqFkjVYB6Mpb/AyB5PET5PhA44Ro2+pc//iz\nOyPNO6YjqjtgYOA+1ihHaxP4NZNiJhFQP9C1ggBIhKHKdaST5e1Mn1e/QVxx\nyAx7IRgsYCQCsEJPoUZbNkqGLTJ25pluvvx0P4tuj9V1W6d++bdoa8XGx/Di\nEo9Mrlq7s0ga51iHa257D+EyXFpQ2rljetO6yxX0LaPUDXRjmS5GEtHKXrYh\nzA5e7I7wWS/UOSpwDO22aNVETOkpRYZvMGs5DbQ92YH0Eq1rnCBoJccl6wFk\nCeTV\r\n=A6li\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/PrC/dISUP6F1QFR4thHQedUzAYlNHx2EjcpBIdTq3AiAIZsASHqXGarFhspFHWrvaiD0oQB1tYB9LwbzNM8jHbA=="}]},"_npmUser":{"name":"aolney","email":"aolney@memphis.edu"},"directories":{},"maintainers":[{"name":"aolney","email":"aolney@memphis.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/metadata-html-extension_0.1.0_1604680293023_0.2716870795776829"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-06T16:31:32.982Z","0.1.0":"2020-11-06T16:31:33.173Z","modified":"2022-04-04T14:29:04.106Z"},"maintainers":[{"name":"aolney","email":"aolney@memphis.edu"}],"description":"An JupyterLab extension with Fable tooling that uses cell metadata to define html that should be injected into markdown cells.","homepage":"https://github.com/aolney/metadata-html-extension","keywords":["jupyter","jupyterlab","jupyterlab-extension","metadata","html"],"repository":{"type":"git","url":"git+https://github.com/aolney/metadata-html-extension.git"},"author":{"name":"Andrew M. Olney"},"bugs":{"url":"https://github.com/aolney/metadata-html-extension/issues"},"license":"Apache-2.0","readme":"# metadata-html-extension\n\nA [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) extension with [Fable](https://fable.io/) tooling that uses cell metadata to define html that should be injected into markdown cells.\n\nThis approach overcomes the limitations of JupyterLab markdown cells for certain types of html, such as iframes, that appear to be stripped/sanitized based on the JupyterLab security model.\n\nUsing this extension therefore increases the likelihood that an attacker may use a notebook to execute arbitrary code on your computer.\n\nThis extension is meant for research purposes only and is not meant for general usage. \n\nObviously, notebooks with html in the metadata will not render properly without this extension. \n\nExample metadata:\n\n```javascript\n{\n    \"html\": \"<iframe class='metadata-html' width='560' height='315' src='https://www.youtube.com/embed/nBrKsT1IvIM' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe>\"\n}\n```\n\n`class='metadata-html'` will prevent duplicate html injection if switching between notebooks.\n\n**NOTE: This plugin requires jupyterlab <= 1.2.6, so if you have a higher version (e.g. 2.X) you will need to execute `conda install jupyterlab=1.2.6` or similar for `pip`**\n\n\n## Installation\n\n```bash\njupyter labextension install @aolney/metadata-html-extension\n```\n\n## Updating to latest version\n\n```bash\njupyter labextension update @aolney/metadata-html-extension\n```\n\n## Development\n\nThis is based on my personal preferences. For more options, [see the extension development guide](https://jupyterlab.readthedocs.io/en/stable/developer/extension_dev.html#developer-extensions).\n\n### Prerequisites\n\n* [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html)\n* [Fable](https://fable.io/)\n* An F# editor like Visual Studio Code with [Ionide](http://ionide.io/) \n* Chrome\n\n### Initial install and after library adds\n\n```bash\nnpm install\nmono .paket/paket.exe install\nnpm run build\n```\n\n### Terminal A in VSCode\n\n```bash\njupyter labextension install . --no-build\nnpm run watch\n```\n\nThis will watch your F# code and trigger builds of `index.js`.\n\nIf you prefer not to trigger builds using a watch, you can `npm run build` every time you want a new build.\n\n### Terminal B in VSCode\n\n```bash\njupyter lab --watch\n```\n\nThis will watch your extension and trigger builds of it.\n\nEven with this watch, you still need to refresh your browser during development.\n\n## Project structure\n\n### npm/yarn\n\nJS dependencies are declared in `package.json`, while `package-lock.json` is a lock file automatically generated.\n\n### paket\n\n[Paket](https://fsprojects.github.io/Paket/) \n\n> Paket is a dependency manager for .NET and mono projects, which is designed to work well with NuGet packages and also enables referencing files directly from Git repositories or any HTTP resource. It enables precise and predictable control over what packages the projects within your application reference.\n\n.NET dependencies are declared in `paket.dependencies`. The `src/paket.references` lists the libraries actually used in the project. Since you can have several F# projects, we could have different custom `.paket` files for each project.\n\nLast but not least, in the `.fsproj` file you can find a new node: `\t<Import Project=\"..\\.paket\\Paket.Restore.targets\" />` which just tells the compiler to look for the referenced libraries information from the `.paket/Paket.Restore.targets` file.\n\n### Fable-splitter\n\n[Fable-splitter]() is a standalone tool which outputs separated files instead of a single bundle. Here all the js files are put into the `lib`. And the main entry point is our `index.js` file.\n\n### Imports\n\nBecause Jupyter uses Typescript, we can use [ts2fable](https://github.com/fable-compiler/ts2fable) to generate strongly typed imports of Jupyter's JS packages. Unfortunately these are a bit huge and the conversion is messy. \nI might release them as a nuget package once they are cleaned up.\n`ts2fable-raw-output` has the initial conversion which is cleaned up enough to compile i nthe `src` directory. \n\n\n\n","readmeFilename":"README.md"}