Commit dd3f0c09 authored by Christopher League's avatar Christopher League
Browse files

Reference some unit 1 notes

parent 75200268
......@@ -90,12 +90,14 @@ unit1 =
[whamlet|
<div .col-lg-6>
<div .card .mb-4>
<div .card-header>
<span .text-muted>
Unit 1:
Digital representations
<div .card-body>
Content coming soon…
<div .card-header>
<span .text-muted>
Unit 1:
Digital representations
<ul .list-group .list-group-flush>
<li .list-group-item>
<a href=@{PageDocR "notes110-numbers.org"}>
Notes: Positional numbering
|]
getHomeR :: Handler Html
......
......@@ -17,9 +17,11 @@ module App.Page
where
import App.ByteStore
import Prelude (error)
import App.Prelude
import Data.Aeson as Js
import Data.Aeson.Types as Js
import Data.String
import Data.Maybe (maybe)
import qualified Data.Text as Text
import Text.Blaze.Html
......@@ -54,6 +56,12 @@ instance PathPiece PageFile where
check fmt =
flip PageFile fmt <$> Text.stripSuffix (pageExtension fmt) txt
instance IsString PageFile where
fromString =
fromMaybe (error "Invalid PageFile literal")
. fromPathPiece
. convertString
instance ToJSON PageFile where
toJSON = toPathPiece >>> toJSON
......@@ -71,7 +79,7 @@ class Key k => IsPageKey k where
pageFile :: k -> PageFile
newtype PageId = PageId PageFile
deriving (Eq, Ord, Show, Read, PathPiece, ToJSON, FromJSON)
deriving (Eq, Ord, Show, Read, PathPiece, ToJSON, FromJSON, IsString)
instance Key PageId where
keyDir = "pages"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment