Skip to content

Quickstart start throws "unresolved dependency" error #15

@gtoast

Description

@gtoast

The version number declared in the Quickstart code isn't valid. Running it throws an error about asciidoctorj-groovy-dsl being an "unresolved dependency". Here's a corrected version of the code, using the latest version of the dsl:

@GrabConfig(systemClassLoader=true)
@Grab(group='org.asciidoctor', module='asciidoctorj-groovy-dsl', version='1.6.0-alpha.1')
import org.asciidoctor.groovydsl.AsciidoctorExtensions
import org.asciidoctor.Asciidoctor

AsciidoctorExtensions.extensions{
    block(name: 'BIG', contexts: [':paragraph']) {
        parent, reader, attributes ->
        def upperLines = reader.readLines()
        .collect {it.toUpperCase()}
        .inject('') {a, b -> a + '\n' + b}

        createBlock(parent, 'paragraph', [upperLines], attributes, [:])
    }
}
Asciidoctor.Factory.create().render('''
[BIG]
Hello World
''', [:])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions