Skip to content

Commit

Permalink
Update obelisk
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Jul 20, 2018
1 parent 34c2245 commit 7207778
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .obelisk/impl/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"owner": "obsidiansystems",
"repo": "obelisk",
"branch": "routes",
"rev": "a6e5306fb8ba5314b27da1e1cc0cf918b7083a90",
"sha256": "1lkw6q6g1w58y6akw847pin91h6nsqyrh69sps5k65di9y7sx6vd"
"rev": "2f4cb563b136c1b1901b130de1f0eddbee9659f5",
"sha256": "165mq9dwx7s57dnyqhfk0c3z05jkmap8dj272rgy1vni60rs6nf9"
}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ revue uses Obelisk. Use `ob run` to run locally, and `nix-build -A exe` (or `ob
## Roadmap

- [X] Use markdown (only in frontend)
- [ ] Retrieve markdown from the backend (and use mmark from backend)
- [ ] Extract markdown rendering as separate reflex-dom library (just StaticWidget due to [yaml blocker](https://github.com/mmark-md/mmark/issues/54))
- [ ] with Haskell syntax highlighting ([cf](https://github.com/mrkkrp/ghc-syntax-highlighter))
- [ ] Start using sub routes (eg: /wiki/whatever)
- [ ] Have backend do the markdown conversion
- [ ] Extract markdown rendering as separate reflex-dom library (just StaticWidget due to [yaml blocker](https://github.com/mmark-md/mmark/issues/54))
- [ ] with Haskell syntax highlighting ([cf](https://github.com/mrkkrp/ghc-syntax-highlighter))
4 changes: 2 additions & 2 deletions frontend/src/Frontend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Prelude hiding (id, (.))
import Control.Category
import Data.ByteString (ByteString)
import Data.FileEmbed
import Data.Monoid hiding ((<>))
import Data.Semigroup ((<>))
import Data.Text (Text)
import qualified Data.Text.Encoding as T
Expand Down Expand Up @@ -50,7 +49,7 @@ frontend = Frontend
, _frontend_notFoundRoute = \_ -> Route_Landing :/ ()
}

pageTemplate :: (DomBuilder t m, EventWriter t (Endo (R Route)) m) => m a -> m a
pageTemplate :: DomBuilder t m=> m a -> m a
pageTemplate page = divClass "ui container" $ do
divClass "ui top attached inverted header" $ el "h1" $ text title
divClass "ui attached segment" $
Expand All @@ -60,6 +59,7 @@ getRouteMarkdown :: Route a -> Text
getRouteMarkdown = \case
Route_Landing -> T.decodeUtf8 landingMd

-- TODO: Don't embed, but pull from backend.
landingMd :: ByteString
landingMd = $(embedFile "static/markdown/landing.md")

Expand Down
7 changes: 1 addition & 6 deletions frontend/src/Frontend/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ import Control.Foldl hiding (mconcat)
import Control.Monad (forM_)
import qualified Data.List.NonEmpty as NE
import Data.Maybe (catMaybes, fromMaybe)
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T

import Language.Javascript.JSaddle
import Obelisk.Route.Frontend
import Reflex.Dom.Core hiding (Link)

import qualified Text.MMark as MMark
import Text.MMark.Extension (Block (..), Inline (..))
import qualified Text.URI as URI

import Common.Route (Route)

markdownView :: (DomBuilder t m, EventWriter t (Endo (R Route)) m) => Text -> m ()
markdownView :: (DomBuilder t m) => Text -> m ()
markdownView source = case MMark.parse "<nofile>" source of
Left errs -> elClass "tt" "markdown-error" $
text $ T.pack (MMark.parseErrorsPretty source errs)
Expand Down Expand Up @@ -74,7 +70,6 @@ fetchMarkdown ::
( PostBuild t m
, TriggerEvent t m
, PerformEvent t m
, MonadJSM m
, MonadJSM (Performable m)
, HasJSContext (Performable m)
)
Expand Down

0 comments on commit 7207778

Please sign in to comment.