aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/default_paths.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/default_paths.org')
-rw-r--r--org/default_paths.org61
1 files changed, 61 insertions, 0 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index 0a4af80..aa166ef 100644
--- a/org/default_paths.org
+++ b/org/default_paths.org
@@ -1049,6 +1049,7 @@ import sisudoc.ocda.meta.rgx_files;
<<template_paths_sqlite_0>>
<<template_paths_sqlite_1>>
<<template_paths_sqlite_2>>
+<<template_paths_markdown_md>>
<<template_paths_typst_pdf>>
<<template_paths_text>>
<<template_paths_skel>>
@@ -1747,6 +1748,66 @@ template spinePathsSQLite() {
}
#+END_SRC
+** _markdown_ :markdown:md:
+
+#+NAME: template_paths_markdown_md
+#+BEGIN_SRC d
+/+ ↓ where the markdown output goes.
+ .
+ <lang>/markdown/<doc>.<lang>.md, which is where the other three document
+ outputs go: html, epub and text all sit under the language, and markdown is
+ a document rather than a rendered artefact. (latex, typst and pdf are flat,
+ being the print path.) Called "markdown" and not "md" because none of its
+ four siblings is a name shortened to its extension - text is the word where
+ the extension is .txt, odf the family where it is .odt - and because "md"
+ beside the language directories reads as an eleventh language.
+ .
+ The language stays in the filename, as it does for the epub and the text,
+ because a .md is the format most likely to be copied out of the tree and the
+ directory carries the language only while the file stays in it.
+ .
+ The images are the shared set at the output root, the ones the html
+ references, not a copy: two directories down the reference is ../../image/,
+ exactly as the scroll html's is.
++/
+template spinePathsMarkdown() {
+ import std.conv;
+ auto spinePathsMarkdown(M)(
+ M doc_matters,
+ ) {
+ auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language);
+ struct _PathsStruct {
+ /+ ↓ named as the epub, the html and the latex are: from the document
+ filename and the language, not from the document uid. The uid joins the
+ pod name where the two differ, and every artefact the site links to is
+ named for the document +/
+ string base_filename(string fn_src) {
+ return fn_src.baseName.stripExtension;
+ }
+ string base_pth() {
+ return (((out_pth.output_base).chainPath("markdown")).asNormalizedPath).array;
+ }
+ string markdown_file() {
+ return ((base_pth.chainPath(base_filename(doc_matters.src.filename)
+ ~ "." ~ doc_matters.src.language
+ ~ ".md")
+ ).asNormalizedPath).array;
+ }
+ /+ ↓ the shared image directory at the output root, written by whichever
+ output gets there first and read by all of them +/
+ string images() {
+ return (((out_pth.output_root).chainPath("image")).asNormalizedPath).array;
+ }
+ /+ ↓ how the .md refers to them, from two directories down +/
+ string images_rel() {
+ return "../../image";
+ }
+ }
+ return _PathsStruct();
+ }
+}
+#+END_SRC
+
** _typst_ :typst:pdf:
#+NAME: template_paths_typst_pdf