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

Support generation of asciidoctorconfig files #543

Closed
ysb33r opened this issue Mar 30, 2020 · 4 comments
Closed

Support generation of asciidoctorconfig files #543

ysb33r opened this issue Mar 30, 2020 · 4 comments
Labels
3.x Issues related to the 3.x enhancement
Milestone

Comments

@ysb33r
Copy link
Member

ysb33r commented Mar 30, 2020

I would like to add an additional plugin which can generate .asciidoctorconfig files, which in turn is used by IntelliJ. The plugin itself will not be dependent on asciidoctorj or asciidoctor.js.

When applied the plugin will create a task called asciidoctorEditorConfig. It will be configurable as follows:

asciidoctorEditorConfig {
  // Specify attribute substitution as a map
  // Attributes from this map will be added first into the generated file.
   attributes gradleVersion : gradle.gradleVersion,
            revnumber: version,
            topdir  : rootDir.absolutePath

    // Read additional attributes from a file (will not be substituted, simply appended)
    additionalAttributes  'src/docs/asciidoc/attributes.adoc'

    // If an existing project or task extension is supplied attributes will be read from there as well
    additionalAttributes asciidoctorj

    // Set the destination directory - will default to the root of the project.
    destinationDir = projectDir
}

It will also inject a dependency on the idea plugin, such that when an an import into IntelliJ is applied, it will also run this task.

It will be the responsibility of the project owner to add this generated file to .gitignore.

See also: https://github.com/asciidoctor/asciidoctor-intellij-plugin

CC: @ahus1

@ysb33r ysb33r added enhancement 3.x Issues related to the 3.x labels Mar 30, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Mar 30, 2020
@ysb33r ysb33r added this to the 3.2.0 milestone Mar 30, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Mar 30, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Mar 31, 2020
@ahus1
Copy link

ahus1 commented Apr 10, 2020

Hi @ysb33r - I'm excited that you like this feature!

Originally this was intended to be committed to the source of the version control system. The way you describe it it will be useful to generate it using Gradle.

I assume that users will need to add the file to .gitignore, as it will be re-created by Gradle? Would it be cleaned by the clean target?

For everyone else reading this thread: you can find out more about .asciidoctorconfig in the wiki space of the AsciiDoc plugin for IntelliJ: https://github.com/asciidoctor/asciidoctor-intellij-plugin/wiki/Support-project-specific-configurations

@ysb33r
Copy link
Member Author

ysb33r commented Apr 10, 2020

I assume that users will need to add the file to .gitignore, as it will be re-created by Gradle?

Yes.

Would it be cleaned by the clean target?

I don't believe so, because it does not end up in the build directory. I have to check whether cleanAsciidoctorEditorConfig will delete it.

ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 11, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 11, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 11, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 11, 2020
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Apr 11, 2020
ysb33r added a commit that referenced this issue Apr 12, 2020
@ysb33r
Copy link
Member Author

ysb33r commented Apr 12, 2020

Will be in 3.2.0

@ysb33r ysb33r closed this as completed Apr 12, 2020
@ysb33r ysb33r mentioned this issue Apr 12, 2020
@ahus1
Copy link

ahus1 commented Apr 12, 2020

I've added a back-link to this feature to the plugin's wiki: https://github.com/asciidoctor/asciidoctor-intellij-plugin/wiki/Support-project-specific-configurations#ecosystem

Feel free to update it as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues related to the 3.x enhancement
Projects
None yet
Development

No branches or pull requests

2 participants