Class SphinxIntegration
- All Implemented Interfaces:
SmithyIntegration<DocSettings,
,DocWriter, DocGenerationContext> DocIntegration
This integration runs in low priority to allow other integrations to generate
files that will be picked up by sphinx-build. To have an integration reliably run
after this, override SmithyIntegration.runAfter()
with the output of
name()
in the list. Similarly, to guarantee an integration
is run before this, override SmithyIntegration.runBefore()
with the same argument.
To customize the project files generated by this integration, you can make use
of SmithyIntegration.interceptors(C)
to intercept and modify the files before
they're written. The following named code sections are used:
ConfSection
: Creates theconf.py
MakefileSection
: Creates theMakefile
build script for unix.WindowsMakeSection
: Creates themake.bat
build script for Windows.RequirementsSection
: Creates therequirements.txt
used to build the docs. Any dependencies here will be installed into the environment used to runsphinx-build
.
SphinxIntegration.SphinxSettings
. These settings are configured similarly to the doc
generation plugin settings. Below is an example smithy-build.json
with
sphinx project auto build disabled.
{
"version": "1.0",
"projections": {
"sphinx-markdown": {
"plugins": {
"docgen": {
"service": "com.example#DocumentedService",
"format": "sphinx-markdown",
"integrations": {
"sphinx": {
"autoBuild": false
}
}
}
}
}
}
}
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Settings for sphinx projects, regardless of their intermediate format. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(DocSettings settings, ObjectNode integrationSettings) Configures the integration.void
customize
(DocGenerationContext context) Allows generators to write additional files, perform additional tasks, and interact directly with aFileManifest
used to write files to the plugin's output.docFormats
(DocSettings settings) AddsDocFormat
s to the list of supported formats.name()
Gets the name of the integration.byte
priority()
Gets the priority ordering relative to the topologically ordered integration graph determined bySmithyIntegration.runBefore()
andSmithyIntegration.runAfter()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.smithy.codegen.core.SmithyIntegration
decorateSymbolProvider, interceptors, preprocessModel, runAfter, runBefore
-
Constructor Details
-
SphinxIntegration
public SphinxIntegration()
-
-
Method Details
-
name
Description copied from interface:SmithyIntegration
Gets the name of the integration.This name is referred to when ordering the graph of integrations. The name defaults to the canonical class name if not overridden.
- Specified by:
name
in interfaceSmithyIntegration<DocSettings,
DocWriter, DocGenerationContext> - Returns:
- Returns the integration name.
-
priority
public byte priority()Description copied from interface:SmithyIntegration
Gets the priority ordering relative to the topologically ordered integration graph determined bySmithyIntegration.runBefore()
andSmithyIntegration.runAfter()
.Higher numbers come before lower numbers.
When ordering, implementations must not allow cycles, and no two integrations may have the same name.
- Specified by:
priority
in interfaceSmithyIntegration<DocSettings,
DocWriter, DocGenerationContext> - Returns:
- Returns the priority order.
-
configure
Description copied from interface:SmithyIntegration
Configures the integration.This provides access to both the parsed settings for the generator and an unparsed
ObjectNode
containing settings for this particular integration.The following
smithy-build.json
file contains an example of how this configuration will be set.{ "version": "1.0", "projections": { "codegen-projection": { "plugins": { "code-generator": { "service": "com.example#DocumentedService", "integrations": { "my-integration": { "example-setting": "foo" } } } } } } }
In this example, an integration whose
SmithyIntegration.name()
ismy-integration
Would receive the extra settings from the key of the same name within theintegrations
node.Integrations SHOULD use modeled traits as much as possible to drive configuration. This is intended for configuration that doesn't make sense as a trait, such as configuring a documentation theme.
- Specified by:
configure
in interfaceSmithyIntegration<DocSettings,
DocWriter, DocGenerationContext> - Parameters:
settings
- Settings used to generate code.integrationSettings
- Settings used to configure integrations.
-
docFormats
Description copied from interface:DocIntegration
AddsDocFormat
s to the list of supported formats.When resolving the format implementation, the first format found with a matching name will be used. Use
SmithyIntegration.priority()
to adjust which integration is seen first.- Specified by:
docFormats
in interfaceDocIntegration
- Parameters:
settings
- The documentation generation settings.- Returns:
- A list of formats to add.
-
customize
Description copied from interface:SmithyIntegration
Allows generators to write additional files, perform additional tasks, and interact directly with aFileManifest
used to write files to the plugin's output.This method should generally be invoked at the end of the code generation process.
- Specified by:
customize
in interfaceSmithyIntegration<DocSettings,
DocWriter, DocGenerationContext> - Parameters:
context
- Code generation context that can be queried when writing additional files.
-