17namespace sharg::detail
32class format_html :
public format_help_base<format_html>
35 using base_type = format_help_base<format_html>;
44 format_html() =
default;
45 format_html(format_html
const & pf) =
default;
46 format_html & operator=(format_html
const & pf) =
default;
47 format_html(format_html &&) =
default;
48 format_html & operator=(format_html &&) =
default;
49 ~format_html() =
default;
54 bool const advanced =
false) :
55 base_type{names, version_updates, advanced} {};
60 void maybe_close_list()
70 void maybe_close_paragraph()
83 std::cout <<
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
84 <<
"http://www.w3.org/TR/html4/strict.dtd\">\n"
85 <<
"<html lang=\"en\">\n"
87 <<
"<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n"
88 <<
"<title>" << escape_special_xml_chars(meta.app_name) <<
" — "
89 << escape_special_xml_chars(meta.short_description) <<
"</title>\n"
93 std::cout <<
"<h1>" << to_html(meta.app_name) <<
"</h1>\n"
94 <<
"<div>" << to_html(meta.short_description) <<
"</div>\n";
104 maybe_close_paragraph();
105 std::cout <<
"<h2>" << to_html(title) <<
"</h2>\n";
115 maybe_close_paragraph();
116 std::cout <<
"<h3>" << to_html(title) <<
"</h3>\n";
124 void print_line(
std::string const & text,
bool line_is_paragraph)
134 if (line_is_paragraph)
135 maybe_close_paragraph();
152 maybe_close_paragraph();
159 std::cout <<
"<dt>" << to_html(term) <<
"</dt>\n"
160 <<
"<dd>" << to_html(desc) <<
"</dd>\n";
166 maybe_close_paragraph();
178 std::string buffer = escape_special_xml_chars(input);
182 for (
auto it = input.
begin(); it != input.
end(); ++it)
188 assert(!(it == input.
end()));
196 assert(!(it == input.
end()));
205 result.
append(
"<strong>");
209 assert(!open_tags.
empty());
242 return "<strong>" + str +
"</strong>";
update_notifications
Indicates whether application allows automatic update notifications by the sharg::parser.
Definition: auxiliary.hpp:29