just do everything i guess

This commit is contained in:
atagen 2026-03-29 16:40:36 +11:00
parent 1e7b7d1614
commit 54000cfafe
5 changed files with 268 additions and 16 deletions

View file

@ -655,6 +655,15 @@ let extract_name_description contents =
* we hit something that looks like an argument (starts with [, <, -, etc.). *)
let extract_synopsis_command_lines lines =
(* replace italic text (\fI...\fR) with angle-bracketed placeholders
* before classification strips the font info. italic in groff indicates
* a parameter/placeholder (e.g. \fIoperation\fR), not a command word.
* the angle brackets cause extract_cmd to stop at these tokens since
* '<' is in its stop set. without this, "nix-env \fIoperation\fR"
* would be parsed as command "nix-env operation" instead of "nix-env". *)
let lines = List.map (fun line ->
Str.global_replace (Str.regexp {|\\fI\([^\\]*\)\\f[RP]|}) {|<\1>|} line
) lines in
let classified = List.map classify_line lines in
let is_synopsis name =
String.uppercase_ascii (String.trim name) = "SYNOPSIS"