Class DocumentationConfiguration
java.lang.Object
org.gcube.informationsystem.resourceregistry.documentation.DocumentationConfiguration
Where the live-registry model documentation (model-docs) is written and how it is built, read
from the "documentation" section of "service.yaml"; the section and each
of its keys are optional.
- "directory": the directory the documentation is written to, by default
"model-docs". An absolute path is used as it is; a relative one is resolved against
the root of the webapp, where the
defaultservlet mapped to/model-docs/*inweb.xmllooks for it, or against the working directory when there is no webapp (e.g. a test run). - "venv": the directory MkDocs keeps its Python virtual environment in, by default
${user.home}/.cache/d4science-service-docs/mkdocs-venv, the same as the Maven build.
The documentation is built with MkDocs when the war carries the MkDocs layout of d4science-service-docs ("WEB-INF/d4science-service-docs/scripts/build_mkdocs.py"), otherwise it is written as HTML.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe directory the documentation is written to when "directory" is absent.static final StringThe MkDocs entry point of d4science-service-docs, relative to the root of the webapp.static final StringThe section of "service.yaml" this configuration is read from. -
Constructor Summary
ConstructorsConstructorDescriptionDocumentationConfiguration(org.gcube.smartgears.ServiceConfiguration serviceConfiguration, File webappRoot) Reads the configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns the MkDocs entry point the war carries.Returns the directory the documentation is written to.Returns the directory MkDocs keeps its Python virtual environment in.
-
Field Details
-
SECTION
The section of "service.yaml" this configuration is read from.- See Also:
-
DEFAULT_DIRECTORY
The directory the documentation is written to when "directory" is absent.- See Also:
-
MKDOCS_SCRIPT
The MkDocs entry point of d4science-service-docs, relative to the root of the webapp.- See Also:
-
-
Constructor Details
-
DocumentationConfiguration
public DocumentationConfiguration(org.gcube.smartgears.ServiceConfiguration serviceConfiguration, File webappRoot) Reads the configuration.- Parameters:
serviceConfiguration- the configuration of the servicewebappRoot- the root of the webapp, ornullwhen there is none (the war is not exploded, or a test run)
-
-
Method Details
-
getOutputDirectory
Returns the directory the documentation is written to.- Returns:
- the directory
-
getMkdocsScript
Returns the MkDocs entry point the war carries.- Returns:
- the script, or
nullwhen the war has no MkDocs layout and the documentation is written as HTML
-
getVenvDirectory
Returns the directory MkDocs keeps its Python virtual environment in.- Returns:
- the directory
-