module doc_reform.meta.metadoc_harvests_authors; import std.algorithm, std.array, std.exception, std.regex, std.stdio, std.string, std.conv : to; import doc_reform.meta.defaults, doc_reform.meta.rgx; mixin DocReformHarvest; mixin InternalMarkup; mixin DocReformRgxInit; template DocReformMetaDocHarvestsAuthors() { auto mkup = InlineMarkup(); void DocReformMetaDocHarvestsAuthors(H,O)( H harvests, O _opt_action, ) { string theme_dark_0 = format(q"┃ body { color : #CCCCCC; background : #000000; background-color : #000000; } a:link { color : #FFFFFF; text-decoration : none; } a:visited { color : #999999; text-decoration : none; } a:hover { color : #000000; background-color : #555555; } a:hover img { background-color : #000000; } a:active { color : #888888; text-decoration : underline; } ┃"); string theme_light_0 = format(q"┃ body { color : #000000; background : #FFFFFF; background-color : #FFFFFF; } a:link { color : #003399; text-decoration : none; } a:visited { color : #003399; text-decoration : none; } a:hover { color : #000000; background-color : #f9f9aa; } a:hover img { background-color : #FFFFFF; } a:active { color : #003399; text-decoration : underline; } ┃"); string theme_dark_1 = format(q"┃ h1 { color : #FFFFFF; background : #000000; } p.letter { color : #FFFFFF; background : #333333; } p.lev0 { color : #FFFFFF; background : #000000; } p.lev1 { color : #FFFFFF; background : #333333; } p.lev2 { background : #555555; } p.lev3 { background : #777777; } p.lev4 { background : #AAAAAA; } p.lev5 { } ┃"); string theme_light_1 = format(q"┃ h1 { color : #FFFFFF; background : #000088; } p.letter { color : #FFFFFF; background : #880000; } p.lev0 { color : #FFFFFF; background : #000000; } p.lev1 { color : #FFFFFF; background : #444444; } p.lev2 { background : #888888; } p.lev3 { background : #BBBBBB; } p.lev4 { background : #EEEEEE; } p.lev5 { } ┃"); string[] authors = []; authors ~= format(q"┃
[ HOME ] also see Metadata Harvest - Topics
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, ┃", _opt_action.css_theme_default ? theme_light_0 : theme_dark_0, _opt_action.css_theme_default ? theme_light_1 : theme_dark_1, ) ~ "\n"; string[string] _au; string[] _auth_date_title; string[] _author_date_title; string _prev_auth = ""; char _prev_k = "_".to!char; foreach(doc_harvest; harvests .multiSort!( "toUpper(a.author_surname_fn) < toUpper(b.author_surname_fn)", "a.date_published < b.date_published", "a.title < b.title", SwapStrategy.unstable ) ) { if (doc_harvest.author_surname_fn != _prev_auth) { _au[doc_harvest.author_surname_fn] = format(q"┃
%s "%s" [%s]
┃", doc_harvest.author_surname, doc_harvest.author_surname_fn, (doc_harvest.date_published.length > 0) ? doc_harvest.date_published : "", doc_harvest.path_html_segtoc, doc_harvest.title, doc_harvest.language, ); _prev_auth = doc_harvest.author_surname_fn; } else { _au[doc_harvest.author_surname_fn] ~= format(q"┃%s "%s" [%s]
┃", (doc_harvest.date_published.length > 0) ? doc_harvest.date_published : "", doc_harvest.path_html_segtoc, doc_harvest.title, doc_harvest.language, ); } _author_date_title ~= format(q"┃%s %s "%s" [%s]%s┃", doc_harvest.author_surname_fn, (doc_harvest.date_published.length > 0) ? "(" ~ doc_harvest.date_published ~ ")" : "", doc_harvest.title, doc_harvest.language, (_opt_action.very_verbose) ? "\n " ~ doc_harvest.path_abs_html_scroll : "", ); } foreach (k; _au.keys.sort) { if (k.toUpper.to!(char[])[0] != _prev_k) { authors ~= format(q"┃┃", k.toUpper.to!(char[])[0], k.toUpper.to!(char[])[0], ); _prev_k = k.toUpper.to!(char[])[0]; } authors ~= _au[k]; } authors ~= format(q"┃