21 namespace seqan3::detail
34 class format_html :
public format_help_base<format_html>
37 using base_type = format_help_base<format_html>;
46 format_html() =
default;
47 format_html(format_html
const & pf) =
default;
48 format_html & operator=(format_html
const & pf) =
default;
49 format_html(format_html &&) =
default;
50 format_html & operator=(format_html &&) =
default;
51 ~format_html() =
default;
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";
170 <<
"<strong>Last update:</strong> " << to_html(meta.date) <<
"<br>\n<strong>"
171 << meta.app_name <<
" version:</strong> " << meta.version <<
"<br>\n"
175 if (!meta.url.empty())
178 << meta.url <<
"<br>\n";
183 if ((!meta.short_copyright.empty()) || (!meta.long_copyright.empty()) || (!meta.citation.empty()))
187 if (!meta.short_copyright.empty())
188 std::cout << meta.app_name <<
" Copyright: </strong>"
189 << meta.short_copyright <<
"<br>\n<strong>";
191 std::cout <<
"SeqAn Copyright:</strong> 2006-2019 Knut Reinert, FU-Berlin; released under the 3-clause BSDL.<br>\n<strong>";
193 if (!meta.citation.empty())
194 std::cout <<
"In your academic works please cite:</strong> " << meta.citation <<
"<br>\n";
198 if (!meta.long_copyright.empty())
199 std::cout <<
"For full copyright and/or warranty information see <tt>--copyright</tt>.\n";
212 std::string buffer = escape_special_xml_chars(input);
216 for (
auto it = input.
begin(); it != input.
end(); ++it)
222 assert(!(it == input.
end()));
225 result.push_back(*it);
230 assert(!(it == input.
end()));
234 result.append(
"<em>");
239 result.append(
"<strong>");
243 assert(!open_tags.
empty());
245 result.append(open_tags.
back());
251 result.append(
"\\f");
252 result.push_back(*it);
257 result.push_back(
'\\');
258 result.push_back(*it);
263 result.push_back(*it);