18namespace seqan3::detail
33class format_html :
public format_help_base<format_html>
36 using base_type = format_help_base<format_html>;
45 format_html() =
default;
46 format_html(format_html
const & pf) =
default;
47 format_html & operator=(format_html
const & pf) =
default;
48 format_html(format_html &&) =
default;
49 format_html & operator=(format_html &&) =
default;
50 ~format_html() =
default;
53 format_html(std::vector<std::string>
const & names,
bool const advanced =
false) : base_type{names,
advanced} {};
58 void maybe_close_list()
62 std::cout <<
"</dl>\n";
68 void maybe_close_paragraph()
72 std::cout <<
"</p>\n";
81 std::cout <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
82 <<
"http://www.w3.org/TR/html4/strict.dtd\">\n"
83 <<
"<html lang=\"en\">\n"
85 <<
"<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"
86 <<
"<title>" << escape_special_xml_chars(meta.app_name) <<
" — "
87 << escape_special_xml_chars(meta.short_description) <<
"</title>\n"
91 std::cout <<
"<h1>" << to_html(meta.app_name) <<
"</h1>\n"
92 <<
"<div>" << to_html(meta.short_description) <<
"</div>\n";
98 void print_section(std::string
const & title)
102 maybe_close_paragraph();
103 std::cout <<
"<h2>" << to_html(title) <<
"</h2>\n";
109 void print_subsection(std::string
const & title)
113 maybe_close_paragraph();
114 std::cout <<
"<h3>" << to_html(title) <<
"</h3>\n";
122 void print_line(std::string
const & text,
bool line_is_paragraph)
128 std::cout <<
"<p>\n";
131 std::cout << to_html(text) <<
"\n";
132 if (line_is_paragraph)
133 maybe_close_paragraph();
135 std::cout <<
"<br>\n";
147 void print_list_item(std::string
const & term, std::string
const & desc)
150 maybe_close_paragraph();
154 std::cout <<
"<dl>\n";
157 std::cout <<
"<dt>" << to_html(term) <<
"</dt>\n"
158 <<
"<dd>" << to_html(desc) <<
"</dd>\n";
164 maybe_close_paragraph();
167 std::cout <<
"</body></html>";
174 std::string to_html(std::string
const & input)
176 std::string buffer = escape_special_xml_chars(input);
178 std::vector<std::string> open_tags;
180 for (
auto it = input.
begin(); it != input.
end(); ++it)
186 assert(!(it == input.
end()));
194 assert(!(it == input.
end()));
203 result.
append(
"<strong>");
207 assert(!open_tags.
empty());
238 std::string in_bold(std::string
const & str)
240 return "<strong>" + str +
"</strong>";
@ advanced
Definition auxiliary.hpp:256
Checks if program is run interactively and retrieves dimensions of terminal (Transferred from seqan2)...
Provides SeqAn version macros and global variables.