Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support warn for <attributeMissing> #417

Closed
wilkinsona opened this issue Sep 6, 2019 · 4 comments
Closed

Support warn for <attributeMissing> #417

wilkinsona opened this issue Sep 6, 2019 · 4 comments
Milestone

Comments

@wilkinsona
Copy link

The Asciidoctor user manual recommends that warn is used for attribute-missing:

leaves the reference intact, but also prints a warning about the missing attribute (recommended)

It doesn't appear to be possible to use it via the Maven plugin with skip, drop, or drop-line being the only supported values:

warn is not valid. Must be one of 'skip', 'drop' or 'drop-line'

if ("skip".equals(attributeMissing) || "drop".equals(attributeMissing) || "drop-line".equals(attributeMissing)) {
attributesBuilder.attributeMissing(attributeMissing);
} else {
throw new MojoExecutionException(attributeMissing + " is not valid. Must be one of 'skip', 'drop' or 'drop-line'");
}

Could support for warn please be added?

@wilkinsona
Copy link
Author

As a workaround, it can be set via <attributes> instead:

<attributes>
	<attribute-missing>warn</attribute-missing>
</attributes>

@abelsromero
Copy link
Member

I did not see that when reviewing changes for 2.0.0, and I am more in favor of using the attributes. How would you feel if we removed attributeMissing and attributeUndefined from ?

@wilkinsona
Copy link
Author

That sounds good to me. I wasn't sure if <attributeMissing> would override whatever I'd configured in <attributes> so I was pleasantly surprised that the workaround was possible. Having only one way to configure it sounds good to me.

@abelsromero abelsromero added this to the 2.0.0 milestone Sep 6, 2019
@abelsromero
Copy link
Member

This configurations are legacies from early stages of the plugin in which we offered many attributes as configurations before fully supporting all <attributes>.

I wasn't sure if <attributeMissing> would override whatever I'd configured in <attributes>

Attributes are applied after configurations, so they override any configuration.

abelsromero added a commit to abelsromero/asciidoctor-maven-plugin that referenced this issue Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants