With the latest master, being able to use multiple parsers in the same site can be achieved using the dependent-sum library. Using code like the following in the user Main.hs:
typeSomeSource(srcType::*->*)=Source(DSumsrcTypeIdentity)mkSomeSource::srcTypedoc->Sourcedoc->SomeSourcesrcTypemkSomeSourcet=fmap(t==>)dataSourceType::*->*whereSourceType_Markdown::SourceTypeMMarkSourceType_Entry::SourceTypeE.EntrydataTarget=Target_Index[SomeSourceSourceType]|Target_Page(SomeSourceSourceType)dataMarkdownMeta=MarkdownMeta{title::Text}deriving(Show,Eq,Generic,FromJSON)main::IO()main=Rib.run[reldir|a|][reldir|b|]generateSitewhere-- Shake Action for generating the static sitegenerateSite::Action()generateSite=doRib.buildStaticFiles[[relfile|static/**|]]docs<-Rib.buildHtmlMulti[[relfile|*.md|]]M.parseIO$renderPage.Target_Page.mkSomeSourceSourceType_Markdownentries<-Rib.buildHtmlMulti[[relfile|*/*/*.dhall|]]E.parseIO$renderPage.Target_Page.mkSomeSourceSourceType_EntryRib.buildHtml[relfile|index.html|]$renderPage$Target_Index$mconcat[mkSomeSourceSourceType_Entry<$>reverse(sortOnRib.sourcePathentries),mkSomeSourceSourceType_Markdown<$>docs]
With the latest master, being able to use multiple parsers in the same site can be achieved using the dependent-sum library. Using code like the following in the user Main.hs:
This examples shows how we have a static site of both MMark and Dhall sources!
Rib used to have this
SourceType
type, which is what got removed in the latest PR, to allow the user some flexibility.So now dabbling with dependent-sum is the user's responsibility.
(Technically you can use multiple parsers at the same without any of these machinary if your
Target
type had unique constructors for each parser type)