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

could you explain the build script snippet #51

Open
oneslideicywater opened this issue Dec 27, 2019 · 1 comment
Open

could you explain the build script snippet #51

oneslideicywater opened this issue Dec 27, 2019 · 1 comment

Comments

@oneslideicywater
Copy link

// what's this asciidoctj for?
asciidoctorj {
    version = '1.5.5'
}

asciidoctor {
// there seem to be a syntax error in ItelliJ idea,what's "\" is for?
// but weird it works. are the lines below "\" is a Map? 
    attributes \
        'build-gradle': file('build.gradle'),
        'sourcedir': project.sourceSets.main.java.srcDirs[0],
        'endpoint-url': 'http://example.org',
        'source-highlighter': 'coderay',
        'imagesdir': './images',
        //'toc': 'left',
        'icons': 'font',
        'setanchors': '',
        'idprefix': '',
        'idseparator': '-'
        //'docinfo1': ''
}

I also refer to Ascidoc plugin which is quite different from the syntax in your build script!

@ggrossetie
Copy link
Member

Hello @oneslideicywater

// what's this asciidoctorj for?

asciidoctorj is the processor, see https://github.com/asciidoctor/asciidoctorj
The block defines the version we want to use but it's optional (ie. when you apply the plugin it comes with a default version).

there seem to be a syntax error in IntelliJ idea,what's "" is for? but weird it works. are the lines below "" is a Map?

IntelliJ does like the \ but it's still a valid Gradle file. I believe the backslash is to use a nice indentation but you can remove it and use:

asciidoctor {
    attributes 'build-gradle': file('build.gradle'),
        'sourcedir': project.sourceSets.main.java.srcDirs[0],
        'endpoint-url': 'http://example.org',
        'source-highlighter': 'coderay'
        // ...
}

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