-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
$forall article <- articles | ||
$forall article <- articlesContent | ||
<div> | ||
<h2> | ||
<a href="@{link article}">#{langTitle lang article} | ||
<p>#{writeHtml def $ arPreview lang article} | ||
<p>#{writeHtml def article} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{-# OPTIONS_GHC -F -pgmF htfpp #-} | ||
{-# LANGUAGE RankNTypes #-} | ||
|
||
module TestViews where | ||
|
||
import Data.List | ||
|
||
import Text.Blaze.Html.Renderer.String (renderHtml) | ||
import Text.Pandoc hiding (Meta) | ||
|
||
import Routes | ||
import Views | ||
|
||
import Test.Framework | ||
|
||
data TestLink = TestLink String | ||
|
||
instance Linkable TestLink where | ||
link (TestLink dest) = MetaView dest | ||
|
||
test_linkedHeader = do | ||
let source = unlines [ "Header" | ||
, "------" | ||
, "" | ||
, "Text content" | ||
, "" | ||
, "Other header" | ||
, "------------" | ||
] | ||
assertEqual | ||
(intercalate "\n" [ "<h2><a href=\"http://test\">Header</a></h2>" | ||
, "<p>Text content</p>" | ||
, "<h2>Other header</h2>" | ||
]) | ||
$ renderHtml $ writeHtml def $ linkedHeader "http://test" $ readMarkdown def source |