Class SphinxMarkdownWriter
- All Implemented Interfaces:
SymbolDependencyContainer
The specific markdown parser being written for is
MyST with the
following
extensions enabled: linkify
and colon_fence
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Factory to constructSphinxMarkdownWriter
s.Nested classes/interfaces inherited from class software.amazon.smithy.docgen.writers.DocWriter
DocWriter.ListType, DocWriter.NoticeType
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCloses the body of an admonition.Writes any context needed to close a definition list item.closeTab()
Writes any context needed to close a tab.Writes any context needed to close a tab group.Opens an admonition with a default title.openAdmonition
(DocWriter.NoticeType type, Consumer<DocWriter> titleWriter) Opens an admonition with a custom title.openDefinitionListItem
(Consumer<DocWriter> titleWriter) Writes any context needed to open a definition list item.Writes any context needed to open a tab.Writes any opening context needed to form a tab group.writeAnchor
(String linkId) Writes a linkable element to the documentation with the given identifier.writeBadge
(DocWriter.NoticeType type, String text) Writes text as a badge.Methods inherited from class software.amazon.smithy.docgen.writers.MarkdownWriter
closeCodeBlock, closeDefinitionList, closeList, closeListItem, openCodeBlock, openDefinitionList, openHeading, openList, openListItem, toString, writeCommonMark
Methods inherited from class software.amazon.smithy.docgen.writers.DocWriter
closeCodeTab, closeHeading, openCodeTab, openHeading, openHeading, writeShapeDocs
Methods inherited from class software.amazon.smithy.codegen.core.SymbolWriter
addDependency, addImport, addUseImports, addUseImports, getDependencies, getImportContainer, setRelativizeSymbols
Methods inherited from class software.amazon.smithy.utils.AbstractCodeWriter
call, closeBlock, consumer, copySettingsFrom, dedent, dedent, disableNewlines, enableNewlines, enableStackTraceComments, ensureNewline, format, formatLiteral, formatWithStackTraceElement, getContext, getContext, getDebugInfo, getDebugInfo, getExpressionStart, getIndentLevel, getIndentText, getInsertTrailingNewline, getNewline, getNewlinePrefix, getTrimBlankLines, getTrimTrailingSpaces, indent, indent, injectSection, insertTrailingNewline, insertTrailingNewline, isStackTraceRelevant, onSection, onSection, openBlock, openBlock, openBlock, openBlock, openBlock, openBlock, openBlock, openBlock, popState, pushFilteredState, pushState, pushState, pushState, putContext, putContext, putFormatter, removeContext, setExpressionStart, setIndentText, setNewline, setNewline, setNewlinePrefix, trimBlankLines, trimBlankLines, trimTrailingSpaces, trimTrailingSpaces, unwrite, write, writeInline, writeInlineWithNoFormatting, writeOptional, writeWithNoFormatting
-
Constructor Details
-
SphinxMarkdownWriter
Constructs a SphinxMarkdownWriter.- Parameters:
filename
- The full path to the file being written to.
-
-
Method Details
-
openDefinitionListItem
Description copied from class:DocWriter
Writes any context needed to open a definition list item.A definition list is a list where each element has an emphasized title or term. A basic way to represent this might be an unordered list where the term is followed by a colon.
This will primarily be used to list members, with the element titles being the member names, member types, and a link to those member types where applicable. It will also be used for resource lifecycle operations, which will have similar titles.
- Overrides:
openDefinitionListItem
in classMarkdownWriter
- Parameters:
titleWriter
- writes the title or term for the definition list item.- Returns:
- returns the writer.
-
closeDefinitionListItem
Description copied from class:DocWriter
Writes any context needed to close a definition list item.A definition list is a list where each element has an emphasized title or term. A basic way to represent this might be an unordered list where the term is followed by a colon.
This will primarily be used to list members, with the element titles being the member names, member types, and a link to those member types where applicable. It will also be used for resource lifecycle operations, which will have similar titles.
- Overrides:
closeDefinitionListItem
in classMarkdownWriter
- Returns:
- returns the writer.
-
writeAnchor
Description copied from class:DocWriter
Writes a linkable element to the documentation with the given identifier.The resulting HTML should be able to link to this anchor with
#linkId
.For example, a direct HTML writer might create a
span
tag with the given string as the tag'sid
, or modify the next emitted tag to have the given id.- Overrides:
writeAnchor
in classMarkdownWriter
- Parameters:
linkId
- The anchor's link identifier.- Returns:
- returns the writer.
-
openTabGroup
Description copied from class:DocWriter
Writes any opening context needed to form a tab group.- Overrides:
openTabGroup
in classMarkdownWriter
- Returns:
- returns the writer.
-
closeTabGroup
Description copied from class:DocWriter
Writes any context needed to close a tab group.- Overrides:
closeTabGroup
in classMarkdownWriter
- Returns:
- returns the writer.
-
openTab
Description copied from class:DocWriter
Writes any context needed to open a tab.- Overrides:
openTab
in classMarkdownWriter
- Parameters:
title
- The title text that is displayed on the tab itself.- Returns:
- returns the writer.
-
closeTab
Description copied from class:DocWriter
Writes any context needed to close a tab.- Overrides:
closeTab
in classMarkdownWriter
- Returns:
- returns the writer.
-
openAdmonition
Description copied from class:DocWriter
Opens an admonition with a custom title.An admonition is an emphasized callout that typically have color-coded severity. A warning admonition, for example, might have a yellow or red banner that emphasizes the importance of the body text.
- Overrides:
openAdmonition
in classMarkdownWriter
- Parameters:
type
- The type of admonition to open.titleWriter
- A consumer that writes out the title.- Returns:
- returns the writer.
-
openAdmonition
Description copied from class:DocWriter
Opens an admonition with a default title.An admonition is an emphasized callout that typically have color-coded severity. A warning admonition, for example, might have a yellow or red banner that emphasizes the importance of the body text.
- Overrides:
openAdmonition
in classMarkdownWriter
- Parameters:
type
- The type of admonition to open.- Returns:
- returns the writer.
-
closeAdmonition
Description copied from class:DocWriter
Closes the body of an admonition.- Overrides:
closeAdmonition
in classMarkdownWriter
- Returns:
- returns the writer.
-
writeBadge
Description copied from class:DocWriter
Writes text as a badge.Implementations SHOULD write inline.
A badge in this context means text enclosed in a color-coded rectangular shape. The color should be based on the given type.
- Overrides:
writeBadge
in classMarkdownWriter
- Parameters:
type
- The notice type of the badge that determines styling.text
- The text to put in the badge.- Returns:
- returns the writer.
-