Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
So, I notice that the selection of files (via the glob sent into build html multi) is done at the same step as when files are rendered
however, I need to insert a previous step
basically soemthing like
right now in order to do this, I am learning shake APIs
I figure I can use writeHtml itself manually
if you have any thoughts, please let me know, i might be missing something
buildHtmlMulti is a small function, composing two other functions: getDirectoryFiles' and buildHtml. And buildHtml too is a small function composing two other functions: readSource and writeHtml. You can always use these other functions to do what you specifically want.
The only recommended 'requirement' is that you use writeHtml (or writeFileCached if writing a non-HTML) ultimately, to actually write the generated file to disk, because it takes care of caching it using the mechanism provided by Shake (so you never write the same file twice, unnecessarily)
Aside from that, you can drop down to the low-level of Shake and use that if you want. After all the third argument to Rib.App.run is simply a shake's Action monad.
(Of course, use ribInputDir and ribOutDir to get the two directory arguments you passed to run)
Here's an example: https://github.com/open-editions/open-editions.org/pull/5/files#diff-98a3ddc5c474fd14c4ee9401c03197a1R113
In a way, ultimately you can dropdown to Shake and use only readSource and writeHtml from Rib.Shake without bothering about the higher-level functions.
In 0.6 all these functions in Rib/Shake.hs have been dramatically simplified, so take a look at the source. The intention is to let the user use what they want, and skip the rest. These functions can also provide a 'template' for writing your own.
good advice, thanks, I think this looks like its going to work.