format_description

Function format_description 

Source
pub fn format_description(short: &str, long: &str) -> String
Expand description

Format a Debian package description according to Debian policy.

Package descriptions consist of a short description (synopsis) and a long description. The long description lines are indented with a single space, and empty lines are represented as “ .“ (space followed by a period).

§Arguments

  • short - The short description (synopsis), typically one line
  • long - The long description, can be multiple lines

§Returns

A formatted description string suitable for use in a Debian control file.

§Examples

use debian_control::fields::format_description;

let formatted = format_description("A great package", "This package does amazing things.\nIt is very useful.");
assert_eq!(formatted, "A great package\n This package does amazing things.\n It is very useful.");

// Empty lines become " ."
let with_empty = format_description("Summary", "First paragraph.\n\nSecond paragraph.");
assert_eq!(with_empty, "Summary\n First paragraph.\n .\n Second paragraph.");