Class DocumentationConfiguration

java.lang.Object
org.gcube.informationsystem.resourceregistry.documentation.DocumentationConfiguration

public class DocumentationConfiguration extends Object
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 default servlet mapped to /model-docs/* in web.xml looks 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 Details

    • SECTION

      public static final String SECTION
      The section of "service.yaml" this configuration is read from.
      See Also:
    • DEFAULT_DIRECTORY

      public static final String DEFAULT_DIRECTORY
      The directory the documentation is written to when "directory" is absent.
      See Also:
    • MKDOCS_SCRIPT

      public static final String MKDOCS_SCRIPT
      The MkDocs entry point of d4science-service-docs, relative to the root of the webapp.
      See Also:
  • Constructor Details

    • DocumentationConfiguration

      public DocumentationConfiguration(ServiceConfiguration serviceConfiguration)
      Reads the configuration.
      Parameters:
      serviceConfiguration - the configuration of the service
  • Method Details

    • getOutputDirectory

      public File getOutputDirectory()
      Returns the directory the documentation is written to.
      Returns:
      the directory
    • getMkdocsScript

      public File getMkdocsScript()
      Returns the MkDocs entry point the war carries.
      Returns:
      the script, or null when the war has no MkDocs layout and the documentation is written as HTML
    • getVenvDirectory

      public File getVenvDirectory()
      Returns the directory MkDocs keeps its Python virtual environment in.
      Returns:
      the directory