rust-lang / rust-lang/mdBook

Configuration values must be lowercase when set with environment variables

Open
#2,281 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

As far as I can tell from 5.2.4. Environment Variables, it it not possible to override a key like

[output.pandoc.profile.pdf.variables]
CJKmainfont = "Noto Serif CJK SC"
CJKsansfont = "Noto Sans CJK SC"
CJKmonofont = "Noto Sans Mono CJK SC"

via the environment variables?

That is, the environment variables only allow for setting all-lowercase configuration values.

Steps

No response

Possible Solution(s)

An alternative would be to specify the whole of output.pandoc.profile.pdf.variables with the JSON syntax. A slight downside of this is that the user will have to repeat the values that are unchanged.

Notes

I ran into this in https://github.com/google/comprehensive-rust/pull/1572 where we're experimenting with rendering a PDF using mdbook-pandoc.

Version

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the environment-variable rules described in the linked “5.2.4. Environment Variables” documentation and trace the configuration handling for output.pandoc.profile.pdf.variables. Compare that behavior with the uppercase keys in the issue’s TOML example. Done means the reported configuration can be overridden through environment variables, with tests covering the relevant key casing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.