Closed weitanism closed 3 years ago
Hi, this looks great and thanks for the PR!
The intention of this Pastebin impl is to keep things as simple as possible. I imagine mermaid js is not going to be used by the majority, so I would rather gate the feature.
What I propose is to pluginify the current code, to accommodate custom plugins such as mermaid.js.
@Chrisyunhua I'll refactor code a bit and I'll get back to you
Sorry for the late replay.
To accommodate custom plugins(only frontend related), how about adding a parameter --plugins
to the entrypoint which accepts a list of js url and render them as <script>
in the index.html
, then we could run the app with:
pastebin --plugins https://url/to/plugin.js
@Chrisyunhua I did a small refactoring to accommodate plugins such as mermaid.js, please see: https://github.com/mkaczanowski/pastebin/commit/a8e8476c9c25575d5f8a29431bff3d4d5459ac0c
Now you can pass:
--plugins prism mermaid
and that should work :)
THX, I've tried the latest docker image, it looks really cool!
Add support for mermaid in the markdown format
here is an example: https://paste.chrisyunhua.com/BSgcltfX2I5XkwGi2iuss