dotnet / dotnet/docfx

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

Open
#10,977 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.