aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_conf_make_meta.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-11-01 10:06:47 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit0079c34ce7a524d4b93ed56191b5e7cf6a380975 (patch)
treeaf9d3fad63937e1b8d5eefa2bdabbcea2325ce91 /org/ao_conf_make_meta.org
parentsync, fix level :A split info (diff)
0.8.0 the document parts (& org babel tangle)
Diffstat (limited to 'org/ao_conf_make_meta.org')
-rw-r--r--org/ao_conf_make_meta.org29
1 files changed, 27 insertions, 2 deletions
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;