diff --git a/HakyllBibTex.hs b/HakyllBibTex.hs index d80e45c..b4a652f 100644 --- a/HakyllBibTex.hs +++ b/HakyllBibTex.hs @@ -50,6 +50,7 @@ bibEntryContext = Context $ \key _ item -> Nothing -> empty Just val -> case key of "author" -> return $ StringField $ formatAuthors val + "month" -> return $ StringField $ expandMonth val _ -> return $ StringField $ latexToHtml val -------------------------------------------------------------------------------- @@ -99,6 +100,22 @@ formatAuthor = intercalate " " . reverse . (splitOn ",") +-------------------------------------------------------------------------------- +expandMonth :: String -> String +expandMonth mon = case mon of + "jan" -> "January" + "feb" -> "February" + "mar" -> "March" + "apr" -> "April" + "may" -> "May" + "jun" -> "June" + "jul" -> "July" + "aug" -> "August" + "sep" -> "September" + "oct" -> "October" + "nov" -> "November" + "dec" -> "December" + -------------------------------------------------------------------------------- -- Inefficient... trimSpace :: String -> String