asciidoctor / asciidoclet

:clipboard: A Javadoc Doclet based on Asciidoctor that lets you write Javadoc in the AsciiDoc syntax.
https://github.com/asciidoctor/asciidoclet
Apache License 2.0
133 stars 40 forks source link

Align option names and syntax with asciidoctor command #32

Closed mojavelinux closed 10 years ago

mojavelinux commented 10 years ago

I'd like to align the option names that go in additionalparam with the asciidoctor command.

I'm proposing the following changes.

  1. Prefer double dash (--) instead of single dash (-) prefix for long option names
  2. Use names from the asciidoctor command when there's a matching option
  3. Use the same parsing logic for the attribute string (or allow attributes to be specified using multiple -a options)

The mapping would be as follows:

We want to reenforce knowledge of AsciiDoc option across the ecosystem.

mojavelinux commented 10 years ago

Here's the logic that should be used for parsing the attribute string:

https://github.com/asciidoctor/asciidoctor-gradle-plugin/blob/master/src/main/groovy/org/asciidoctor/gradle/AsciidoctorTask.groovy#L278

mojavelinux commented 10 years ago

Eventually, I want to make attribute parsing a public API in AsciidoctorJ (and subsequently, Asciidoctor).

mojavelinux commented 10 years ago

I also like processorArgs or argLine instead of additionalparam for the name of the configuration property.

mojavelinux commented 10 years ago

I'm okay with additionalProcessorArgs too.

mojavelinux commented 10 years ago

On further thought, perhaps it's better for the attributes to support a collection called attributes to be consistent with the Maven plugin. See this example: https://github.com/mojavelinux/asciidoctor-maven-plugin-example/blob/master/pom.xml#L111

mojavelinux commented 10 years ago

In general, I think we should try to align with the Maven plugin where possible since, again, it reenforces knowledge. There's a very good chance users will be configuring both plugins in the same project.

mojavelinux commented 10 years ago

Where alignment is not possible due to restrictions in how the tool is configured, I understand.

mojavelinux commented 10 years ago

I now see that Doclet uses the convention of single hyphen prefixes (order me a beer and I could do a rant about engineers at a Unix company not following the posix conventions...argh).

I think for options that clearly map to Asciidoctor options, we should use the double hyphen. However, I realize that we might not be able to do anything about the -d flag. Water over the damn.

johncarl81 commented 10 years ago

+1 for consolidating/defining parameters and their appropriate argument names in a common library like Asciidoctorj.