Login  Register

Re: skipping reference to missing attribute

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

This works for me:

:attribute: attr

[source,shell,subs=attributes]
----
ATTR=asciidoctor

echo {attribute} $\{ATTR}
----

David Jencks

> On Feb 27, 2020, at 1:54 AM, halol [via Asciidoctor :: Discussion] <[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 [hidden email]
> To unsubscribe from Asciidoctor :: Discussion, click here.
> NAML