1 CSS
The theme of this site is modified from https://mattwetmore.me/.
https://github.com/congyu711/Hakyllsite/tree/main/css
2 Math and Bibliography
Bib: https://github.com/chaoxu/chaoxu.github.io/blob/develop/ChaoDoc.hs
: https://github.com/chaoxu/katex_cli
3 Known issues
- font hack is not perfect,
e.g. (
$G'$
) – I use LibertinusMath font now. - currently doesn’t support anything(math, markdown …) in titles,
(since I’m using filters only on
withItemBody
) - my code highlighting is in a mess. https://tony-zorman.com/posts.html has a good tutorial. some random example:
putTodo :: (Int, String) -> IO ()
= putStrLn (show n ++ ": " ++ todo)
putTodo (n, todo)
prompt :: [String] -> IO ()
= do
prompt todos putStrLn ""
putStrLn "Current TODO list:"
mapM_ putTodo (zip [0..] todos)
<- getLine
command
interpret command todos
interpret :: String -> [String] -> IO ()
'+':' ':todo) todos = prompt (todo:todos)
interpret ('-':' ':num ) todos =
interpret (case delete (read num) todos of
Nothing -> do
putStrLn "No TODO entry matches the given number"
prompt todosJust todos' -> prompt todos'
"q" todos = return ()
interpret = do
interpret command todos putStrLn ("Invalid command: `" ++ command ++ "`")
prompt todos
delete :: Int -> [a] -> Maybe [a]
0 (_:as) = Just as
delete :as) = do
delete n (a<- delete (n - 1) as
as' return (a:as')
= Nothing
delete _ []
= do
main putStrLn "Commands:"
putStrLn "+ <String> - Add a TODO entry"
putStrLn "- <Int> - Delete the numbered entry"
putStrLn "q - Quit"
prompt []