Login  Register

Re: skipping reference to missing attribute

Posted by David Jencks on Feb 27, 2020; 7:14pm
URL: https://discuss.asciidoctor.org/skipping-reference-to-missing-attribute-tp7687p7692.html

I think the point is that he wants ${foo} to be the shell literal, not a (missing) asciidoc attribute reference.  So escaping the ${ as $\{ prevents asciidoc from interpreting the { in ${ as the start of an attribute.

David Jencks

On Feb 27, 2020, at 10:19 AM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:

The warning is controlled by the attribute-missing attribute. By default, the value is "skip", which produces no warning for a missing attribute (and leaves it as typed). To get a warning, you must set attribute-missing to "warn". So check your settings to see what value is being used and adjust accordingly.


Best,

-Dan

On Thu, Feb 27, 2020 at 2:54 AM halol [via Asciidoctor :: Discussion] <<a href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7691&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
Hello,

Is there a way to process a document such as the one below, without getting a warning?

The difficulty here is to mix shell variables (using the ${var} notation is a requirement) with asciidoctor attributes in the same block. The final output is fine, but I am getting a lot of warnings and sorting out which ones matter (actually missing asciidoctor attributes) and which one don't (shell variables) is not always easy.

# Test

:attribute-missing: warn

:ADOC_ATTR:      asciidoctor

[subs="attributes"]
----
SHELL_VAR="shell"

echo {ADOC_ATTR} ${SHELL_VAR}
----

In this case, the output is:
asciidoctor: WARNING: skipping reference to missing attribute: shell_var

Thanks.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/skipping-reference-to-missing-attribute-tp7687.html
To start a new topic under Asciidoctor :: Discussion, email <a href="x-msg://41/user/SendEmail.jtp?type=node&amp;node=7691&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


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



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/skipping-reference-to-missing-attribute-tp7687p7691.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML