asciidoctor / atom-asciidoc-preview

⚛ AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
142 stars 42 forks source link

Allow loading asciidoctorjs extensions #127

Open stasberkov opened 8 years ago

stasberkov commented 8 years ago

asciidoctor.js has numerous extensions. Allow loading them in preview as well (e.g. setting extensions via package settings).

ggrossetie commented 8 years ago

@ldez Once Opal is loaded an extension is just a JavaScript file to include. Do you know if it's possible to load JavaScript files from the package settings ?

ldez commented 8 years ago

@Mogztter it's possible to load script on demand but I don't know if we can execute external scripts. Possible security issues but we can use a dedicated package.

If you can provide an example I can try quickly.

ggrossetie commented 8 years ago

@ldez you can try to execute the emoji extension: https://github.com/asciidoctor/asciidoctor-chrome-extension/blob/master/app/js/vendor/asciidoctor-emoji-inline-macro.js

You will also need this stylesheet: https://github.com/asciidoctor/asciidoctor-chrome-extension/blob/master/app/css/twemoji-awesome.css

In your document add emoji:heart[lg]