Skip to content

Commit 805b29d

Browse files
Add remaining documentation
1 parent 7750145 commit 805b29d

File tree

5 files changed

+35
-14
lines changed

5 files changed

+35
-14
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public final class DocGenerationContext implements CodegenContext<DocSettings, D
2828
private final WriterDelegator<DocWriter> writerDelegator;
2929
private final List<DocIntegration> docIntegrations;
3030

31+
/**
32+
* Constructor.
33+
*
34+
* @param model The source model to generate for.
35+
* @param docSettings Settings to customize generation.
36+
* @param symbolProvider The symbol provider to use to turn shapes into symbols.
37+
* @param fileManifest The file manifest to write to.
38+
* @param docIntegrations A list of integrations to apply during generation.
39+
*/
3140
public DocGenerationContext(
3241
Model model,
3342
DocSettings docSettings,

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* <p>These symbols contain many important pieces of metadata. Particularly
2626
* important are:
2727
*
28-
* <p><ul>
28+
* <ul>
2929
* <li>{@code name}: The name of the symbol will be used as the title for its
3030
* definition section. For services, this defaults to the value of the
3131
* {@code title} trait. For other shapes, it defaults to the shape name including
@@ -86,6 +86,12 @@ public final class DocSymbolProvider extends ShapeVisitor.Default<Symbol> implem
8686
private final DocSettings docSettings;
8787
private final ServiceShape serviceShape;
8888

89+
/**
90+
* Constructor.
91+
*
92+
* @param model The model to provide symbols for.
93+
* @param docSettings Settings used to customize symbol creation.
94+
*/
8995
public DocSymbolProvider(Model model, DocSettings docSettings) {
9096
this.model = model;
9197
this.docSettings = docSettings;
@@ -124,7 +130,7 @@ private String getDefinitionFile(ServiceShape serviceShape, Shape shape) {
124130
);
125131
}
126132

127-
public String getDefinitionFile(String filename) {
133+
private String getDefinitionFile(String filename) {
128134
return "content/" + filename;
129135
}
130136

smithy-docgen-core/src/main/java/software/amazon/smithy/docgen/core/writers/DocWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public abstract class DocWriter extends SymbolWriter<DocWriter, DocImportContain
2121

2222
private int headingDepth = 0;
2323

24+
/**
25+
* Constructor.
26+
*
27+
* @param importContainer The container to store any imports in.
28+
*/
2429
public DocWriter(DocImportContainer importContainer) {
2530
super(importContainer);
2631
}

smithy-docgen-core/src/main/java/software/amazon/smithy/docgen/core/writers/MarkdownWriter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,25 @@
88
import software.amazon.smithy.codegen.core.SymbolWriter;
99
import software.amazon.smithy.model.shapes.Shape;
1010
import software.amazon.smithy.model.traits.DocumentationTrait;
11+
import software.amazon.smithy.utils.SmithyUnstableApi;
1112
import software.amazon.smithy.utils.StringUtils;
1213

14+
/**
15+
* Writes documentation in <a href="https://spec.commonmark.org">CommonMark</a> format.
16+
*/
17+
@SmithyUnstableApi
1318
public final class MarkdownWriter extends DocWriter {
1419

20+
/**
21+
* Constructor.
22+
*/
1523
public MarkdownWriter() {
1624
super(new DocImportContainer());
1725
}
1826

27+
/**
28+
* Factory to construct {@code MarkdownWriter}s.
29+
*/
1930
public static final class Factory implements SymbolWriter.Factory<DocWriter> {
2031
@Override
2132
public DocWriter apply(String s, String s1) {

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
/*
2-
* Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License").
5-
* You may not use this file except in compliance with the License.
6-
* A copy of the License is located at
7-
*
8-
* http://aws.amazon.com/apache2.0
9-
*
10-
* or in the "license" file accompanying this file. This file is distributed
11-
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12-
* express or implied. See the License for the specific language governing
13-
* permissions and limitations under the License.
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
144
*/
155

166
package software.amazon.smithy.docgen.core;

0 commit comments

Comments
 (0)