Skip to content

Commit 71633c9

Browse files
Fix service file names
1 parent fe9de5e commit 71633c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

smithy-docgen-core/src/main/java/software/amazon/smithy/docgen/core/DocSymbolProvider.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ private String getDefinitionFile(ServiceShape serviceShape, Shape shape) {
119119
if (shape.isMemberShape()) {
120120
return getDefinitionFile(serviceShape, model.expectShape(shape.getId().withoutMember()));
121121
}
122-
return getDefinitionFile(getShapeName(serviceShape, shape) + ".md");
122+
return getDefinitionFile(
123+
getShapeName(serviceShape, shape).replaceAll("\\s+", "") + ".md"
124+
);
123125
}
124126

125127
public String getDefinitionFile(String filename) {
@@ -140,7 +142,7 @@ private String getShapeName(ServiceShape serviceShape, Shape shape) {
140142
}
141143

142144
private String getLinkId(String shapeName) {
143-
return shapeName.toLowerCase(Locale.ENGLISH).replaceAll("\\s", "-");
145+
return shapeName.toLowerCase(Locale.ENGLISH).replaceAll("\\s+", "-");
144146
}
145147

146148
// All other shapes don't get generation, so we'll do null checks where this might

smithy-docgen-core/src/test/java/software/amazon/smithy/docgen/core/SmithyDocPluginTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void assertDocumentationFiles() {
5656
}
5757

5858
private void assertServicePageContents(MockManifest manifest) {
59-
String servicePage = manifest.expectFileString("/sources/SampleService.md");
59+
String servicePage = manifest.expectFileString("/content/SampleService.md");
6060

6161
assertEquals(servicePage, readExpectedPageContent("expected-outputs/SampleService.md"));
6262
}

0 commit comments

Comments
 (0)