Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart start throws "unresolved dependency" error #15

Open
gtoast opened this issue Jan 28, 2018 · 1 comment
Open

Quickstart start throws "unresolved dependency" error #15

gtoast opened this issue Jan 28, 2018 · 1 comment

Comments

@gtoast
Copy link

gtoast commented Jan 28, 2018

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
''', [:])
@robertpanzer
Copy link
Member

Thank you for finding this!
Would you like to submit a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants