Skip to content

[Bug] globalMetadata overwrites the pdf setting in toc.yml #10977

@A-Loot

Description

@A-Loot

Describe the bug
In my docfx.json I set "pdf": true in the globalMetadata because I want to generate pdfs for all my doc pages. By default, this also includes the toc.yml in the root, which I don't need. To prevent this behavior, I set pdf: false in the toc.yml. Despite this, the pdf was still generated and looking at the generated toc.json, "pdf" was set to true. This behavior is inconsistent with the documentation (https://dotnet.github.io/docfx/docs/pdf.html) which states that pdf can be configured in toc.yml, which I would expect to take precedence over globalMetadata.

Turning off pdf in fileMetadata still works though, so it's not really that big of a deal

To Reproduce
Steps to reproduce the behavior:

  1. In docfx.json, set build.globalMetadata.pdf to true
  2. In toc.yml, set pdf to false
  3. run docfx docfx.json
  4. The pdf value in the generated toc.json will be true and the pdf for toc.yml will be generated

Expected behavior
The value from toc.yml should be used instead of the value from globalMetadata.

Context (please complete the following information):

  • OS: Windows
  • Docfx version: 2.78.5-preview.72

Additional context
Add any other context about the problem here.

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