From e2424c06d3bfa552f35fb288429c3ef4e5357cc7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 24 Mar 2022 12:38:41 -0400 Subject: latex output (try tidy); linebreaks more generally --- src/doc_reform/meta/conf_make_meta_yaml.d | 2 +- src/doc_reform/meta/defaults.d | 4 ++-- src/doc_reform/meta/metadoc.d | 2 +- src/doc_reform/meta/metadoc_from_src.d | 16 ++++++++-------- src/doc_reform/meta/rgx.d | 8 ++++++-- 5 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src/doc_reform/meta') diff --git a/src/doc_reform/meta/conf_make_meta_yaml.d b/src/doc_reform/meta/conf_make_meta_yaml.d index cb4a661..caf560f 100644 --- a/src/doc_reform/meta/conf_make_meta_yaml.d +++ b/src/doc_reform/meta/conf_make_meta_yaml.d @@ -84,7 +84,7 @@ template contentYAMLtoSpineStruct() { string _txt, ) { _txt = _txt - .replaceAll(regex(r"\\"), mkup.br_newline_inline) + .replaceAll(regex(r"\\"), mkup.br_line_inline) .strip; return _txt; } diff --git a/src/doc_reform/meta/defaults.d b/src/doc_reform/meta/defaults.d index ea969d5..33794b7 100644 --- a/src/doc_reform/meta/defaults.d +++ b/src/doc_reform/meta/defaults.d @@ -184,8 +184,8 @@ template InternalMarkup() { string mark_internal_site_lnk = "¤"; string nbsp = "░"; string br_line = "┘"; - string br_newline_inline = "┙"; - string br_paragraph = "┚"; + string br_line_inline = "┙"; + string br_line_spaced = "┚"; string br_obj = "break_obj"; string br_page_line = "┼"; string br_page = "┿"; diff --git a/src/doc_reform/meta/metadoc.d b/src/doc_reform/meta/metadoc.d index b912c24..194890f 100644 --- a/src/doc_reform/meta/metadoc.d +++ b/src/doc_reform/meta/metadoc.d @@ -121,7 +121,7 @@ template spineAbstraction() { return "https://sisudoc.org"; } @safe string url_git() { - return "https://git.sisudoc.org/software/sisu"; + return "https://git.sisudoc.org/projects/"; } @safe auto compiler() { return program_info.compiler; diff --git a/src/doc_reform/meta/metadoc_from_src.d b/src/doc_reform/meta/metadoc_from_src.d index a9005cd..5befb23 100644 --- a/src/doc_reform/meta/metadoc_from_src.d +++ b/src/doc_reform/meta/metadoc_from_src.d @@ -913,7 +913,7 @@ template docAbstraction() { line = line ._doc_header_and_make_substitutions_(conf_make_meta) ._doc_header_and_make_substitutions_fontface_(conf_make_meta) - .replaceAll(rgx.para_delimiter, mkup.br_paragraph ~ "$1"); + .replaceAll(rgx.para_delimiter, mkup.br_line_spaced ~ "$1"); an_object = line.flow_txt_block_group(an_object, pith); continue; } else if (pith["block_is"] == eN.blk_is.block) { @@ -4060,11 +4060,11 @@ template docAbstraction() { an_object[an_object_key] = an_object[an_object_key] .replaceFirst(rgx.variable_doc_title_author_date, (conf_make_meta.meta.title_full - ~ mkup.br_newline_inline + ~ mkup.br_line_inline ~ conf_make_meta.meta.creator_author ~ " (" ~ (conf_make_meta.meta.date_published.replaceFirst(regex(r"(?:-00)+"),"")) ~ ")")) .replaceFirst(rgx.variable_doc_title, - (conf_make_meta.meta.title_full ~ mkup.br_newline_inline)) + (conf_make_meta.meta.title_full ~ mkup.br_line_inline)) .replaceFirst(rgx.variable_doc_author, conf_make_meta.meta.creator_author) .replaceFirst(rgx.variable_doc_date, @@ -4075,10 +4075,10 @@ template docAbstraction() { an_object[an_object_key] = an_object[an_object_key] .replaceFirst(rgx.variable_doc_title_author_date, (conf_make_meta.meta.title_full - ~ mkup.br_newline_inline + ~ mkup.br_line_inline ~ conf_make_meta.meta.creator_author)) .replaceFirst(rgx.variable_doc_title, - (conf_make_meta.meta.title_full ~ mkup.br_newline_inline)) + (conf_make_meta.meta.title_full ~ mkup.br_line_inline)) .replaceFirst(rgx.variable_doc_author, conf_make_meta.meta.creator_author); } else if (an_object[an_object_key].match(rgx.variable_doc_title)) { @@ -4694,7 +4694,7 @@ template docAbstraction() { obj_txt["munge"] = obj_txt_in .replaceFirst(rgx.headings, "") .replaceFirst(rgx.object_number_off_all, "") - .replaceFirst(rgx.markup_inline_linebreak, mkup.br_newline_inline) + .replaceFirst(rgx.markup_inline_linebreak, mkup.br_line_inline) .strip; TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"], reset_note_numbers); debug(munge) { @@ -4711,7 +4711,7 @@ template docAbstraction() { obj_txt["munge"] = (obj_txt_in) .replaceFirst(rgx.para_attribs, "") .replaceFirst(rgx.object_number_off_all, "") - .replaceFirst(rgx.markup_inline_linebreak, mkup.br_newline_inline); + .replaceFirst(rgx.markup_inline_linebreak, mkup.br_line_inline); TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt["munge"]); debug(munge) { writeln(__LINE__); @@ -4729,7 +4729,7 @@ template docAbstraction() { invariant() { } @safe auto munge_group(string obj_txt_in) { - TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt_in.split("\n\n").join(" \\\\\n \\\\\n")); + TxtPlusHasFootnotesUrlsImages t = object_notes_and_links_(obj_txt_in.split("\n\n").join("\n" ~ mkup.br_line_spaced ~ "\n")); // br_line br_line_inline br_line_spaced return t; } invariant() { diff --git a/src/doc_reform/meta/rgx.d b/src/doc_reform/meta/rgx.d index 8c48eac..7f4815d 100644 --- a/src/doc_reform/meta/rgx.d +++ b/src/doc_reform/meta/rgx.d @@ -229,6 +229,7 @@ static template spineRgxIn() { static spaces_keep = ctRegex!(`(?P^[ ]+|[ ]{2,})`, "mg"); // code, verse, block static spaces_line_start = ctRegex!(`^(?P[ ]+)`, "mg"); static nbsp_char = ctRegex!(`░`, "mg"); + static nbsp_chars = ctRegex!(`[░]+`, "mg"); static src_pth_sst_or_ssm = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.](?Pss[tm]))$`); static src_pth_pod_sst_or_ssm = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)media/text/[a-z]{2}/(?P[a-zA-Z0-9][a-zA-Z0-9._-]*?[.]ss[tm])$`); static src_pth_contents = ctRegex!(`^(?P[/]?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9][a-zA-Z0-9._-]*)/pod[.]manifest$`); @@ -244,9 +245,12 @@ static template spineRgxIn() { static src_formalised_file_path_parts = ctRegex!(`(?P(?:[/a-zA-Z0-9._-]+?)(?P[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure /+ line breaks +/ static br_empty_line = ctRegex!(`\n[ ]*\n`, "mg"); - static br_newlines_linebreaks = ctRegex!(`[\n┘┙]`, "mg"); + static br_linebreaks_newlines = ctRegex!(`[\n┘┙]`, "mg"); + static br_linebreaks = ctRegex!(`[┘┙]`, "mg"); static br_line = ctRegex!(`┘`, "mg"); - static br_newline_inline = ctRegex!(`┙`, "mg"); + static br_line_inline = ctRegex!(`┙`, "mg"); + static br_line_spaced = ctRegex!(`┚`, "mg"); + static brln = ctRegex!(`(?:\\\\)+`, "mg"); /+ inline markup footnotes endnotes +/ static inline_notes_al = ctRegex!(`【(?:[*+]\s+|\s*)(.+?)】`, "mg"); static inline_notes_al_special = ctRegex!(`【(?:[*+]\s+)(.+?)】`, "mg"); // TODO remove match when special footnotes are implemented -- cgit v1.2.3