Journal 2025-03-04
Continuing the rendering of SPARQL store content to HTML files for my docs (including this blog).
I want the content that originated at :
/home/danny/hyperdata/transmissions/src/applications/md-to-sparqlstore/data/input/input2.md
to be rendered at :
/home/danny/sites/strandz.it/postcraft/public/data/input/2025-02-11/input2.html
The FileWriter processor uses getProperty(ns.trn.destinationFile)
The StringOps processor should now be able to do the necessary.
Invoked in the #:transmission with :
...
:p80 a :StringOps ;
:settings :filenameConstructor .
:p90 a :FileWriter .
Settings from :
:filenameConstructor a :ConfigSet ;
:asPath true ;
:targetField "destinationFile" ;
:values (:a :b :c :d) .
:a :field "targetPath" .
:b :field "currentItem.relPath.value" .
:c :field "currentItem.slug.value" .
:d :string ".html" .
Oh, silly me, I get paths like:
"destinationFile": "/home/danny/sites/strandz.it/postcraft/data/input/2025-02-11/input2/.html"
I'll have to think about how to do this better, but given that I already put string concat support in StringOps, easy addition should do it:
:p80 a :StringOps ;
:settings :filenameConstructor .
:p90 a :StringOps ;
:settings :filenameExtension .
:filenameConstructor a :ConfigSet ;
:asPath true ;
:targetField "temp" ;
:values (:a1 :b1 :c1) .
:a1 :field "targetPath" .
:b1 :field "currentItem.relPath.value" .
:c1 :field "currentItem.slug.value" .
:filenameExtension a :ConfigSet ;
:asPath false ;
:targetField "destinationFile" ;
:values (:a2 :b2 ) .
:a2 :field "temp" .
:b2 :string ".html" .
Yay!
"destinationFile": "/home/danny/sites/strandz.it/postcraft/data/input/2025-02-11/input2.html"
Ok, so when I'm runn