Skip to content

Build-Documentation Silently Outputs Nothing if formats missing from config.json #72

Description

@RichardSlater

Description

If formats is missing or empty in the docs JSON file then Build-Documentation silently fails.

Example Broken Config

{
    "title": "Stacks Infrastructure AKS",
    "output": "{{ basepath }}/outputs/docs/{{ format }}",
    "trunkBranch": "main",
    "path": "{{ basepath }}/docs/index.adoc",
    "libs": [
        "asciidoctor-diagram"
    ],
    "pdf": {
        "attributes": [
            "pdf-theme={{ basepath }}/build/config/pdf/theme.yml",
            "pdf-fontsdir=\"{{ basepath }}/docs/styles/fonts;GEM_FONTS_DIR\"",
            "allow-uri-read",
            "blockdiag=/usr/bin/blockdiag",
            "skip-front-matter",
            "graphvizdot=/usr/bin/dot"
        ]
    },
    "html": {
        "attributes": [
            "stylesheet={{ basepath }}/conf/html/style.css",
            "allow-uri-read",
            "toc=left",
            "java=/usr/bin/java",
            "graphvizdot=/usr/bin/dot",
            "skip-front-matter"
        ]
    }
}

Example Fixed Config

{
    "title": "Stacks Infrastructure AKS",
    "output": "{{ basepath }}/outputs/docs/{{ format }}",
    "trunkBranch": "main",
    "path": "{{ basepath }}/docs/index.adoc",
    "formats": [
        "pdf",
        "html"
    ],
    "libs": [
        "asciidoctor-diagram"
    ],
    "pdf": {
        "attributes": [
            "pdf-theme={{ basepath }}/build/config/pdf/theme.yml",
            "pdf-fontsdir=\"{{ basepath }}/docs/styles/fonts;GEM_FONTS_DIR\"",
            "allow-uri-read",
            "blockdiag=/usr/bin/blockdiag",
            "skip-front-matter",
            "graphvizdot=/usr/bin/dot"
        ]
    },
    "html": {
        "attributes": [
            "stylesheet={{ basepath }}/conf/html/style.css",
            "allow-uri-read",
            "toc=left",
            "java=/usr/bin/java",
            "graphvizdot=/usr/bin/dot",
            "skip-front-matter"
        ]
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions