Skip to content

Commit 3c8a681

Browse files
committed
xtask: post-process manpages to fix broken apostrophes
Signed-off-by: John Eckersberg <[email protected]>
1 parent 3c083cf commit 3c8a681

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

xtask/src/xtask.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ fn manpages(sh: &Shell) -> Result<()> {
104104
"cargo run --features=docgen -- man --directory target/man"
105105
)
106106
.run()?;
107+
108+
// Post-process hack to unconditionally define the roff string for
109+
// apostrophe, See:
110+
// https://github.com/bootc-dev/bootc/pull/1385#discussion_r2172661872
111+
for page in std::fs::read_dir(sh.current_dir().join("target/man"))? {
112+
let page = page?;
113+
let path = page.path();
114+
let groffsub = r"1i .ds Aq \\(aq";
115+
let dropif = r"/\.g \.ds Aq/d";
116+
let dropelse = r"/.el .ds Aq '/d";
117+
cmd!(sh, "sed -i -e {groffsub} -e {dropif} -e {dropelse} {path}").run()?;
118+
}
119+
107120
// We also have some man pages for the systemd units which are canonically
108121
// maintained as markdown; convert them to man pages.
109122
let extradir = sh.current_dir().join("docs/src/man-md");

0 commit comments

Comments
 (0)