diff options
Diffstat (limited to 'src/sisudoc/outputs/io_out/paths_output.d')
| -rw-r--r-- | src/sisudoc/outputs/io_out/paths_output.d | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/sisudoc/outputs/io_out/paths_output.d b/src/sisudoc/outputs/io_out/paths_output.d index 3d8323d..df0583c 100644 --- a/src/sisudoc/outputs/io_out/paths_output.d +++ b/src/sisudoc/outputs/io_out/paths_output.d @@ -669,6 +669,54 @@ template spinePathsSQLite() { } } +/+ ↓ 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(); + } +} template spinePathsText() { import std.conv; auto spinePathsText(M)( |
