asciidoctor / asciidoctor-ant

:ant: Ant task to render Asciidoc documentation
Apache License 2.0
9 stars 5 forks source link

Allow generic extensions #70

Open rockyallen opened 6 years ago

rockyallen commented 6 years ago

Use case: I want to use this to add multiple extensions that may be of different types, and that work together at the instance level, and to use Ant to configure them.

Could this be added to asciidoctor-ant?

Something like:

GenericExtension.java:

GenericExtension { public registerExtensions(javaExtensionRegistry); }

AsciidoctorAntTask.java:

List<GenericExtension> GenericExtensions;
addConfigured (GenericExtension es) { GenericExtensions.add(es); }

execute() { for GenericExtension ge: GenericExtensions} {
  ge.registerExtensions(javaExtensionRegistry); 
...

Which would let me write: build.xml:

<asciidoctor:convert>
....
<referencesextension database="" style="ieee"/>
</asciidoctor:convert>

ReferencesExtension.java:

ReferencesExtension extends GenericExtension { 
public void setDatabase() {}
public registerExtensions(javaExtensionRegistry) {}
...