org-mode-lucid-1.6.4: Lucid integration for org-mode.
Copyright(c) Colin Woodbury 2020 - 2021
LicenseBSD3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Data.Org.Lucid

Description

This library converts OrgFile values into Html structures from the Lucid library. This allows one to generate valid, standalone HTML pages from an Org file, but also to inject that HTML into a preexisting Lucid Html structure, such as a certain section of a web page.

Synopsis

HTML Conversion

Consider defaultStyle as the style to pass to these functions.

html :: OrgStyle -> OrgFile -> Html () Source #

Convert a parsed OrgFile into a full HTML document readable in a browser.

body :: OrgStyle -> OrgFile -> Html () Source #

Convert a parsed OrgFile into the body of an HTML document, so that it could be injected into other Lucid Html structures.

Does not wrap contents in a <body> tag.

toc :: OrgStyle -> OrgFile -> Html () Source #

Generate a Table of Contents that matches some Html produced by html or body.

Styling

data OrgStyle Source #

Rendering options.

Constructors

OrgStyle 

Fields

defaultStyle :: OrgStyle Source #

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.

newtype TOC Source #

Options for rendering a Table of Contents in the document.

Constructors

TOC 

Fields

type Highlighting = Maybe Language -> Text -> Html () Source #

A function to give <code> blocks syntax highlighting.

type SectionStyling = Int -> Html () -> Html () -> Html () Source #

A post-processing function to apply to a Section to give it extra formatting. The Int is the header depth.

codeHTML :: Highlighting Source #

Mimicks the functionality of Emacs' native HTML export.