diff options
author | Ralph Amissah <ralph@amissah.com> | 2016-09-12 11:04:51 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2019-04-10 15:14:13 -0400 |
commit | 650ab89ea68c7c9df94a035b7a8771c291489f30 (patch) | |
tree | ff8bd3242316a29daa6b05576faf44ed38d164ea /src/sdp/ao_conf_make_meta_sdlang.d | |
parent | heading debug info, moved (diff) |
make header_make available in creating abstract objects
Diffstat (limited to 'src/sdp/ao_conf_make_meta_sdlang.d')
-rw-r--r-- | src/sdp/ao_conf_make_meta_sdlang.d | 391 |
1 files changed, 1 insertions, 390 deletions
diff --git a/src/sdp/ao_conf_make_meta_sdlang.d b/src/sdp/ao_conf_make_meta_sdlang.d index 9369aef..9124697 100644 --- a/src/sdp/ao_conf_make_meta_sdlang.d +++ b/src/sdp/ao_conf_make_meta_sdlang.d @@ -15,7 +15,7 @@ template SiSUheaderExtractSDLang() { foreach (subtag, content; subtags) { if (!(conf_sdlang.maybe.tags[maintag].empty)) { if (!(conf_sdlang.tags[maintag][0].maybe.attributes[subtag].empty) - && (conf_sdlang.tags[maintag][0].attributes[subtag][0].value.length > 1)) { + && (conf_sdlang.tags[maintag][0].attributes[subtag][0].value.length > 0)) { debug(headersdlang) { writeln(conf_sdlang.tags[maintag][0].attributes[subtag][0].value); } @@ -235,395 +235,6 @@ template SiSUheaderExtractSDLang() { private auto headerSDLangToAAmake(Tag header_sdlang, string[string][string] dochead_make) { dochead_make = sdlangToAAmake(dochead_make, header_sdlang); auto dochead_meta = sdlangToAAmake(meta_aa, header_sdlang); - /+ - /+ dochead +/ - string hm; - string hs; - /+ meta +/ - auto dochead_meta = meta_aa; - hm = "title"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - /+ TODO Title REQUIRED +/ - hs = "main"; - if (!(header_sdlang.tags[hm].empty) - && (header_sdlang.tags[hm][0].values[0].length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].values[0]); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].values[0]); - // to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } else if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } else { - writeln("Required header metadata Title, missing"); - } - hs = "sub"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } else if (!(header_sdlang.tags[hm][0].maybe.attributes["subtitle"].empty) - && (header_sdlang.tags[hm][0].attributes["subtitle"][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes["subtitle"][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes["subtitle"][0].value); - } - // full title composite (main + sub) - // hs = "full"; - // dochead_meta[hm][hs] = dochead_meta[hm]["main"] ~ dochead_meta[hm]["sub"]; - hs = "language"; - if (!(header_sdlang.tags[hm][0].maybe.attributes["lang"].empty) - && (header_sdlang.tags[hm][0].attributes["lang"][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes["lang"][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes["lang"][0].value); - } else if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "edition"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "note"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "creator"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - /+ Creator / Author REQUIRED +/ - /+ TODO - - decide on representation for & deal with multiple authors; - - author(s) full name; - - author(s) surname & other parts - +/ - hs = "author"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "author_email"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "illustrator"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "translator"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "classify"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "dewey"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "keywords"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "loc"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "subject"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "topic_register"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "date"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "added_to_site"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "available"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "created"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "issued"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "modified"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "published"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "valid"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "identifier"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "isbn"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "oclc"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "pg"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "links"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - /+ TODO - stuff to fix - +/ - // hs = "link"; - // if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - // && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - // debug(headersdlang) { - // writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - // } - // dochead_meta[hm][hs] = - // to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - // } - } - hm = "notes"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "abstract"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "description"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "original"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "language"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "source"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "title"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "publisher"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "name"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - hm = "rights"; - if (!(header_sdlang.maybe.tags[hm].empty)) { - hs = "copyright"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "cover"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "illustrations"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - hs = "license"; - if (!(header_sdlang.tags[hm][0].maybe.attributes[hs].empty) - && (header_sdlang.tags[hm][0].attributes[hs][0].value.length > 1)) { - debug(headersdlang) { - writeln(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - dochead_meta[hm][hs] = - to!string(header_sdlang.tags[hm][0].attributes[hs][0].value); - } - } - +/ auto t = tuple(dochead_make, dochead_meta); static assert(!isTypeTuple!(t)); return t; |