aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-01-24 15:40:24 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2022-01-25 11:18:00 -0500
commitf167586539641f92136ea6ffda73631973c20c43 (patch)
treeb69219a14abf055848413805646c3256288e8a7c /src/doc_reform/meta
parentxmls, html group text output (bullets & indents) (diff)
sqlite: table, topic register
Diffstat (limited to 'src/doc_reform/meta')
-rw-r--r--src/doc_reform/meta/conf_make_meta_structs.d3
-rw-r--r--src/doc_reform/meta/conf_make_meta_yaml.d53
2 files changed, 55 insertions, 1 deletions
diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d
index 7b5fe1d..878e87b 100644
--- a/src/doc_reform/meta/conf_make_meta_structs.d
+++ b/src/doc_reform/meta/conf_make_meta_structs.d
@@ -249,7 +249,10 @@ struct MetaComposite {
string classify_loc;
string classify_subject;
string classify_topic_register;
+ string classify_topic_register_json; // experimental use in sqlite topics table
string[] classify_topic_register_arr;
+ string[] classify_topic_register_json_arr; // experimental use in sqlite topics table
+ string[] classify_topic_register_expanded_arr; // experimental use in sqlite topics table
string[] creator_author_arr;
string creator_author;
string creator_author_surname_fn;
diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d
index f1959d0..71befdc 100644
--- a/src/doc_reform/meta/conf_make_meta_yaml.d
+++ b/src/doc_reform/meta/conf_make_meta_yaml.d
@@ -956,6 +956,42 @@ template contentYAMLtoSpineStruct() {
&& _yaml["classify"]["topic_register"].tag.match(rgx.yaml_tag_is_str)
) {
_struct_composite.meta.classify_topic_register = _yaml["classify"]["topic_register"].get!string;
+ if (_struct_composite.meta.classify_topic_register.length > 0) {
+ auto wrds = ctRegex!(`([\wa-zA-Z(). -]+)`); // ctRegex!(`([(]?\w+[a-zA-Z(). -]*)+`);
+ auto mkp_delim = ctRegex!(`:([^:]+?)(;|$)`);
+ string _topic_register = _struct_composite.meta.classify_topic_register;
+ _topic_register = _topic_register
+ .replaceAll(wrds, "\"$1\"")
+ .replaceAll(mkp_delim, ":$1$2");
+ string[] _topics_json_arr;
+ //+
+ foreach (_topic; _topic_register.split(";")) {
+ while (_topic.match(":")) {
+ foreach (m; _topic.match(":")) {
+ _topic = m.pre ~ " ☼ [ " ~ m.post ~ " ] ";
+ }
+ }
+ _topics_json_arr ~= (" ") ~ (_topic
+ .split("☼").join(":")
+ .split("|").join(", "));
+ }
+ // +/
+ /+
+ foreach (_topic; _topic_register.split(";")) {
+ while (_topic.match(":")) {
+ foreach (m; _topic.match(":")) {
+ _topic = m.pre ~ " ☼ { " ~ m.post ~ " } ";
+ }
+ }
+ _topics_json_arr ~= (" { ") ~ (_topic
+ .split("☼").join(":")
+ .split("|").join(", "))
+ ~ " }";
+ }
+ +/
+ _struct_composite.meta.classify_topic_register_json_arr = _topics_json_arr;
+ _struct_composite.meta.classify_topic_register_json = "{\n" ~ _topics_json_arr.join(",\n") ~ "\n}";
+ }
string[] main_topics_ = _struct_composite.meta.classify_topic_register.strip.split(rgx.topic_register_main_terms_split);
string[] topics;
string topics_tmp;
@@ -971,8 +1007,23 @@ template contentYAMLtoSpineStruct() {
topics ~= topics_tmp;
}
}
- // writeln("--> ", topics);
_struct_composite.meta.classify_topic_register_arr = topics;
+ string[] topics_expanded;
+ if (_struct_composite.meta.classify_topic_register_arr.length > 0) {
+ foreach (i, topic; _struct_composite.meta.classify_topic_register_arr) {
+ string[] subject_tree = topic.split(mkup.sep);
+ if (topic.length > 0) {
+ topics_expanded ~= subject_tree.join(", ");
+ }
+ }
+ }
+ _struct_composite.meta.classify_topic_register_expanded_arr = topics_expanded;
+ // writeln("\n------\n", _struct_composite.meta.title_full);
+ // writeln(_struct_composite.meta.classify_topic_register);
+ // writeln(_struct_composite.meta.classify_topic_register_json_arr);
+ // writeln(_struct_composite.meta.classify_topic_register_json);
+ // writeln(_struct_composite.meta.classify_topic_register_expanded_arr.sort.join("\n"));
+ // writeln(_struct_composite.meta.classify_topic_register_arr);
}
}
}