Skip to content

Commit 1ef1ba0

Browse files
authored
Merge pull request #656 from jenspav/adr-links
Suffix ADR links with slash
2 parents 50489fe + e5867dd commit 1ef1ba0

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# 2. Implement Feature 1
2+
3+
Date: 2024-12-17
4+
5+
## Status
6+
7+
Superseded by [3. Another Realisation of Feature 1](0003-another-realisation-of-feature-1.md)
8+
9+
## Context
10+
11+
The issue motivating this decision, and any context that influences or constrains the decision.
12+
13+
## Decision
14+
15+
The change that we're proposing or have agreed to implement.
16+
17+
## Consequences
18+
19+
What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# 3. Another Realisation of Feature 1
2+
3+
Date: 2024-12-17
4+
5+
## Status
6+
7+
Accepted
8+
9+
Supersedes [2. Implement Feature 1](0002-implement-feature-1.md)
10+
11+
## Context
12+
13+
The issue motivating this decision, and any context that influences or constrains the decision.
14+
15+
## Decision
16+
17+
The change that we're proposing or have agreed to implement.
18+
19+
## Consequences
20+
21+
What becomes easier or more difficult to do and any risks introduced by the change that will need to be mitigated.

src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/WorkspaceDecisionPageViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class WorkspaceDecisionPageViewModel(generatorContext: GeneratorContext, decisio
1717

1818
private fun transformADRLinks(content: String) =
1919
content.replace("\\[(.*)]\\(#(\\d+)\\)".toRegex()) {
20-
"[${it.groupValues[1]}](decisions/${it.groupValues[2]})"
20+
"[${it.groupValues[1]}](decisions/${it.groupValues[2]}/)"
2121
}
2222

2323
companion object {

src/test/kotlin/nl/avisi/structurizr/site/generatr/site/model/WorkspaceDecisionPageViewModelTest.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,19 @@ class WorkspaceDecisionPageViewModelTest : ViewModelTest() {
3838
content = """
3939
Decision with [link to other ADR](#2).
4040
[Web link](https://google.com)
41-
[Internal link](#other-section)
41+
[Section link](#other-section)
42+
[Internal link](../embedding-diagrams-and-images/)
4243
""".trimIndent()
4344
}
4445
val viewModel = WorkspaceDecisionPageViewModel(generatorContext(), decision)
4546

4647
assertThat(viewModel.content).isEqualTo(
4748
toHtml(
4849
viewModel, """
49-
Decision with [link to other ADR](decisions/2).
50+
Decision with [link to other ADR](decisions/2/).
5051
[Web link](https://google.com)
51-
[Internal link](#other-section)
52+
[Section link](#other-section)
53+
[Internal link](../embedding-diagrams-and-images/)
5254
""".trimIndent(),
5355
Format.Markdown,
5456
svgFactory

0 commit comments

Comments
 (0)