17#define izzi_TABLES_H 1
24using std::ostringstream;
34 std::chrono::year_month_day ymd;
35 std::stringstream ss(ds);
37 if (std::chrono::from_stream(ss,
"%F", ymd))
38 ds_long = std::format(
"{:%B %d, %Y}", ymd);
41 std::cerr <<
"datestamp_to_html_time:: error with datestamp '"
42 << ds <<
"'" << std::endl;
46 html_element =
"<time datetime=";
47 html_element += k::quote;
49 html_element += k::quote;
50 html_element += k::space;
51 html_element +=
"aria-label=";
52 html_element += k::quote;
53 html_element += ds_long;
54 html_element += k::quote;
56 html_element += k::space;
58 html_element += k::space;
59 html_element +=
"</time>";
68 string_view img2src, string_view img2alt)
74 constexpr const char* tdblank = R
"_delimiter_(<th style="padding: 5px;"><img src="{{}}" alt="{{}}" width="50%"></th>)_delimiter_";
89 const string tblstart = R
"_delimiter_(<table style="border-collapse: collapse; width: 100%;">)_delimiter_";
90 const string tblend =
"</table>";
102 const string metricf = gtitlelc +
"-image-table.html";
103 std::ofstream ofs(metricf);
133 const string metricf = gtitlelc +
"-meta-collection-table.html";
134 std::ofstream ofs(metricf);
137 const string thead = R
"_delimiter_(
140 <th rowspan="2" width="25%">duration</th>
141 <th rowspan="2" width="25%">btiha size</th>
142 <th colspan="2" width="25%">downloaders</th>
143 <th colspan="2" width="25%">uploaders</th>
154 ofs.imbue(std::locale(""));
155 ofs << std::fixed << std::setprecision(0);
159 string tts(gtitlelc);
160 std::ranges::replace(tts, k::hyphen, k::space);
186 const uint weeksn,
const string sdates)
189 oss.imbue(std::locale(
""));
190 oss << std::fixed << std::setprecision(0);
constexpr char newline('\n')
string serialize_row_6c_8f(const string moname, const uint btihasz, const uint dl, const uint ul, const uint weeksn, const string sdates)
Serialize row of media object information.
void serialize_2_image_table(const string >itlelc)
Serialize borderless image table.
string iso_datestamp_string_to_html_time(const string ds)
Converts ISO datestamp to human-readable long form with month names.
string serialize_row_2c_4f(string_view img1src, string_view img1alt, string_view img2src, string_view img2alt)
void serialize_meta_collection_table(const string >itlelc, const string sdur, const uint btihasz, const uint dl, const uint ul)
Serialize information about the analysis passes as an html table. Flatten all objects into one total ...