I am using asciidoctorj 1.5.4, asciidoctorj-pdf 1.5.0-alpha.11 and asciidoclet 1.5.4 in a maven project. I have defined some custom BlockProcessors and registered them using the javaExtensionRegistry and created the proper files in my META-INF/services folder.
Generating the PDF works flawlessly, and my custom BlockProcessors are recognized and rendered as they should be. In the Javadoc however, the custom BlockProcessors are not rendered at all, and asciidoctor reports the many warnings about the BlockProcessors not being recognized:
asciidoctor: WARNING: <stdin>: line 7: invalid style for paragraph: eks
If I throw a RuntimeException in the register method of my class that implements ExtensionRegistry, I can see that generating a PDF will throw the exception, but generating the Javadoc does not. It would seem that that extensions are not being loaded by AsciidoctorJ when generating the Javadoc.
Here is one of my BlockProcessors:
public class EksBlock extends BlockProcessor {
public EksBlock(String name, Map<String, Object> config) {
super(name, config);
}
@Override
public Object process(AbstractBlock parent, Reader reader, Map<String, Object> attributes) {
// attributes that a normal admonition would accept
attributes.put("name", "EKS");
attributes.put("caption", "EKS.");
// just pass along the text
String admonitionText = reader.read();
return createBlock(parent, "admonition", admonitionText, attributes, new HashMap<Object, Object>());
}
}
My ExtensionRegistry implementation:
public class BlockExtensionRegistry implements ExtensionRegistry {
public void register(Asciidoctor asciidoctor) {
Map<String, Object> config = new HashMap<String, Object>();
config.put("contexts", Arrays.asList(":paragraph"));
config.put("content_model", ":compound");
EksBlock eksBlock = new EksBlock("eks", config);
}
}
I am using asciidoctorj 1.5.4, asciidoctorj-pdf 1.5.0-alpha.11 and asciidoclet 1.5.4 in a maven project. I have defined some custom
BlockProcessor
s and registered them using the javaExtensionRegistry and created the proper files in my META-INF/services folder.Generating the PDF works flawlessly, and my custom
BlockProcessor
s are recognized and rendered as they should be. In the Javadoc however, the customBlockProcessor
s are not rendered at all, and asciidoctor reports the many warnings about theBlockProcessor
s not being recognized:If I throw a RuntimeException in the
register
method of my class that implements ExtensionRegistry, I can see that generating a PDF will throw the exception, but generating the Javadoc does not. It would seem that that extensions are not being loaded by AsciidoctorJ when generating the Javadoc.Here is one of my
BlockProcessor
s:My ExtensionRegistry implementation:
I also have the following file:
File content:
Snippet from pom.xml
Am I missing some configuration in my
pom.xml
that will allow Asciidoclet to register the extensions, or is this an issue with Asciidoclet?