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.org55
1 files changed, 55 insertions, 0 deletions
diff --git a/org/default_paths.org b/org/default_paths.org
index f10f131..0a4af80 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_typst_pdf>>
<<template_paths_text>>
<<template_paths_skel>>
#+END_SRC
@@ -1746,6 +1747,60 @@ template spinePathsSQLite() {
}
#+END_SRC
+** _typst_ :typst:pdf:
+
+#+NAME: template_paths_typst_pdf
+#+BEGIN_SRC d
+/+ ↓ 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
+ .typ names them by path. The pdfs go where the latex path's pdfs go, under
+ the same names, so that a site built either way looks the same.
++/
+template spinePathsTypst() {
+ import std.conv;
+ auto spinePathsTypst(M)(
+ M doc_matters,
+ ) {
+ auto out_pth = spineOutPaths!()(doc_matters.output_path, doc_matters.src.language);
+ struct _PathsStruct {
+ /+ ↓ as latex: the .typ and the pdfs made from it carry the names the
+ .tex and its pdfs carried, so that a site built either way is the
+ same site and the html's pdf links resolve
+ +/
+ string base_filename(string fn_src) {
+ return fn_src.baseName.stripExtension;
+ }
+ string base_pth() {
+ return (((out_pth.output_root).chainPath("typst")).asNormalizedPath).array;
+ }
+ string typst_file() {
+ // return ((base_pth.chainPath(doc_matters.src.doc_uid_out ~ ".typ")).asNormalizedPath).array;
+ return ((base_pth.chainPath(base_filename(doc_matters.src.filename)
+ ~ "." ~ doc_matters.src.language
+ ~ ".typ")
+ ).asNormalizedPath).array;
+ }
+ string images() {
+ return (((base_pth).chainPath("image")).asNormalizedPath).array;
+ }
+ string pdf_pth() {
+ return (((out_pth.output_root).chainPath("pdf")).asNormalizedPath).array;
+ }
+ string pdf_file_with_path(string paper_size_orientation) {
+ // return ((pdf_pth.chainPath(doc_matters.src.doc_uid_out
+ return ((pdf_pth.chainPath(base_filename(doc_matters.src.filename)
+ ~ "." ~ doc_matters.src.language
+ ~ "." ~ paper_size_orientation
+ ~ ".pdf")
+ ).asNormalizedPath).array;
+ }
+ }
+ return _PathsStruct();
+ }
+}
+#+END_SRC
+
** _text_ :text:
#+NAME: template_paths_text