diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-28 11:43:54 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-09-28 13:12:20 -0400 |
| commit | af9f8677ff80287a0c83319258261d2368e14294 (patch) | |
| tree | 2d6996ff4df1f4f32e33b44b2970b824284eb0b6 /src/sisudoc/outputs/io_out/paths_output.d | |
| parent | typst output --typist & --pdf that makes the pdf (diff) | |
markdown output, --markdown (--md)
A plain-text output that keeps the object numbers, written as CommonMark
with GFM pipe tables, one .md per document-language in <lang>/markdown/,
(linked from the metadata page) with images into that shared directory
itself, skipping any already there, so --markdown alone still gives a complete tree.
provided as an alternative to --text rather than a replacement
--markdown produces a document that renders, (both provide objext
numbering survives both. Every object carries an anchor and a
superscript number linking to itself, so a citation by object number
is a link in any markdown renderer.
--text may still be of value to read in a terminal
A note is written where it is referenced, with a link back to the
object it came from, rather than gathered into an endnotes
section.
(assisted by Claude-Code)
Diffstat (limited to 'src/sisudoc/outputs/io_out/paths_output.d')
| -rw-r--r-- | src/sisudoc/outputs/io_out/paths_output.d | 54 |
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 |
