Skip to content

Commit

Permalink
Added href
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr.suwala committed Apr 17, 2024
1 parent a9716b1 commit 3d2a997
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/kotlin/sh/hsp/techtree/TreeModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ data class TreeModel(
@JsonIgnoreProperties(ignoreUnknown = true)
data class TreeNode(
val title: ID,
val requires: List<ID>? = null
val requires: List<ID>? = null,
val link: String?
)
2 changes: 1 addition & 1 deletion src/main/kotlin/sh/hsp/techtree/graphviz/DSLConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DSLConverter {
val pathsToChildren = node.requires.stream()
.map { "${node.title.escaped()} -> ${it.escaped()}" }
.collect(Collectors.joining(" "))
return "${node.title.escaped()} $pathsToChildren"
return "${node.title.escaped()} ${node.link?.let { "[ href=\"$it\" fontcolor=blue]" } ?: ""} $pathsToChildren"
}

return node.title.escaped()
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/full-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ nodes:
- Kubernetes
- title: Syncronium
state: broken
link: http://example.com
link: http://hsp.sh
docs: https://github.com/hspsh/syncronium
requires:
- FluxCD
- FluxCD

0 comments on commit 3d2a997

Please sign in to comment.