aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sisudoc/spine.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-28 11:43:54 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-09-28 13:12:20 -0400
commitaf9f8677ff80287a0c83319258261d2368e14294 (patch)
tree2d6996ff4df1f4f32e33b44b2970b824284eb0b6 /src/sisudoc/spine.d
parenttypst 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/spine.d')
-rw-r--r--src/sisudoc/spine.d20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d
index e42a5f1..db6c8ac 100644
--- a/src/sisudoc/spine.d
+++ b/src/sisudoc/spine.d
@@ -168,6 +168,8 @@ string program_name = "spine";
"latex-header-sty" : false,
"light" : false,
"manifest" : false,
+ "markdown" : false,
+ "md" : false,
"hide-ocn" : false,
"no-ocn" : false,
"ocda-db" : false,
@@ -296,6 +298,8 @@ string program_name = "spine";
"latex-header-sty", "latex document header sty files", &opts["latex-header-sty"],
"light", "default light theme", &opts["light"],
"manifest", "process manifest output", &opts["manifest"],
+ "markdown", "markdown output (.md, CommonMark)", &opts["markdown"],
+ "md", "markdown output (--markdown)", &opts["md"],
"no-ocn", "object cite numbers", &opts["no-ocn"],
"ocda-db", "document abstraction (write ocda.db sqlite file)", &opts["ocda-db"],
"ocn-off", "object cite numbers", &opts["ocn-off"],
@@ -582,7 +586,7 @@ Verifying:
stdout.flush;
exit(_loaded.loaded ? 0 : 1);
}
- enum outTask { source_or_pod, sqlite, sqlite_multi, latex, typst, odt, epub, html_scroll, html_seg, html_stuff, text, skel }
+ enum outTask { source_or_pod, sqlite, sqlite_multi, latex, typst, markdown, odt, epub, html_scroll, html_seg, html_stuff, text, skel }
struct OptActions {
@trusted bool allow_downloads() {
return opts["allow-downloads"];
@@ -713,6 +717,9 @@ Verifying:
@trusted bool latex() {
return opts["latex"];
}
+ @trusted bool markdown() {
+ return (opts["markdown"] || opts["md"]) ? true : false;
+ }
@trusted bool typst() {
return (opts["typst"] || opts["typ"] || opts["pdf"]) ? true : false;
}
@@ -1074,6 +1081,7 @@ Verifying:
if (odt) schedule ~= outTask.odt;
if (latex) schedule ~= outTask.latex;
if (typst) schedule ~= outTask.typst;
+ if (markdown) schedule ~= outTask.markdown;
if (text) schedule ~= outTask.text;
if (skel) schedule ~= outTask.skel;
return schedule.sort().uniq;
@@ -1092,25 +1100,28 @@ Verifying:
|| odt
|| latex
|| typst
+ || markdown
+ || text
|| manifest
|| sqlite_discrete
|| sqlite_delete
|| sqlite_update
- || text
|| skel
) ? true : false;
}
@trusted bool require_processing_files() {
return (
opts["abstraction"]
- || epub
|| curate
|| html
|| html_seg
|| html_scroll
+ || epub
+ || odt
|| latex
|| typst
- || odt
+ || markdown
+ || text
|| manifest
|| show_abstraction
|| ocda_db
@@ -1121,7 +1132,6 @@ Verifying:
|| source_or_pod
|| sqlite_discrete
|| sqlite_update
- || text
|| xhtml
|| skel
) ? true : false;