Cli.roff_view: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 7576-7605 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=7576&end_line=7605 import Base def roff_view(view: View, title: String) -> String: match view: case View{+path, +about, +items, +globals, root, stuck}: +words = String.split(path, ' ') +page = String.join(words, "-") +args = List.append(&2, Item, items, globals) text_lines(List.concat(&2, String, [ [String.concat([".TH \"", roff_text(String.to_upper(page)), "\" \"1\" \"\" \"", roff_text(title), "\" \"User Commands\""]), ".SH NAME", Roff.esc(String.concat([page, " - ", one_line(about)])), ".SH SYNOPSIS", roff_synopsis(segment_texts(usage_elems(path, items, globals)))], roff_section("DESCRIPTION", roff_paras(about, ".PP")), roff_section("ARGUMENTS", roff_positionals(items)), [".SH OPTIONS"], roff_options(args, ""), roff_builtins(builtin_opts(items, globals, root)), roff_headings(heading_titles(args, []), args), roff_section("COMMANDS", roff_commands(items, page)), roff_section("ENVIRONMENT", roff_envs(args)), [".SH EXIT STATUS", ".TP", "\\fB0\\fR", "Success", ".TP", "\\fB1\\fR", "Failure", ".TP", "\\fB2\\fR", "Usage error", ".TP", "\\fB70\\fR", "Internal software error"], roff_section("EXAMPLES", roff_examples(items, [])), roff_section("NOTES", roff_paras(String.join(after_texts(items), "\n\n"), ".PP")), roff_section("SEE ALSO", roff_see(List.append(&2, String, parent_pages(words), sub_pages(items, page)))), ])) Uses (33): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.concat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.join https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.split https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.to_upper https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Item https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=Roff.esc https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=View https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=after_texts https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=builtin_opts https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=heading_titles https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=one_line https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=parent_pages https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_builtins https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_commands https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_envs https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_examples https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_headings https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_options https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_paras https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_positionals https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_section https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_see https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_synopsis https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=roff_text https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=segment_texts https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=sub_pages https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=text_lines https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=usage_elems