org.asciidoctor.extension.JavaExtensionRegistry Java Examples

The following examples show how to use org.asciidoctor.extension.JavaExtensionRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AsciidocExtensionRegistry.java    From helidon-build-tools with Apache License 2.0 5 votes vote down vote up
@Override
public void register(Asciidoctor asciidoctor) {
    JavaConverterRegistry javaConverterRegistry =
            asciidoctor.javaConverterRegistry();
    javaConverterRegistry.register(AsciidocConverter.class, backendName);

    JavaExtensionRegistry javaExtensionRegistry = asciidoctor
            .javaExtensionRegistry();
    javaExtensionRegistry.block(new CardBlockProcessor());
    javaExtensionRegistry.block(new PillarsBlockProcessor());
    javaExtensionRegistry.preprocessor(new IncludePreprocessor());
}
 
Example #2
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(String inlineMacroProcessor) {
    try {
        Class<? extends InlineMacroProcessor> inlineMacroProcessorClass = (Class<? extends InlineMacroProcessor>) Class.forName(inlineMacroProcessor);
        inlineMacro(inlineMacroProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #3
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(String macroName, String inlineMacroProcessor) {
    try {
        Class<? extends InlineMacroProcessor> inlineMacroProcessorClass = (Class<? extends InlineMacroProcessor>) Class.forName(inlineMacroProcessor);
        inlineMacro(macroName, inlineMacroProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #4
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(Class<? extends InlineMacroProcessor> inlineMacroProcessor) {
    String name = getName(inlineMacroProcessor);
    RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
    getAsciidoctorModule().callMethod("inline_macro", rubyClass, rubyRuntime.newString(name));
    return this;
}
 
Example #5
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(String macroName,
                                         Class<? extends InlineMacroProcessor> inlineMacroProcessor) {
    RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
    getAsciidoctorModule().callMethod("inline_macro", rubyClass, rubyRuntime.newString(macroName));
    return this;
}
 
Example #6
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(String macroName,
                                         InlineMacroProcessor inlineMacroProcessor) {
    RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
    getAsciidoctorModule().callMethod("inline_macro", rubyClass, rubyRuntime.newString(macroName));
    return this;
}
 
Example #7
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(String blockMacroProcessor) {
    try {
        Class<? extends BlockMacroProcessor> blockMacroProcessorClass = (Class<? extends BlockMacroProcessor>) Class.forName(blockMacroProcessor);
        blockMacro(blockMacroProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #8
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(String blockName,
                                        String blockMacroProcessor) {
    try {
        Class<? extends BlockMacroProcessor> blockMacroProcessorClass = (Class<? extends BlockMacroProcessor>) Class.forName(blockMacroProcessor);
        blockMacro(blockName, blockMacroProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #9
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(Class<? extends BlockMacroProcessor> blockMacroProcessor) {
    String name = getName(blockMacroProcessor);
    RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
    getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(name));
    return this;
}
 
Example #10
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(String blockName,
                                        Class<? extends BlockMacroProcessor> blockMacroProcessor) {
    RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
    getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(blockName));
    return this;
}
 
Example #11
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry block(String blockName,
                                   BlockProcessor blockProcessor) {
    RubyClass rubyClass = BlockProcessorProxy.register(asciidoctor, blockProcessor);
    getAsciidoctorModule().callMethod("block_processor", rubyClass, rubyRuntime.newString(blockName));
    return this;
}
 
Example #12
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry block(String blockName,
                                   Class<? extends BlockProcessor> blockProcessor) {
    RubyClass rubyClass = BlockProcessorProxy.register(asciidoctor, blockProcessor);
    getAsciidoctorModule().callMethod("block_processor", rubyClass, rubyRuntime.newString(blockName));
    return this;
}
 
Example #13
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry block(String blockProcessor) {
    try {
        Class<? extends BlockProcessor> blockProcessorClass = (Class<? extends BlockProcessor>) Class.forName(blockProcessor);
        block(blockProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #14
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry block(String blockName,
                                   String blockProcessor) {
    try {
        Class<? extends BlockProcessor> blockProcessorClass = (Class<? extends BlockProcessor>) Class.forName(blockProcessor);
        block(blockName, blockProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #15
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry treeprocessor(String treeProcessor) {
    try {
        Class<? extends Treeprocessor> treeProcessorClass = (Class<? extends Treeprocessor>) Class.forName(treeProcessor);
        treeprocessor(treeProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #16
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 5 votes vote down vote up
@Override
public JavaExtensionRegistry docinfoProcessor(String docInfoProcessor) {
    try {
        Class<? extends DocinfoProcessor> docinfoProcessorClass = (Class<? extends DocinfoProcessor>) Class.forName(docInfoProcessor);
        docinfoProcessor(docinfoProcessorClass);
        return this;
    } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
    }
}
 
Example #17
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry block(Class<? extends BlockProcessor> blockProcessor) {
    String name = getName(blockProcessor);
    block(name, blockProcessor);
    return this;
}
 
Example #18
Source File: WhenLoadingExtensionFromUnusualPackage.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldAllowLoadingByClass() {
  final JavaExtensionRegistry registry = asciidoctor.javaExtensionRegistry();
  registry.postprocessor(BoldifyPostProcessor.class);
}
 
Example #19
Source File: WhenLoadingExtensionFromUnusualPackage.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldAllowLoadingByClassName() {
  final JavaExtensionRegistry registry = asciidoctor.javaExtensionRegistry();
  registry.postprocessor(BoldifyPostProcessor.class.getCanonicalName());
}
 
Example #20
Source File: WhenLoadingExtensionFromUnusualPackage.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldAllowLoadingUsingInstance() {
  final JavaExtensionRegistry registry = asciidoctor.javaExtensionRegistry();
  registry.postprocessor(new unusual.extension.BoldifyPostProcessor());
}
 
Example #21
Source File: ClasspathIncludeExtension.java    From jkube with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void register(Asciidoctor asciidoctor) {
    final JavaExtensionRegistry javaExtensionRegistry = asciidoctor.javaExtensionRegistry();
    javaExtensionRegistry.includeProcessor(new ClasspathIncludeProcessor());
}
 
Example #22
Source File: TerminalCommandExtension.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public void register(Asciidoctor asciidoctor) { // <2>
  JavaExtensionRegistry javaExtensionRegistry = asciidoctor.javaExtensionRegistry();
  javaExtensionRegistry.treeprocessor(TerminalCommandTreeprocessor.class); // <3>
}
 
Example #23
Source File: JRubyAsciidoctor.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry javaExtensionRegistry() {
    return new JavaExtensionRegistryImpl(this);
}
 
Example #24
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry inlineMacro(InlineMacroProcessor inlineMacroProcessor) {
    RubyClass rubyClass = InlineMacroProcessorProxy.register(asciidoctor, inlineMacroProcessor);
    getAsciidoctorModule().callMethod("inline_macro", rubyClass);
    return this;
}
 
Example #25
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry docinfoProcessor(Class<? extends DocinfoProcessor> docInfoProcessor) {
    RubyClass rubyClass = DocinfoProcessorProxy.register(asciidoctor, docInfoProcessor);
    getAsciidoctorModule().callMethod("docinfo_processor", rubyClass);
    return this;
}
 
Example #26
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(String macroName, BlockMacroProcessor blockMacroProcessor) {
    RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
    getAsciidoctorModule().callMethod("block_macro", rubyClass, rubyRuntime.newString(macroName));
    return this;
}
 
Example #27
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry blockMacro(BlockMacroProcessor blockMacroProcessor) {
    RubyClass rubyClass = BlockMacroProcessorProxy.register(asciidoctor, blockMacroProcessor);
    getAsciidoctorModule().callMethod("block_macro", rubyClass);
    return this;
}
 
Example #28
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry docinfoProcessor(DocinfoProcessor docInfoProcessor) {
    RubyClass rubyClass = DocinfoProcessorProxy.register(asciidoctor, docInfoProcessor);
    getAsciidoctorModule().callMethod("docinfo_processor", rubyClass);
    return this;
}
 
Example #29
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry treeprocessor(Class<? extends Treeprocessor> abstractTreeProcessor) {
    RubyClass rubyClass = TreeprocessorProxy.register(asciidoctor, abstractTreeProcessor);
    getAsciidoctorModule().callMethod("treeprocessor", rubyClass);
    return this;
}
 
Example #30
Source File: JavaExtensionRegistryImpl.java    From asciidoctorj with Apache License 2.0 4 votes vote down vote up
@Override
public JavaExtensionRegistry block(BlockProcessor blockProcessor) {
    RubyClass rubyClass = BlockProcessorProxy.register(asciidoctor, blockProcessor);
    getAsciidoctorModule().callMethod("block_processor", rubyClass);
    return this;
}