Last active
May 17, 2019 10:22
-
-
Save oeway/75a446f52766b001160a182261a65afa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<docs lang="markdown"> | |
[TODO: write documentation for this plugin.] | |
</docs> | |
<config lang="json"> | |
{ | |
"name": "MarkdownDemo", | |
"type": "window", | |
"tags": [], | |
"ui": "", | |
"version": "0.1.0", | |
"cover": "", | |
"description": "[TODO: describe this plugin with one sentence.]", | |
"icon": "extension", | |
"inputs": null, | |
"outputs": null, | |
"api_version": "0.1.5", | |
"env": "", | |
"requirements": [ | |
"https://cdnjs.cloudflare.com/ajax/libs/marked/0.6.2/marked.js", | |
"https://static.imjoy.io/spectre.css/spectre.min.css", | |
"https://static.imjoy.io/spectre.css/spectre-exp.min.css", | |
"https://static.imjoy.io/spectre.css/spectre-icons.min.css"], | |
"dependencies": [], | |
"defaults": {"w": 20, "h": 10} | |
} | |
</config> | |
<attachment name="docs"> | |
# ANNA-PALM ImJoy plugin docmentation | |
you can use markdown here. and also insert buttons linked with api functions: <button class="btn" onclick="api.alert('showing alert with api.alert')">click me!</button> | |
</attachment> | |
<script lang="javascript"> | |
class ImJoyPlugin { | |
async setup() { | |
api.log('initialized') | |
} | |
async run(ctx) { | |
document.getElementById('content').innerHTML = | |
marked(await api.getAttachment('docs')); | |
} | |
} | |
api.export(new ImJoyPlugin()) | |
</script> | |
<window lang="html"> | |
<div id="content"> | |
</div> | |
</window> | |
<style lang="css"> | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment