Skip to content

margin-header, body-header, etc. should document they allow HTML #13270

@mcanouil

Description

@mcanouil

What would you like to do?

Report an issue on quarto.org

Description

The documentation about margin-header, body-header, etc. states that it only allows Markdown text or string, but The "subscribe" example shows the use of HTML file with raw HTML.

As pointed out by @cderv, Quarto is handling the HTML case here but does not state it does.

  • function expandMarkdownFilePath(source: string, path: string): string {
    const absPath = isAbsolute(path) ? path : join(dirname(source), path);
    if (safeExistsSync(absPath)) {
    const fileContents = Deno.readTextFileSync(absPath);
    // If we are reading raw HTML, provide raw block indicator
    const ext = extname(absPath);
    if (ext === ".html") {
    return "```{=html}\n" + fileContents + "\n```";
    } else {
    return fileContents;
    }
    } else {
    return path;
    }
    }

This can lead to confusion about why some fields allow HTML while asking for Markdown but not all of them.

I initially updated the "subscribe" example (I did not know Quarto was adding the raw block at the time):

After some discussion, it might be better to actually document that these fields actually support HTML:

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationDoc improvements & quarto-web

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions