From 0079c34ce7a524d4b93ed56191b5e7cf6a380975 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Nov 2016 10:06:47 -0400 Subject: 0.8.0 the document parts (& org babel tangle) --- org/ao_conf_make_meta.org | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'org/ao_conf_make_meta.org') diff --git a/org/ao_conf_make_meta.org b/org/ao_conf_make_meta.org index b6fcb92..fa3c88d 100644 --- a/org/ao_conf_make_meta.org +++ b/org/ao_conf_make_meta.org @@ -491,7 +491,7 @@ private auto headerNativeToAA(in char[] src_header) { auto dochead_meta = meta_aa; auto set_header = HeaderDocMetadataAndMakeNativeToAA(); char[][] source_header_arr = - split(cast(char[]) src_header, rgx.line_delimiter); + split(cast(char[]) src_header, rgx.newline_eol_delimiter); foreach(header_line; source_header_arr) { if (auto m = matchFirst(header_line, rgx.comment)) { /+ matched comment +/ @@ -573,7 +573,7 @@ final private auto headerMakeSDLang(in string src_header) { #+BEGIN_SRC d private auto headerSDLangGet(in char[] src_header) { char[][] source_header_arr = - split(cast(char[]) src_header, rgx.line_delimiter); + split(cast(char[]) src_header, rgx.newline_eol_delimiter); char[] header_clean; // TODO foreach(header_line; source_header_arr) { @@ -604,6 +604,31 @@ private auto headerSDLangGet(in char[] src_header) { 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); + if (dochead_meta["title"]["main"].empty) { + dochead_meta["title"]["main"] = + to!string(header_sdlang.maybe.tags["title"][0].values[0]); // test that this exists + } + if (!(dochead_meta["title"]["subtitle"].empty) + && (dochead_meta["title"]["sub"].empty)) { + dochead_meta["title"]["sub"] ~= dochead_meta["title"]["subtitle"]; + } + dochead_meta["title"].remove("subtitle"); + if (dochead_meta["title"]["sub"].empty) { + dochead_meta["title"]["full"] ~= dochead_meta["title"]["main"]; + } else { + dochead_meta["title"]["full"] ~= format( + "%s - %s", + dochead_meta["title"]["main"], + dochead_meta["title"]["sub"], + ); + } + dochead_meta["creator"]["author_raw"] = dochead_meta["creator"]["author"]; + string[] authors_arr; + auto authors_raw_arr = split(dochead_meta["creator"]["author"], rgx.arr_delimiter); + foreach (author_raw; authors_raw_arr) { + authors_arr ~= replace(author_raw, rgx.raw_author_munge, "$2 $1"); + } + dochead_meta["creator"]["author"] = join(authors_arr, ", ").chomp.chomp; auto t = tuple(dochead_make, dochead_meta); static assert(t.length==2); return t; -- cgit v1.2.3