module doc_reform.meta.conf_make_meta_structs; import std.exception, std.json, std.path, std.regex, std.stdio, std.string, std.typecons, std.utf, std.conv : to; import doc_reform.meta.defaults, doc_reform.meta.rgx; mixin spineRgxIn; static auto rgx = RgxI(); mixin InternalMarkup; static auto mkup = InlineMarkup(); @safe string url_markup(string line) { string line_ = line .replaceAll( rgx.smid_inline_link_markup_regular, ("$1" ~ mkup.lnk_o ~ "$2" ~ mkup.lnk_c ~ mkup.url_o ~ "$3" ~ mkup.url_c ) // ("$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 ) // ("$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 = "┥Spine, Doc Reform┝┤http://www.doc-reform.org├" ~ " ┥www.doc-reform.org┝┤http://www.doc-reform.org├" ~ " ┥sources / git┝┤https://git.doc-reform.org/software/spine├"; 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 { string[] bold(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "*{$1}*", "$1"]; } return _out; } string breaks(string _mk) { return _mk; } string cover_image(string _mk) { return _mk; } string css(string _mk) { return _mk; } string[] emphasis(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "!{$1}!", "$1" ]; } return _out; } string[] footer(string[] _mk) { string line_; string[] _mk2; foreach (line; _mk) { _mk2 ~= url_markup(line); } return _mk2; } string[] headings(string[] _mk) { return _mk; } string[] home_button_image(string[] _mk) { return _mk; } string home_button_text(string _mk) { return url_markup(_mk); } string[] italics(string _mk) { string[] _out; if (_mk) { _out = [ (cast(string) (`(` ~ _mk.dup ~ `)`)), "/{$1}/", "$1" ]; } return _out; } string auto_num_top_at_level(string _mk) { return _mk; } int auto_num_top_lv(int _mk) { return _mk; } int auto_num_depth(int _mk) { return _mk; } string[][] substitute(string[][] _mk) { return _mk; } string 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 = "┥Spine, Doc Reform┝┤http://www.doc-reform.org├" ~ " ┥www.doc-reform.org┝┤http://www.doc-reform.org├" ~ " ┥sources / git┝┤https://git.doc-reform.org/software/spine├"; 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 w_srv_http; string w_srv_domain; string w_srv_data_http; // if not set same as webserv_http string w_srv_data_domain; // if not set same as webserv_domain string w_srv_data_root_part; string w_srv_data_root_url; string w_srv_data_root_url_html; string w_srv_data_root_path; string w_srv_images_root_part; // string w_srv_url_doc_path; string w_srv_cgi_title; string w_srv_cgi_http; // if not set same as webserv_http string w_srv_cgi_domain; // if not set same as webserv_domain string w_srv_cgi_bin_part; string w_srv_cgi_bin_path; string w_srv_cgi_search_script; string w_srv_cgi_search_script_raw_fn_d; string w_srv_cgi_port; string w_srv_cgi_user; string w_srv_cgi_action; string w_srv_cgi_bin_url; string w_srv_db_sqlite; // string w_srv_db_pg; string w_srv_db_pg_table; string w_srv_db_pg_user; // string webserv_cgi_file_links; string output_path; 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[] set_papersize; string set_text_wrap; string set_emphasis; string set_language; string set_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[] classify_topic_register_arr; string[] creator_author_arr; string creator_author; string creator_author_surname_fn; string creator_author_surname; 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 notes_summary; 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; ConfCompositeMakeStr make_str; ConfCompositeSiteLocal conf; } JSONValue config_jsonstr = `{ }`;