Preprocessor/ifdef check for asciidoctor.js environment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Preprocessor/ifdef check for asciidoctor.js environment

puffybsd
Is the a way to check within a document if the runtime is asciidoctor.js?
Reply | Threaded
Open this post in threaded view
|

Re: Preprocessor/ifdef check for asciidoctor.js environment

mojavelinux
Administrator
That's a great question. Since Asciidoctor.js is actually a lot of different environments, we've decided to take a more specific approach. First, you can check for Asciidoctor.js in general by checking for the platform-opal attribute. To check if it's also running in the browser, you can check for env-browser.

At the moment, these attributes are set by the plugins that integrate Asciidoctor.js, though we should definitely consider promoting the general ones to the Asciidoctor.js build.

Since we use the term "platform" in Asciidoctor.js to distinguish the JavaScript runtime, I'm thinking perhaps we may want to rethink the name platform-opal and perhaps call it runtime-opal instead.

As another option, I think we should define the asciidoctorjs-version (or asciidoctor-js-version) attribute similar to how we define asciidoctor-version.

-Dan

On Sun, May 14, 2017 at 11:44 AM, puffybsd [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is the a way to check within a document if the runtime is asciidoctor.js?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Preprocessor-ifdef-check-for-asciidoctor-js-environment-tp5594.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Preprocessor/ifdef check for asciidoctor.js environment

mojavelinux
Administrator
In reply to this post by puffybsd

On Sun, May 14, 2017 at 3:17 PM, Dan Allen <[hidden email]> wrote:
perhaps call it runtime-opal instead

or maybe even interpreter-opal


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux