diff options
Diffstat (limited to 'org/default_misc.org')
-rw-r--r-- | org/default_misc.org | 375 |
1 files changed, 0 insertions, 375 deletions
diff --git a/org/default_misc.org b/org/default_misc.org index 9129db2..2fcef58 100644 --- a/org/default_misc.org +++ b/org/default_misc.org @@ -24,10 +24,6 @@ default settings +/ module sdp.meta.defaults; -template SiSUregisters() { - <<meta_defaults_imports>> - <<meta_defaults_template_registers>> -} <<meta_defaults_template_init_flags>> <<meta_defaults_template_node>> <<meta_defaults_template_biblio>> @@ -35,377 +31,6 @@ template SiSUregisters() { <<defaults_template_language_codes>> #+END_SRC -** imports - -#+name: meta_defaults_imports -#+BEGIN_SRC d -import - std.algorithm, - std.array, - std.container, - std.exception, - std.file, - std.getopt, - std.json, - std.path, - std.process, - std.range, - std.regex, - std.stdio, - std.string, - std.traits, - std.typecons, - std.uni, - std.utf, - std.conv : to; -#+END_SRC - -** struct ConfComposite - -#+name: meta_defaults_template_registers -#+BEGIN_SRC d -struct ConfCompositeMake { - string bold = ""; - string breaks = ""; - string cover_image = ""; - string css = ""; - string emphasis = ""; - string footer = ""; - string headings = ""; - string home_button_image = ""; - string home_button_text = ""; - string italics = ""; - string num_top = ""; - string num_depth = ""; - string substitute = ""; - string texpdf_font = ""; -} -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 = ""; - string italics = ""; - string num_top = ""; - string num_depth = ""; - 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; - ConfCompositeMake make; - ConfCompositeSiteLocal conf; -} -struct ConfCompositePlus { - MetaComposite meta; - ConfCompositeMake make; - ConfCompositeMakeStr make_str; - ConfCompositeSiteLocal conf; -} -#+END_SRC - -** extractSDLangTabOrAttrib - -#+name: meta_defaults_template_registers -#+BEGIN_SRC d -string extractSDLangTabOrAttrib(S)(S conf_sdlang, string maintab, string atab) { - string _conf_composite_string = ""; - if (maintab in conf_sdlang.maybe.tags) { - auto _maintag = conf_sdlang.getTag(maintab); - if ((atab in _maintag.maybe.tags) - && (_maintag.getTagValues(atab).length > 0)) { - debug(configsdlang) { - writeln(__LINE__, ": make:", atab, ": ", _maintag.getTagValues(atab)[0]); - } - if (_maintag.getTagValues(atab).length == 1) { - writeln((_maintag.getTagValues(atab)[0]).to!string); - _conf_composite_string = (_maintag.getTagValues(atab)[0]).to!string; - } else if (_maintag.getTagValues(atab).length > 1) { - string _tmp = ""; - foreach (st; _maintag.getTagValues(atab)) { - writeln(st.to!string, ";"); - _tmp ~= st.to!string ~ ";"; - } - _conf_composite_string = _tmp; - } - } else if ((atab in _maintag.maybe.attributes) - && (_maintag.maybe.attributes[atab][0].value.length > 0)) { - debug(configsdlang) { - writeln(__LINE__, ": make:", atab, ": ", conf_sdlang.tags[maintag][0].attributes[atab][0].value); - } - _conf_composite_string = (_maintag.attributes[atab][0].value).to!string; - } - } - return _conf_composite_string; -} -#+END_SRC - -** metadata associative array indexes :header: - -#+name: meta_defaults_template_registers -#+BEGIN_SRC d -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", - "num_top", "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 = `{ -}`; -#+END_SRC - -*** notes headers - -#+name: meta_defaults_template -#+BEGIN_SRC d -/+ - /+ - unify internal representation of header info for native & sdlang document headers - represent either using struct, hashes or possibly json - sdp internal representation should be identical for native & sdlang variants - +/ -header. - ├── make // make instructions - │ ├── bold - │ ├── breaks - │ ├── cover_image - │ ├── css - │ ├── emphasis - │ ├── footer - │ ├── headings - │ ├── home_button_image - │ ├── home_button_text - │ ├── italics - │ ├── num_top - │ ├── substitute - │ └── texpdf_font - └── meta // metadata - ├── author // move author to creator:author - ├── classify - │ ├── dewey - │ ├── keyword - │ ├── loc - │ ├── subject - │ └── topic_register - ├── creator - │ ├── author - │ │ ├── [ [first_name: x0, last_name: y0], [first_name: x1, last_name: y1] ] - │ │ └── [ full_name0, full_name1 ] - │ ├── author_email - │ ├── illustrator - │ └── translator - ├── date - │ ├── added_to_site - │ ├── available - │ ├── created - │ ├── issued - │ ├── modified - │ ├── published - │ └── valid - ├── identifier - │ ├── isbn - │ ├── oclc - │ └── pg - ├── links - ├── notes - │ ├── abstract - │ └── description - ├── original - │ ├── language - │ ├── source - │ └── title - ├── publisher - │ └── name - ├── rights - │ ├── copyright - │ ├── cover - │ ├── illustrations - │ └── license - └── title // move title: to title:main - ├── edition - ├── [ full (main + sub) ] - ├── language - ├── main - ├── note - ├── sub - └── subtitle // move title:subtitle to title:sub - -61 leaves -+/ -#+END_SRC - ** template: flags regex initialize :regex_flags: #+name: meta_defaults_template_init_flags |