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: black; 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: white; background: #000000; } p.letter { color: white; background: #333333; } p.lev0 { color: white; background: #000000; } p.lev1 { color: white; background: #333333; } p.lev2 { background: #555555; } p.lev3 { background: #777777; } p.lev4 { background: #aaaaaa; } p.lev5 { } ┃"); string theme_light_1 = format(q"┃ h1 { color: white; background: #000088; } p.letter { color: white; background: #880000; } p.lev0 { color: white; background: #000000; } p.lev1 { color: white; background: #444444; } p.lev2 { background: #888888; } p.lev3 { background: #bbbbbb; } p.lev4 { background: #eeeeee; } p.lev5 { } ┃"); string[] authors = []; authors ~= format(q"┃ Metadata Harvest - Authors

Metadata Harvest - Authors (output organised by language & filetype)

[ HOME ] also see Metadata Harvest - Topics


English   


ABCDEFGHIJKLMNOPQRSTUVWXYZ,  ┃", _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" [%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]┃", doc_harvest.author_surname_fn, (doc_harvest.date_published.length > 0) ? "(" ~ doc_harvest.date_published ~ ")" : "", doc_harvest.title, doc_harvest.language, ); } foreach (k; _au.keys.sort) { if (k.toUpper.to!(char[])[0] != _prev_k) { authors ~= format(q"┃

%s

┃", k.toUpper.to!(char[])[0], k.toUpper.to!(char[])[0], ); _prev_k = k.toUpper.to!(char[])[0]; } authors ~= _au[k]; } authors ~= format(q"┃
┃") ~ "\n"; import doc_reform.output.paths_output; auto out_pth = DocReformPathsHTML!()(_opt_action.output_dir_set, ""); try { auto f = File(out_pth.harvest("authors.html"), "w"); foreach (o; authors) { f.writeln(o); } } catch (ErrnoException ex) { // Handle error } if (_opt_action.verbose || _opt_action.very_verbose ) { foreach(_adt; _author_date_title.sort) { writeln(_adt); } } } }