Closed jcayouette closed 5 years ago
Hello @jcayouette I believe your issue is related to the Asciidoctor browser extension ? If so could you please open your issue on https://github.com/asciidoctor/asciidoctor-browser-extension ? Thanks :smiley:
On top of that, environment variables are not accessible to the document.
Which env should I specify in the first ifndef to prevent loading of includes in asciidoctorjs within the browser?
I guess you could define an attribute in the browser extension:
@jcayouette Does it answer your question ? Can we close this issue ?
Closing, please join http://gitter.im/asciidoctor/asciidoctor.js if we didn't answer your question.
Hi, I don't want to necro bump this post but I have the exact same issue.
I need the {user-home}
environment variable in my asciidoc scripts, it works perfectly except when I render with Brave (close to Chromium). Tried to add environment variable in the asciidoctor.js as suggested but unsuccessful.
Any more ideas?
@yoarch Environment variables are not available in a browser environment. The value of the built-in attribute user-home
in a browser environment will be .
.
You will need to explicitly define the value using a custom attribute: my-user-home=/home/guillaume
Hi Guillaume, Thanks for the reply. Yes, indeed. It works. Thanks for your time.
@Mogztter It definitely seems like it should be possible to set user-home
manually using the options page. Do you see a problem with that idea?
@mojavelinux I don't recall, is it possible to override a built-in attribute? https://github.com/asciidoctor/asciidoctor/blob/4284a176fac29bdde62288f13e7ebb18defeb9aa/lib/asciidoctor/document.rb#L374
Oh, duh. You're right. Certain built-in attributes cannot be overridden even from the commandline. I think it should be possible to override user-home
because we cannot be sure the inherent value is correct. Let's take that up in core.
Follow-up issue: https://github.com/asciidoctor/asciidoctor/issues/3732
I am trying to setup specific rules for a github environment + asciidoctorjs plugin. When on github or when viewing adoc files on a local system using the asciidoctorjs browser extension I would like to prevent displaying includes and use cross references instead:
I have the following so far:
This works for github. But when I view the same file in a browser using the asciidoctorjs extension I get the following result:
Which env should I specify in the first ifndef to prevent loading of includes in asciidoctorjs within the browser?
Is this the correct way to go about this? Or could you suggest an alternative?
Best!