aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/outputs/io_out/paths_output.d
diff options
context:
space:
mode:
Diffstat (limited to 'src/sisudoc/outputs/io_out/paths_output.d')
-rw-r--r--src/sisudoc/outputs/io_out/paths_output.d54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/sisudoc/outputs/io_out/paths_output.d b/src/sisudoc/outputs/io_out/paths_output.d
index df0583c..8c6a573 100644
--- a/src/sisudoc/outputs/io_out/paths_output.d
+++ b/src/sisudoc/outputs/io_out/paths_output.d
@@ -669,6 +669,60 @@ template spinePathsSQLite() {
}
}
+/+ ↓ 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();
+ }
+}
/+ ↓ where the typst output goes.
One .typ per document-language, because the paper is an input to the
compile rather than a thing compiled in, and the images beside it because a