Skip to content

docs: eliminate troff warnings in man page generation#10950

Merged
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:docs-man-page-warnings
Jul 19, 2026
Merged

docs: eliminate troff warnings in man page generation#10950
maliberty merged 3 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:docs-man-page-warnings

Conversation

@maliberty

Copy link
Copy Markdown
Member

Summary

The man page (cat) build emitted several classes of troff/groff warnings. This makes the doc build warning-free and improves the rendered tables.

Build tooling (docs/)

  • cannot select font 'C'/'V' — Pandoc renders code/verbatim text in the Courier font family, which the nroff/tty device lacks. Added docs/src/man_fontfix.tmac (injected via --include-in-header) to remap those fonts to ones available on devices without Courier. Registered as a Bazel input for //docs:man_pages.
  • tbl preprocessor failed — the OPTIONS tables need tbl; added -t.
  • character with input code N not defined / mojibake — non-ASCII README content (e.g. accented author names like "Povišer") was decoded as Latin-1. The build now runs in a UTF-8 locale and renders with groff -Kutf8 … -Tutf8.
  • table wider than line length — Pandoc sizes tables at nearly full width while the man body is indented; narrowed the body indent with -rIN=4n so they fit.

README content

  • Pandoc derives table column widths from the relative number of dashes in the Markdown separator row. The uniform | ----- | ----- | separators forced a 50/50 split, leaving the short Switch Name column half-empty in rendered man pages. Column 1 is now sized per-table to its longest switch name (147 tables).
  • Dropped the Check out GitHub discussion FAQ footers, whose long inline URLs were not usable as links in man/cat output.

Verification

Full make doc cat under a CI-like C locale now emits 0 warnings of any class.

The man page cat build emitted several classes of troff/groff warnings:

- 'cannot select font C/V': Pandoc renders code/verbatim text in the
  Courier font family, which the nroff/tty device lacks. Add
  src/man_fontfix.tmac (injected via --include-in-header) to remap those
  fonts to available ones on devices without Courier.
- 'tbl preprocessor failed': the OPTIONS tables need tbl; add -t.
- 'character with input code N not defined' / mojibake: non-ASCII README
  content (e.g. accented author names) was decoded as Latin-1. Run the
  build in a UTF-8 locale and render with 'groff -Kutf8 ... -Tutf8'.
- 'table wider than line length': Pandoc sizes tables at nearly full
  width while the man body is indented; narrow the indent with -rIN=4n.

Register man_fontfix.tmac as a Bazel input for //docs:man_pages.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Jul 19, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the documentation build system by introducing a font remapping mechanism (man_fontfix.tmac) to silence font selection warnings, running the build in a UTF-8 locale, and using groff with proper encoding and formatting flags for generating cat files. It also removes outdated FAQ sections across multiple tool READMEs and reformats various markdown tables. The review feedback suggests further optimizing the column width allocations in several markdown tables by adjusting the relative number of dashes in the separator rows, which ensures better readability and prevents excessive wrapping of descriptions in the generated man pages.

Comment thread src/gpl/README.md Outdated
Comment thread src/mpl/README.md Outdated
Comment thread src/pdn/README.md Outdated
Comment thread src/cts/README.md Outdated
Comment thread src/cts/README.md Outdated
Comment thread src/grt/README.md Outdated
Comment thread src/rsz/README.md Outdated
Comment thread src/upf/README.md Outdated
Comment thread src/rcx/README.md Outdated
For the module docs that render as man pages (cgt, est, ram, syn, tap,
web), Pandoc derives roff table column widths from the relative number
of dashes in the Markdown separator row. The uniform '| ----- | ----- |'
separators forced a 50/50 split, leaving the short 'Switch Name' column
half-empty while squeezing the long descriptions. Size column 1 to the
longest option name, capped so the description keeps the majority of the
width. Modules excluded from man-page generation are left unchanged --
their dash ratios have no effect on any rendered output.

