docToolchain icon indicating copy to clipboard operation
docToolchain copied to clipboard

copyImages

Open rdmueller opened this issue 3 years ago • 0 comments

the default approach for handling images in docToolchain is, that you store images in the /images folder and reference them directly from this folder.

To support additional image folders, there is a mechanism which copies certain folders to the /images folder.

Now, there are use cases where this is not enough. So goal for this feature request is to support a configuration like this:

imageDirs = [
        "architecture",

        [dir: '.', includes: ['*.png','*.jpg','*.svg'] , exclude:'/images']

        /** imageDirs **/
]

where the old syntax still works, but the new one is also picked up.

Code could be something like this:

      config.imageDirs.each { imageDir ->
          if (imageDir instanceof String) {
              from(new File(file(srcDir),imageDir))
              logger.info ('imageDir: '+imageDir)
              into './images'
          } else {
// insert handling of new config, see
// https://docs.gradle.org/current/userguide/working_with_files.html
// for details
          }
      }

https://github.com/docToolchain/docToolchain/blob/ng/scripts/AsciiDocBasics.gradle#L193

rdmueller avatar Sep 16 '22 09:09 rdmueller