Skip to content

Commit

Permalink
Start conversion to HTML5
Browse files Browse the repository at this point in the history
  • Loading branch information
jwakely committed Jan 25, 2024
1 parent 3c9ded3 commit 9e535b7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/report_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ void print_list(std::ostream & out, Container const & source, char const * separ
void print_file_header(std::ostream& out, std::string const & title) {
out <<
R"(<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>)" << title << R"(</title>
<style type="text/css">
<style>
p {text-align:justify}
li {text-align:justify}
blockquote.note
Expand Down Expand Up @@ -221,6 +221,7 @@ void print_table(std::ostream& out, std::vector<lwg::issue>::const_iterator i, s
std::cout << "\t" << std::distance(i,e) << " items to add to table" << std::endl;
#endif

// FIXME use CSS instead of cellpadding and align attrs.
out <<
R"(<table border="1" cellpadding="4">
<tr>
Expand All @@ -239,20 +240,20 @@ R"(<table border="1" cellpadding="4">
out << "<tr>\n";

// Number
out << "<td align=\"right\">" << make_html_anchor(*i)
out << "<td align=\"right\" id=\"" << i->num << "\">" << make_html_anchor(*i)
<< "<sup><a href=\"https://cplusplus.github.io/LWG/issue" << i->num
<< "\">(i)</a></sup></td>\n";

// Status
out << "<td align=\"left\"><a href=\"lwg-active.html#" << lwg::remove_qualifier(i->stat) << "\">" << i->stat << "</a><a name=\"" << i->num << "\"></a></td>\n";
out << "<td align=\"left\"><a href=\"lwg-active.html#" << lwg::remove_qualifier(i->stat) << "\">" << i->stat << "</a></td>\n";

// Section
out << "<td align=\"left\">";
assert(!i->tags.empty());
out << section_db[i->tags[0]] << " " << i->tags[0];
if (i->tags[0] != prev_tag) {
prev_tag = i->tags[0];
out << "<a name=\"" << as_string(prev_tag) << "\"></a>";
out << "<a id=\"" << as_string(prev_tag) << "\"></a>"; // FIXME ID attribute can't have whitespace
}
out << "</td>\n";

Expand All @@ -265,7 +266,7 @@ R"(<table border="1" cellpadding="4">
out << "Yes";
}
else {
out << "<font color=\"red\">No</font>";
out << "<font color=\"red\">No</font>"; // FIXME use CSS instead of <font>
}
out << "</td>\n";

Expand Down Expand Up @@ -300,7 +301,7 @@ void print_issue(std::ostream & out, lwg::issue const & iss, lwg::section_map &
// When printing for the list, also emit an absolute link to the individual file.
// Absolute link so that copying only the big lists elsewhere doesn't result in broken links.
if(type == print_issue_type::in_list) {
out << "<h3><a name=\"" << iss.num << "\" href=\"#" << iss.num << "\">" << iss.num << "</a>";
out << "<h3 id=\"" << iss.num << "\"><a href=\"#" << iss.num << "\">" << iss.num << "</a>";
out << "<sup><a href=\"https://cplusplus.github.io/LWG/issue" << iss.num << "\">" << "(i)</a></sup>";
}
else {
Expand All @@ -309,7 +310,7 @@ void print_issue(std::ostream & out, lwg::issue const & iss, lwg::section_map &
"for more information and the meaning of "
"<a href=\"lwg-active.html#" << lwg::remove_qualifier(iss.stat) << "\">"
<< iss.stat << "</a> status.</em></p>\n";
out << "<h3><a name=\"" << iss.num << "\" href=\"" << lwg::filename_for_status(iss.stat) << '#' << iss.num << "\">" << iss.num << "</a>";
out << "<h3 id=\"" << iss.num << "\"><a href=\"" << lwg::filename_for_status(iss.stat) << '#' << iss.num << "\">" << iss.num << "</a>";
}

// Title
Expand Down

0 comments on commit 9e535b7

Please sign in to comment.