Generates a string to display inside of a help text section.
import std.exception : assertThrown; auto options = HelpSectionOptions("\t", 7 + 2); // '+ 2' is for the prefix + ending new line. 7 is the wanted char limit. auto content = new HelpSectionTextContent("Hey Hip Lell Loll"); assert(content.getContent(options) == "\tHey Hip\n" ~"\tLell Lo\n" ~"\tll", "\n"~content.getContent(options) ); options.lineCharLimit = 200; assert(content.getContent(options) == "\tHey Hip Lell Loll"); options.lineCharLimit = 2; // Enough for the prefix and ending new line, but not enough for any piece of text. assertThrown(content.getContent(options)); options.lineCharLimit = 3; // Useable, but not readable. assert(content.getContent(options) == "\tH\n" ~"\te\n" ~"\ty\n" ~"\tH\n" ~"\ti\n" ~"\tp\n" ~"\tL\n" ~"\te\n" ~"\tl\n" ~"\tl\n" ~"\tL\n" ~"\to\n" ~"\tl\n" ~"\tl" );
A simple content class the simply displays a given string.
Notes: This class is fully compliant with the HelpSectionOptions.