packages feed

org-mode-lucid 1.2.0 → 1.3.0

raw patch · 3 files changed

+29/−10 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Org.Lucid: [hrBetweenSections] :: OrgStyle -> Bool
- Data.Org.Lucid: OrgStyle :: Bool -> Maybe TOC -> Bool -> Highlighting -> Maybe Char -> OrgStyle
+ Data.Org.Lucid: OrgStyle :: Bool -> Maybe TOC -> Bool -> Highlighting -> Maybe Char -> Bool -> OrgStyle

Files

CHANGELOG.md view
@@ -1,5 +1,13 @@ # Changelog +## 1.3.0 (2020-03-24)++#### Changed++- `OrgStyle` has been given an extra field, `hrBetweenSections :: Bool`. If+  `True`, rendering will add a `<hr>` between top-level sections.+- `defaultStyle` has been updated to reflect the above.+ ## 1.2.0 (2020-03-19)  #### Changed
lib/Data/Org/Lucid.hs view
@@ -40,20 +40,22 @@  -- | Rendering options. data OrgStyle = OrgStyle-  { includeTitle    :: Bool+  { includeTitle      :: Bool     -- ^ Whether to include the @#+TITLE: ...@ value as an @<h1>@ tag at the top     -- of the document.-  , tableOfContents :: Maybe TOC+  , tableOfContents   :: Maybe TOC     -- ^ Optionally include a Table of Contents after the title. The displayed     -- depth is configurable.-  , bootstrap       :: Bool+  , bootstrap         :: Bool     -- ^ Whether to add Twitter Bootstrap classes to certain elements.-  , highlighting    :: Highlighting+  , highlighting      :: Highlighting     -- ^ A function to give @\<code\>@ blocks syntax highlighting.-  , separator       :: Maybe Char+  , separator         :: Maybe Char     -- ^ `Char` to insert between elements during rendering, for example having     -- a space between words. Asian languages, for instance, might want this to     -- be `Nothing`.+  , hrBetweenSections :: Bool+    -- ^ Whether to insert an @\<hr\>@ element between top-level sections.   }  -- | Options for rendering a Table of Contents in the document.@@ -67,11 +69,19 @@ -- | A function to give @\<code\>@ blocks syntax highlighting. type Highlighting = Maybe Language -> T.Text -> Html () --- | Include the title and 3-level TOC named @Table of Contents@, and don't--- include Twitter Bootstrap classes. This mirrors the behaviour of Emacs'--- native HTML export functionality.+-- | Include the title and 3-level TOC named @Table of Contents@, don't include+-- Twitter Bootstrap classes, use no custom syntax highlighting, separate words+-- with a whitespace character, and don't insert an @\<hr\>@ between major+-- sections. This mirrors the behaviour of Emacs' native HTML export+-- functionality. defaultStyle :: OrgStyle-defaultStyle = OrgStyle True (Just $ TOC "Table of Contents" 3) False codeHTML (Just ' ')+defaultStyle = OrgStyle+  { includeTitle = True+  , tableOfContents = Just $ TOC "Table of Contents" 3+  , bootstrap = False+  , highlighting = codeHTML+  , separator = Just ' '+  , hrBetweenSections = False }  -- | Convert a parsed `OrgFile` into a full HTML document readable in a browser. html :: OrgStyle -> OrgFile -> Html ()@@ -120,6 +130,7 @@ sectionHTML os depth (Section ws _ od) = do   heading [id_ $ tocLabel ws] $ paragraphHTML os ws   orgHTML' os (succ depth) od+  when (hrBetweenSections os && depth == 1) $ hr_ []   where     heading :: [Attribute] -> Html () -> Html ()     heading as h = case depth of
org-mode-lucid.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.2 name:               org-mode-lucid-version:            1.2.0+version:            1.3.0 synopsis:           Lucid integration for org-mode. description:        Lucid integration for org-mode. category:           Web