let field ?(indent = 2) label value = String.make indent ' ' ^ label ^ ": " ^ value let section title lines = String.concat "\n" (title :: lines) let document sections = String.concat "\n\n" sections let blocks values = [ String.concat "\n\n" values ] let escaped_lines ~indent value = String.split_on_char '\n' value |> List.map (fun line -> String.make indent ' ' ^ String.escaped line) let short ~length value = if String.length value <= length then value else String.sub value 0 length