aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/meta/conf_make_meta_structs.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-09-10 18:15:02 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2019-04-10 15:14:15 -0400
commite95c49b76f4ac7bf72c383ee43a0567dfcbf1603 (patch)
treeb3aec9058f69be0047bb526052f8deefb5d97463 /src/doc_reform/meta/conf_make_meta_structs.d
parentmaker, subprojects arrange, minor (diff)
0.1.0 renamed doc-reform, doc_reform (& rad)
- from sdp
Diffstat (limited to 'src/doc_reform/meta/conf_make_meta_structs.d')
-rw-r--r--src/doc_reform/meta/conf_make_meta_structs.d328
1 files changed, 328 insertions, 0 deletions
diff --git a/src/doc_reform/meta/conf_make_meta_structs.d b/src/doc_reform/meta/conf_make_meta_structs.d
new file mode 100644
index 0000000..cf279a5
--- /dev/null
+++ b/src/doc_reform/meta/conf_make_meta_structs.d
@@ -0,0 +1,328 @@
+module doc_reform.meta.conf_make_meta_structs;
+import
+ std.exception,
+ std.json,
+ std.regex,
+ std.stdio,
+ std.string,
+ std.traits,
+ std.typecons,
+ std.utf,
+ std.conv : to;
+import
+ doc_reform.meta.defaults,
+ doc_reform.meta.rgx;
+mixin SiSUrgxInit;
+static auto _rgx = Rgx();
+mixin InternalMarkup;
+auto _mkup = InlineMarkup();
+auto url_markup(string line) {
+ auto line_ = (line)
+ .replaceAll(
+ _rgx.smid_inline_link_markup_regular,
+ ("$1"
+ ~ _mkup.lnk_o ~ "$2" ~ _mkup.lnk_c
+ ~ _mkup.url_o ~ "$3" ~ _mkup.url_c
+ ~ "$4") // ("$1{ $2 }$3$4")
+ )
+ .replaceAll(
+ _rgx.smid_inline_link_naked_url,
+ ("$1"
+ ~ _mkup.lnk_o ~ "$2" ~ _mkup.lnk_c
+ ~ _mkup.url_o ~ "$2" ~ _mkup.url_c
+ ~ "$3") // ("$1{ $2 }$2$3")
+ )
+ .replaceAll(
+ _rgx.arr_delimiter,
+ _mkup.br_line
+ );
+ return line_;
+}
+struct ConfCompositeMakeStr {
+ string bold;
+ string breaks;
+ string cover_image;
+ string css;
+ string emphasis;
+ string[] footer;
+ string[] headings;
+ string[] home_button_image;
+ string home_button_text = "{Doc Reform}http://www.doc-reform.org;"
+ ~ " {www.doc-reform.org}http://www.doc-reform.org;"
+ ~ " {sources / git}https://git.doc-reform.org/software/doc-reform";
+ string italics;
+ string auto_num_top_at_level;
+ int auto_num_top_lv = 9;
+ int auto_num_depth = 2;
+ string[][] substitute;
+ string texpdf_font;
+}
+struct confCompositeMakeBuild {
+ auto bold(string _mk) {
+ string[] _out;
+ if (_mk) {
+ _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "*{$1}*", "<b>$1</b>"];
+ }
+ return _out;
+ }
+ auto breaks(string _mk) {
+ return _mk;
+ }
+ auto cover_image(string _mk) {
+ return _mk;
+ }
+ auto css(string _mk) {
+ return _mk;
+ }
+ auto emphasis(string _mk) {
+ string[] _out;
+ if (_mk) {
+ _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "!{$1}!", "<em>$1</em>" ];
+ }
+ return _out;
+ }
+ auto footer(string[] _mk) {
+ string line_;
+ string[] _mk2;
+ foreach (line; _mk) {
+ _mk2 ~= url_markup(line);
+ }
+ return _mk2;
+ }
+ auto headings(string[] _mk) {
+ return _mk;
+ }
+ auto home_button_image(string[] _mk) {
+ return _mk;
+ }
+ auto home_button_text(string _mk) {
+ return url_markup(_mk);
+ }
+ auto italics(string _mk) {
+ string[] _out;
+ if (_mk) {
+ _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "/{$1}/", "<i>$1</i>" ];
+ }
+ return _out;
+ }
+ auto auto_num_top_at_level(string _mk) {
+ return _mk;
+ }
+ auto auto_num_top_lv(int _mk) {
+ return _mk;
+ }
+ auto auto_num_depth(int _mk) {
+ return _mk;
+ }
+ auto substitute(string[][] _mk) {
+ return _mk;
+ }
+ auto texpdf_font(string _mk) {
+ return _mk;
+ }
+}
+struct ConfCompositeMakeInit {
+ string[] bold;
+ string breaks;
+ string cover_image;
+ string css;
+ string[] emphasis;
+ string[] footer;
+ string[] headings;
+ string[] home_button_image;
+ string home_button_text = "{Doc Reform}http://www.doc-reform.org;"
+ ~ " {www.doc-reform.org}http://www.doc-reform.org;"
+ ~ " {sources / git}https://git.doc-reform.org/software/doc-reform";
+ string[] italics;
+ string auto_num_top_at_level;
+ int auto_num_top_lv = 9;
+ int auto_num_depth = 2;
+ string[][] substitute;
+ string texpdf_font;
+}
+struct ConfCompositeSiteLocal {
+ string webserv_url_root;
+ string webserv_path;
+ string webserv_images;
+ string webserv_cgi;
+ string webserv_cgi_host;
+ string webserv_cgi_host_path;
+ string webserv_cgi_port;
+ string webserv_cgi_user;
+ string webserv_cgi_file_links;
+ string processing_path;
+ string processing_dir;
+ string processing_concord_max;
+ string flag_act0;
+ string flag_act1;
+ string flag_act2;
+ string flag_act3;
+ string flag_act4;
+ string flag_act5;
+ string flag_act6;
+ string flag_act7;
+ string flag_act8;
+ string flag_act9;
+ string default_papersize;
+ string default_text_wrap;
+ string default_emphasis;
+ string default_language;
+ string default_digest;
+ string permission_share_source;
+ string search_flag;
+ string search_action;
+ string search_db;
+ string search_title;
+}
+struct MetaComposite {
+ string classify_dewey;
+ string classify_keywords;
+ string classify_loc;
+ string classify_subject;
+ string classify_topic_register;
+ string creator_author;
+ string creator_author_email;
+ string creator_illustrator;
+ string creator_translator;
+ string date_added_to_site;
+ string date_available;
+ string date_created;
+ string date_issued;
+ string date_modified;
+ string date_published;
+ string date_valid;
+ string identifier_isbn;
+ string identifier_oclc;
+ string identifier_pg;
+ string language_document;
+ string language_document_char;
+ string links;
+ string notes_abstract;
+ string notes_description;
+ string original_language;
+ string original_language_char;
+ string original_publisher;
+ string original_source;
+ string original_title;
+ string publisher;
+ string rights_copyright;
+ string rights_copyright_audio;
+ string rights_copyright_cover;
+ string rights_copyright_illustrations;
+ string rights_copyright_photographs;
+ string rights_copyright_text;
+ string rights_copyright_translation;
+ string rights_copyright_video;
+ string rights_license;
+ string title_edition;
+ string title_full;
+ string title_language;
+ string title_main;
+ string title_note;
+ string title_short;
+ string title_sub;
+ string title_subtitle;
+}
+struct ConfComposite {
+ MetaComposite meta;
+ ConfCompositeMakeInit make;
+ ConfCompositeSiteLocal conf;
+}
+struct ConfCompositePlus {
+ MetaComposite meta;
+ ConfCompositeMakeInit make;
+ ConfCompositeMakeStr make_str;
+ ConfCompositeSiteLocal conf;
+}
+static auto ptr_head_main
+ = [
+ "classify",
+ "creator",
+ "date",
+ "identifier",
+ "links",
+ "make",
+ "original",
+ "notes",
+ "rights",
+ "title"
+ ];
+static auto ptr_head_sub_classify
+ = [
+ "dewey",
+ "keywords",
+ "loc",
+ "subject",
+ "topic_register"
+ ];
+static auto ptr_head_sub_creator
+ = [
+ "author",
+ "author_email",
+ "cover",
+ "illustrator",
+ "translator"
+ ];
+static auto ptr_head_sub_date
+ = [
+ "added_to_site",
+ "available",
+ "created",
+ "issued",
+ "modified",
+ "published",
+ "valid"
+ ];
+static auto ptr_head_sub_identifier
+ = [
+ "isbn",
+ "oclc",
+ "pg"
+ ];
+/+ make +/
+static auto ptr_head_sub_make
+ = [
+ "cover_image",
+ "home_button_image",
+ "home_button_text",
+ "footer", "headings",
+ "auto_num_top_at_level", "auto_num_top_lv", "auto_num_depth",
+ "breaks",
+ "substitute",
+ "bold",
+ "italics",
+ "emphasis",
+ "texpdf_font",
+ "css"
+ ];
+static auto ptr_head_sub_notes
+ = [
+ "abstract",
+ "description"
+ ];
+static auto ptr_head_sub_original
+ = [
+ "language",
+ "source",
+ "title"
+ ];
+static auto ptr_head_sub_publisher
+ = [ "name" ];
+static auto ptr_head_sub_rights
+ = [
+ "copyright",
+ "cover",
+ "illustrations",
+ "license"
+ ];
+static auto ptr_head_sub_title
+ = [
+ "edition",
+ "full",
+ "language",
+ "main",
+ "note",
+ "sub"
+ ];
+auto config_jsonstr = `{
+}`;