org-mode-lucid 1.1.0 → 1.1.1
raw patch · 3 files changed
+21/−9 lines, 3 filesdep +containersdep ~org-modePVP ok
version bump matches the API change (PVP)
Dependencies added: containers
Dependency ranges changed: org-mode
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- lib/Data/Org/Lucid.hs +6/−4
- org-mode-lucid.cabal +9/−5
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## 1.1.1 (2020-03-13)++#### Fixed++- Support for `org-mode-1.1`.+ ## 1.1.0 (2020-03-07) #### Changed
lib/Data/Org/Lucid.hs view
@@ -29,6 +29,7 @@ import Data.Hashable (hash) import Data.List.NonEmpty (NonEmpty(..)) import qualified Data.List.NonEmpty as NEL+import qualified Data.Map.Strict as M import Data.Org import qualified Data.Text as T import Lucid@@ -71,7 +72,7 @@ -- | Convert a parsed `OrgFile` into a full HTML document readable in a browser. html :: OrgStyle -> OrgFile -> Html () html os o@(OrgFile m _) = html_ $ do- head_ $ title_ (maybe "" toHtml $ metaTitle m)+ head_ $ title_ (maybe "" toHtml $ M.lookup "TITLE" m) body_ $ body os o -- | Convert a parsed `OrgFile` into the body of an HTML document, so that it@@ -80,7 +81,7 @@ -- Does __not__ wrap contents in a @\<body\>@ tag. body :: OrgStyle -> OrgFile -> Html () body os (OrgFile m od) = do- when (includeTitle os) $ traverse_ (h1_ [class_ "title"] . toHtml) $ metaTitle m+ when (includeTitle os) . traverse_ (h1_ [class_ "title"] . toHtml) $ M.lookup "TITLE" m traverse_ (`toc` od) $ tableOfContents os orgHTML os od @@ -99,7 +100,7 @@ | otherwise = ul_ $ traverse_ f ss where f :: Section -> Html ()- f (Section ws od) = do+ f (Section ws _ od) = do li_ $ a_ [href_ $ "#" <> tocLabel ws] $ paragraphHTML ws toc' t (succ depth) od @@ -112,7 +113,7 @@ traverse_ (sectionHTML os depth) ss sectionHTML :: OrgStyle -> Int -> Section -> Html ()-sectionHTML os depth (Section ws od) = do+sectionHTML os depth (Section ws _ od) = do heading [id_ $ tocLabel ws] $ paragraphHTML ws orgHTML' os (succ depth) od where@@ -205,5 +206,6 @@ Strike t -> span_ [style_ "text-decoration: line-through;"] $ toHtml t Link (URL u) mt -> a_ [href_ u] $ maybe "" toHtml mt Image (URL u) -> img_ [src_ u]+ Tags ts -> toHtml $ ":" <> T.intercalate ":" (NEL.toList ts) <> ":" Punct c -> toHtml $ T.singleton c Plain t -> toHtml t
org-mode-lucid.cabal view
@@ -1,7 +1,9 @@ cabal-version: 2.2 name: org-mode-lucid-version: 1.1.0+version: 1.1.1+synopsis: Lucid integration for org-mode. description: Lucid integration for org-mode.+category: Web homepage: https://github.com/fosskers/org-mode author: Colin Woodbury maintainer: colin@fosskers.ca@@ -19,12 +21,14 @@ ghc-options: -Wall -Wpartial-fields -Wincomplete-record-updates -Wincomplete-uni-patterns -Widentities+ -funclutter-valid-hole-fits build-depends:- , base >=4.12 && <5- , hashable >=1.2 && <1.4- , lucid ^>=2.9- , org-mode ^>=1.0+ , base >=4.12 && <5+ , containers >=0.6+ , hashable >=1.2 && <1.4+ , lucid ^>=2.9+ , org-mode ^>=1.1 , text library