Also drop the 'Check out GitHub discussion' FAQ footers, whose long
inline URLs were not usable as links in man/cat output.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty

Copy link
Copy Markdown
Member Author

Thanks for the review. Addressed the column-width feedback, with one scoping correction:

Most of the flagged tables (pdn, cts, gpl, mpl, grt, rsz, upf, rcx) are in modules listed in EXCLUDE_KEYWORDS in docs/Makefile, so their README tables are not rendered through Pandoc into man pages — and myst (RTD) / GitHub size table columns to content and ignore the dash counts. So the separator ratios in those modules have no effect on any rendered output. I've reverted the separator changes in those modules to keep the diff focused, so those comments are moot.

For the modules that do render man-page tables (cgt, est, ram, syn, tap, web), I reworked the sizing: column 1 is now set to the longest single option name (capped so the description column keeps the majority of the width), rather than the earlier formula that let long/multi-value cells inflate column 1. This gives the descriptions the space the review asked for.

The FAQ footer removals are unrelated to column widths and are kept.

@openroad-ci
openroad-ci force-pushed the docs-man-page-warnings branch from 13b56a5 to fdef3d0 Compare July 19, 2026 04:16
@maliberty

Copy link
Copy Markdown
Member Author

/gemini review

@maliberty

Copy link
Copy Markdown
Member Author

@codex review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves documentation generation by running the build in a UTF-8 locale, introducing a font-remapping snippet (man_fontfix.tmac) to prevent font errors on devices lacking Courier, and updating the Makefile to use groff instead of nroff for generating cat files. Additionally, it removes outdated FAQ sections and formats option tables across several tool READMEs. Feedback on the changes suggests defining groff as a customizable variable (GROFF ?= groff) in the Makefile to improve portability, removing the unused NROFF variable, and using $(GROFF) in the recipes instead of hardcoding the executable.

Comment thread docs/Makefile
Comment thread docs/Makefile Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdef3d0a09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/Makefile Outdated
- Define GROFF ?= groff and use it in the cat recipes so the man renderer
  can be overridden (e.g. gnroff/macOS); drop the now-unused NROFF variable.
- Detect an installed UTF-8 locale instead of hard-coding C.UTF-8, which is
  absent on some hosts (e.g. stock macOS). Fall back to the user's locale if
  none is found rather than exporting an invalid LC_ALL.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty

Copy link
Copy Markdown
Member Author

Addressed the Makefile review feedback:

  • groff overridable (@gemini): added GROFF ?= groff and switched the three cat recipes to $(GROFF); removed the now-unused NROFF variable.
  • Locale portability (@chatgpt-codex): replaced the hard-coded export LC_ALL := C.UTF-8 with detection — it picks an installed UTF-8 locale (locale -a), preferring C/en_US, and only exports LC_ALL if one is found. On hosts without any UTF-8 locale it leaves the user's locale untouched, so no invalid LC_ALL / setlocale diagnostics. groff -Kutf8 still decodes UTF-8 input regardless.

Note: the earlier inline comments on src/{rcx,upf,rsz,grt,cts}/README.md column widths were on the previous synced commit; those modules are excluded from man-page generation, so I reverted their separators to the original | ----- | ----- | — those lines are no longer changed by this PR.

Verified make doc cat remains warning-free (detected locale = C.utf8 here) with the accented author name rendering correctly.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@maliberty
maliberty marked this pull request as ready for review July 19, 2026 05:40
@maliberty
maliberty requested review from a team as code owners July 19, 2026 05:40
@maliberty
maliberty requested review from a team as code owners July 19, 2026 05:40
@maliberty
maliberty merged commit 129e8ee into The-OpenROAD-Project:master Jul 19, 2026
15 of 18 checks passed
@maliberty
maliberty requested a review from AcKoucher July 19, 2026 05:40
@maliberty
maliberty deleted the docs-man-page-warnings branch July 19, 2026 05:40
@maliberty
maliberty requested a review from luis201420 July 19, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant