ogmarkup 2.1 → 2.2
raw patch · 2 files changed
+1/−103 lines, 2 filesdep −blaze-htmldep −yesoddep ~basedep ~parsec
Dependencies removed: blaze-html, yesod
Dependency ranges changed: base, parsec
Files
- app/Main.hs +0/−89
- ogmarkup.cabal +1/−14
− app/Main.hs
@@ -1,89 +0,0 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}--import Text.Ogmarkup--import Data.Text (Text)-import qualified Data.Text.IO as TIO-import System.IO-import Text.ParserCombinators.Parsec-import Text.Shakespeare.Text-import Text.Hamlet-import Text.Blaze.Html.Renderer.String (renderHtml)-import Text.Blaze.Html (preEscapedToHtml)--main :: IO ()-main = do- input <- readFile "examples/sample.up"- let res = ogmarkup ByLine input HtmlConf- res' = ogmarkup ByChar input HtmlConf-- putStrLn $ renderHtml [shamlet|$doctype 5-<html>- <head>- <meta charset=utf-8>- <style>- body {- margin:auto;- width: 80%;- max-width: 600px;- text-align: justify;- }- p {- text-indent:25px;- }- .error {- color: red;- background-color: black;- }- .reply {- color:gray;- }- .dialogue .by-kahina .reply {- font-weight: bold;- }- .thought .reply {- font-style: italic;- }- <body>- <div>- #{res}- <div>- #{res'}|]--data HtmlConf = HtmlConf--instance GenConf HtmlConf Html where- typography _ = frenchTypo-- documentTemplate _ doc = [shamlet|<article>#{doc}|]-- asideTemplate _ (Just cls) a = [shamlet|<blockquote .#{cls}>#{a}|]- asideTemplate _ _ a = [shamlet|<blockquote>#{a}|]-- paragraphTemplate _ paragraph = [shamlet|<p>#{paragraph}|]-- dialogueTemplate _ a dialogue = [shamlet|$newline never- <span .dialogue .#{a}>#{dialogue}|]-- thoughtTemplate _ a thought = [shamlet|$newline never- <span .thought .by-#{a}>#{thought}|]-- replyTemplate _ reply = [shamlet|$newline never- <span .reply>#{reply}|]-- betweenDialogue _ = preEscapedToHtml ("</p><p>" :: Text)-- emphTemplate _ text = [shamlet|$newline never- <em>#{text}|]- strongEmphTemplate _ text = [shamlet|$newline never- <strong>#{text}|]-- authorNormalize _ Nothing = "by-anonymus"- authorNormalize _ (Just auth) = [shamlet|by-#{auth}|]-- printSpace _ None = ""- printSpace _ Normal = " "- printSpace _ Nbsp = [shamlet| |]
ogmarkup.cabal view
@@ -1,5 +1,5 @@ name: ogmarkup-version: 2.1+version: 2.2 cabal-version: >=1.10 build-type: Simple license: MIT@@ -31,19 +31,6 @@ mtl -any default-language: Haskell2010 hs-source-dirs: src--executable ogmarkup- main-is: Main.hs- build-depends:- base -any,- ogmarkup -any,- parsec -any,- text -any,- yesod -any,- shakespeare -any,- blaze-html -any- default-language: Haskell2010- hs-source-dirs: app test-suite ogmadown-test type: exitcode-stdio-1.0