Skip to content

markup: Standardize behavior when external converters are missing #14222

@jmooring

Description

@jmooring

Currently, with Pandoc and reStructuredText markup, if the external converter is not installed we print an informative statement to stdout and continue the build:

if binaryName == "" {
logger.Println("pandoc not found in $PATH: Please install.\n",
" Leaving pandoc content unrendered.")
return src, nil
}

if binaryName == "" {
logger.Println("rst2html / rst2html.py not found in $PATH: Please install.\n",
" Leaving reStructuredText content unrendered.")
return src, nil

But with AsciiDoc content we fail the build:

if ok, err := HasAsciiDoc(); !ok {
a.Cfg.Logger.Errorf("leaving AsciiDoc content unrendered: %s", err.Error())
return src, nil
}

This isn't anything new; it's been like this for a few years at least.

From a data integrity standpoint, it seems like we should also fail the build for Pandoc and reStructuredText. With automated deployments in particular, you have no idea if you are publishing raw content unless you look at the build log... which in practice doesn't happen unless there's an error.

If we do this:

  1. We should include the page Path (if available) in the error message.
  2. We need to modify TestPagesFromGoTmplAsciiDocAndSimilar to perform the "Supports" checks before the build.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions