- = \ ctx (BlockCommand _ args _)
- -> do let items = fromMaybe 10 $ fmap read $ lookup "items" args
- showSummary = fromMaybe True $ fmap parseYesOrNo $ lookup "showSummary" args
- onlyEntity = fromMaybe True $ fmap parseYesOrNo $ lookup "onlyEntity" args
- onlySummarized = fromMaybe True $ fmap parseYesOrNo $ lookup "onlySummarized" args
- sto = ctxStorage ctx
-
- cond <- newCondition
- when onlyEntity
- $ addAttrCond cond "@type STRNE application/x-rakka-redirection"
- when onlySummarized
- $ addAttrCond cond "rakka:summary STRNE" -- summary が空でない
- setPhrase cond "[UVSET]"
- setOrder cond "@mdate NUMD"
- setMax cond items
-
- result <- searchPages sto cond
- mkPageList showSummary (srPages result)
+ = \(InterpreterContext {..}) (BlockCommand _ args _) →
+ do let items = fromMaybe 10 $ read ∘ T.unpack <$> lookup "items" args
+ showSummary = fromMaybe True $ parseYesOrNo <$> lookup "showSummary" args
+ onlyEntity = fromMaybe True $ parseYesOrNo <$> lookup "onlyEntity" args
+ onlySummarized = fromMaybe True $ parseYesOrNo <$> lookup "onlySummarized" args
+ cond ← newCondition
+ when onlyEntity
+ $ addAttrCond cond "@type STRNE application/x-rakka-redirection"
+ when onlySummarized
+ $ addAttrCond cond "rakka:summary STRNE" -- summary が空でない
+ setPhrase cond "[UVSET]"
+ setOrder cond "@mdate NUMD"
+ setMax cond items
+ result ← searchPages ctxStorage cond
+ mkPageList showSummary (srPages result)