-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Structurizr DSL library introduced element/relationship identifiers as properties recently. Hide those for the site generation since we are not really interested in presenting them to users.
- Loading branch information
Showing
5 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
...n/kotlin/nl/avisi/structurizr/site/generatr/site/model/SoftwareSystemHomePageViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
package nl.avisi.structurizr.site.generatr.site.model | ||
|
||
import com.structurizr.model.SoftwareSystem | ||
import nl.avisi.structurizr.site.generatr.internalProperties | ||
import nl.avisi.structurizr.site.generatr.site.GeneratorContext | ||
|
||
class SoftwareSystemHomePageViewModel(generatorContext: GeneratorContext, softwareSystem: SoftwareSystem) : | ||
SoftwareSystemPageViewModel(generatorContext, softwareSystem, Tab.HOME) { | ||
val hasProperties = softwareSystem.properties.any() | ||
val propertiesTable = createPropertiesTableViewModel(softwareSystem.properties) | ||
val hasProperties = softwareSystem.sanitizedProperties().any() | ||
val propertiesTable = createPropertiesTableViewModel(softwareSystem.sanitizedProperties()) | ||
val content = markdownToHtml(this, softwareSystem.info(), generatorContext.svgFactory) | ||
|
||
private fun SoftwareSystem.info() = documentation.sections | ||
.minByOrNull { it.order } | ||
?.content | ||
?: "# Description${System.lineSeparator()}${description}" | ||
?: "# Description${System.lineSeparator()}$description" | ||
|
||
private fun SoftwareSystem.sanitizedProperties() = properties | ||
.filterNot { (name, _) -> internalProperties.contains(name) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters