Skip to content

Instantly share code, notes, and snippets.

@masak
Last active January 10, 2019 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masak/5652339 to your computer and use it in GitHub Desktop.
Save masak/5652339 to your computer and use it in GitHub Desktop.
objects and operations in Dark needed for my blog
Pipe (for example set, convert, publish, take)
---- \ ----
---- \ ----
---- / ----
---- / ----
Funnel (for example aggregate)
---- \
---- \ ____
---- /
---- /
Source (for example feed)
\ ----
\ ----
/ ----
/ ----
Sink (for example into, which can do items or lists)
---- \
---- \
---- /
---- /
Dummy::List
Dummy::Item
feed Source take all the files in $directory and make items from it
set Pipe add $property with $value
convert Pipe pass $property through &filter and add it back
publish Pipe pass the whole object to $template, setting a 'result' property
take Pipe retain only the first $n objects
aggregate Funnel pass (@objects>>{'result'}).join to $template, getting *one* object back with 'result'
into Sink write 'result' into $file
<japhb> masak, my first thought is a lack of m:n converters: reduce, expand, what have you. For example, "Bin these posts
by month for archive links"
<japhb> "Extract all SVG images from all posts" => "and convert to PNG"
<japhb> Or rather:
<japhb> "All posts" => "Extract all SVG images" => "convert to PNG" => "store PNG files"
<japhb> Almost wants some way to split a pipe, or "keep a copy" of the temporary state, so that you can then go back and
add PNG links next to the inline SVG everywhere.
<japhb> Or perhaps that's just a second pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment