Skip to content

Commit

Permalink
Collect includes/allow lowercase files (#1083)
Browse files Browse the repository at this point in the history
* fix typo defailt --> default
* update prefixRegEx for collectIncludes.gradle
* update changelog.adoc
* update 30_community.adoc
  • Loading branch information
PacoVK committed Mar 15, 2023
1 parent d50b80c commit c34f2da
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ collectIncludes.with {

// separatorChar = "_" // define the allowed separators after prefix. default: "-_"

// cleanOutputFolder = true // should the output folder be emptied before generation? defailt: false
// cleanOutputFolder = true // should the output folder be emptied before generation? default: false
}
//end::collectIncludesConfig[]

Expand All @@ -360,7 +360,7 @@ structurizr.with {
// path = 'src/docs/structurizr'

// By default `exportStructurizr` looks for a file '${structurizr.workspace.path}/workspace.dsl'
// You can customize this behavior with 'filename'. Note that the workspace filename is provided without '.dsl' extension.
// You can customize this behavior with 'filename'. Note that the workspace filename is provided without '.dsl' extension.
// filename = 'workspace'
}

Expand All @@ -373,7 +373,7 @@ structurizr.with {

// Format of the exported diagrams. Defaults to 'plantuml' if the parameter is not provided.
//
// Following formats are supported:
// Following formats are supported:
// - 'plantuml': the same as 'plantuml/structurizr'
// - 'plantuml/structurizr': exports views to PlantUML
// - 'plantuml/c4plantuml': exports views to PlantUML with https://github.com/plantuml-stdlib/C4-PlantUML
Expand Down
2 changes: 2 additions & 0 deletions changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project tries to adhere to https://semver.org/spec/v2.0.0.html[Semantic

* brushed up some hints when running `dtcw.ps1` and `dtcw`
* add environment variable `DTC_CONFIG_FILE` in `dtcw` and `dtcw.ps1` to specify a configuration file other than than `docToolchainConfig.groovy` in the project root folder.
* `collectIncludes`
** changed regexp to start with `^[A-Za-z]` as file name to allow lowercase filenames as well.

== 2.2.1 - 2023-03-05

Expand Down
4 changes: 2 additions & 2 deletions scripts/collectIncludes.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ task collectIncludes(
String maxPrefixLength = config.collectIncludes.maxPrefixLength?:""
String separatorChar = config.collectIncludes.separatorChar?:"-_"

String prefixRegEx = "[A-Z]{" + minPrefixLength + "," + maxPrefixLength + "}"
String prefixRegEx = "[A-Za-z]{" + minPrefixLength + "," + maxPrefixLength + "}"
String separatorCharRegEx = "[" + separatorChar + "]"
String fileFilterRegEx = "^" + prefixRegEx + separatorCharRegEx + ".*[.](" + fileFilter + ")\$"

Expand All @@ -61,7 +61,7 @@ task collectIncludes(
sourceFolder.traverse(type: FILES) { file ->
if (file.name ==~ fileFilterRegEx) {
String typeRegEx = "^(" + prefixRegEx + ")" + separatorCharRegEx + ".*\$"
def type = file.name.replaceAll(typeRegEx,'\$1')
def type = file.name.replaceAll(typeRegEx,'\$1').toUpperCase()
if (!collections[type]) {
collections[type] = []
}
Expand Down
2 changes: 1 addition & 1 deletion src/docs/015_tasks/03_task_collectIncludes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ In order to include these files in your documentation, you have to add the file

This task will handle it for you!

Just stick to this file-naming pattern `^[A-Z]{3,}[-\_].\*` (begin with at least three uppercase letters and a dash/underscore) and this task will collect the file and write it to your build folder.
Just stick to this file-naming pattern `^[A-Za-z]{3,}[-\_].\*` (begin with at least three letters and a dash/underscore) and this task will collect the file and write it to your build folder.
You only have to include this generated file from within your documentation.
If you provide templates for the documents, those templates are skipped if the name matches the pattern `^.\*[-\_][tT]emplate
[-\_].*`.
Expand Down
1 change: 1 addition & 0 deletions src/docs/10_about/30_community.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ Please get in touch to update your entry or let us know if you have contributed
- https://github.com/beji[Björn Erlwein]
- https://github.com/camminati[Tulio Camminati]
- https://github.com/RoettingerJ[Joachim Röttinger]
- https://github.com/PacoVK[Pascal Euhus]

image::https://img.shields.io/github/contributors/doctoolchain/doctoolchain.svg[link=https://github.com/docToolchain/docToolchain/graphs/contributors]
6 changes: 3 additions & 3 deletions template_config/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ collectIncludes.with {

separatorChar = "_" // define the allowed separators after prefix. default: "-_"

cleanOutputFolder = true // should the output folder be emptied before generation? defailt: false
cleanOutputFolder = true // should the output folder be emptied before generation? default: false
}
//end::collectIncludesConfig[]

Expand All @@ -480,7 +480,7 @@ structurizr.with {
// path = 'src/docs/structurizr'

// By default `exportStructurizr` looks for a file '${structurizr.workspace.path}/workspace.dsl'.
// You can customize this behavior with 'filename'. Note that the workspace filename is provided without '.dsl' extension.
// You can customize this behavior with 'filename'. Note that the workspace filename is provided without '.dsl' extension.
// filename = 'workspace'
}

Expand All @@ -493,7 +493,7 @@ structurizr.with {

// Format of the exported diagrams. Defaults to 'plantuml' if the parameter is not provided.
//
// Following formats are supported:
// Following formats are supported:
// - 'plantuml': the same as 'plantuml/structurizr'
// - 'plantuml/structurizr': exports views to PlantUML
// - 'plantuml/c4plantuml': exports views to PlantUML with https://github.com/plantuml-stdlib/C4-PlantUML
Expand Down

0 comments on commit c34f2da

Please sign in to comment.