docToolchain / docToolchain/docToolchain
copyImages
- Dominant language
- Groovy
- Stars
- 864
- Forks
- 240
- Avg merge
- 2m
- Merged PRs (30d)
- 2
Description
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
Contributor guide
Research direction
Start in scripts/AsciiDocBasics.gradle around line 193 and inspect how config.imageDirs is currently copied into /images. Read the linked Gradle file-handling documentation for include and exclude patterns. Done means the existing string syntax still works and the proposed map syntax supports its directory, includes, and exclude values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- build-system, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100