def roff_examples
cli@0.2.0.0 · cli.bend:7521
import cli@0.2.0.0/cli.bend as Cli
import Base
7521def roff_examples(items: List<&2, Item>, before: List<&2, String>) ->
7522 List<&2, String>:
7523 match items:
7524 case Nil{}: Nil{}
7525 case Example{line, what} <> tail:
7526 List.concat(&2, String, [
7527 before,
7528 [Roff.esc(String.append(what, ":")), ".IP", ".nf",
7529 Roff.esc(String.append("$ ", line)), ".fi"],
7530 roff_examples(tail, [".PP"]),
7531 ])
7532 case head <> tail: roff_examples(tail, before)