change how script colour is handled
This commit is contained in:
parent
e8d46973fa
commit
ed54ec4c5a
2 changed files with 17 additions and 16 deletions
|
@ -1,4 +1,17 @@
|
|||
import qualified Data.Map as Map
|
||||
import qualified Data.Text as Text
|
||||
import LangFilter
|
||||
import System.Environment
|
||||
import Text.Pandoc.JSON
|
||||
import Lang
|
||||
|
||||
main = toJSONFilter langFilter
|
||||
main =
|
||||
toJSONFilter $ \p@(Pandoc (Meta m) _) -> do
|
||||
col <- getDefColor m
|
||||
langFilter col p
|
||||
where
|
||||
getDefColor m = do
|
||||
res <- toText $ Map.lookup "lang-color" m
|
||||
case res of
|
||||
Just col -> pure $ col
|
||||
Nothing -> maybe "currentcolor" Text.pack <$> lookupEnv "LANG_COLOR"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue