Meta.hs (pandoc-2.11.1.1) | : | Meta.hs (pandoc-2.11.2) | ||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
, "# Comment" | , "# Comment" | |||
, "After" | , "After" | |||
] =?> | ] =?> | |||
mconcat [ para "Before" | mconcat [ para "Before" | |||
, para "After" | , para "After" | |||
] | ] | |||
] | ] | |||
, testGroup "Export settings" | , testGroup "Export settings" | |||
[ "Title" =: | [ "Title" =: | |||
"#+TITLE: Hello, World" =?> | "#+title: Hello, World" =?> | |||
let titleInline = toList $ "Hello," <> space <> "World" | let titleInline = toList $ "Hello," <> space <> "World" | |||
meta = setMeta "title" (MetaInlines titleInline) nullMeta | meta = setMeta "title" (MetaInlines titleInline) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, testGroup "Author" | , testGroup "Author" | |||
[ "sets 'author' field" =: | [ "sets 'author' field" =: | |||
"#+author: John /Emacs-Fanboy/ Doe" =?> | "#+author: John /Emacs-Fanboy/ Doe" =?> | |||
let author = toList . spcSep $ [ "John", emph "Emacs-Fanboy", "Doe" ] | let author = toList . spcSep $ [ "John", emph "Emacs-Fanboy", "Doe" ] | |||
meta = setMeta "author" (MetaInlines author) nullMeta | meta = setMeta "author" (MetaInlines author) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
skipping to change at line 72 | skipping to change at line 72 | |||
] =?> | ] =?> | |||
let watson = toList "James Dewey Watson," | let watson = toList "James Dewey Watson," | |||
crick = toList "Francis Harry Compton Crick" | crick = toList "Francis Harry Compton Crick" | |||
meta = setMeta "author" | meta = setMeta "author" | |||
(MetaInlines (watson ++ SoftBreak : crick)) | (MetaInlines (watson ++ SoftBreak : crick)) | |||
nullMeta | nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
] | ] | |||
, "Date" =: | , "Date" =: | |||
"#+Date: Feb. *28*, 2014" =?> | "#+date: Feb. *28*, 2014" =?> | |||
let date = toList . spcSep $ [ "Feb.", strong "28" <> ",", "2014" ] | let date = toList . spcSep $ [ "Feb.", strong "28" <> ",", "2014" ] | |||
meta = setMeta "date" (MetaInlines date) nullMeta | meta = setMeta "date" (MetaInlines date) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, testGroup "Description" | , testGroup "Description" | |||
[ "Single line" =: | [ "Single line" =: | |||
"#+DESCRIPTION: Explanatory text" =?> | "#+description: Explanatory text" =?> | |||
let description = [Str "Explanatory", Space, Str "text"] | let description = [Str "Explanatory", Space, Str "text"] | |||
meta = setMeta "description" (MetaInlines description) nullMeta | meta = setMeta "description" (MetaInlines description) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, "Multiline" =: | , "Multiline" =: | |||
T.unlines [ "#+DESCRIPTION: /Short/ introduction" | T.unlines [ "#+description: /Short/ introduction" | |||
, "#+DESCRIPTION: to Org-mode" | , "#+description: to Org-mode" | |||
] =?> | ] =?> | |||
let description = [ Emph [Str "Short"], Space, Str "introduction" | let description = [ Emph [Str "Short"], Space, Str "introduction" | |||
, SoftBreak | , SoftBreak | |||
, Str "to", Space, Str "Org-mode" | , Str "to", Space, Str "Org-mode" | |||
] | ] | |||
meta = setMeta "description" (MetaInlines description) nullMeta | meta = setMeta "description" (MetaInlines description) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
] | ] | |||
, "Subtitle" =: | , "Subtitle" =: | |||
T.unlines [ "#+SUBTITLE: Your Life in" | T.unlines [ "#+subtitle: Your Life in" | |||
, "#+SUBTITLE: /Plain/ Text" | , "#+subtitle: /Plain/ Text" | |||
] =?> | ] =?> | |||
let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text" | let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text" | |||
in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty | in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty | |||
, "Keywords" =: | , "Keywords" =: | |||
T.unlines [ "#+KEYWORDS: pandoc, testing," | T.unlines [ "#+keywords: pandoc, testing," | |||
, "#+KEYWORDS: Org" | , "#+keywords: Org" | |||
] =?> | ] =?> | |||
let keywords = toList $ "pandoc, testing," <> softbreak <> "Org" | let keywords = toList $ "pandoc, testing," <> softbreak <> "Org" | |||
meta = setMeta "keywords" (MetaInlines keywords) nullMeta | meta = setMeta "keywords" (MetaInlines keywords) nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, "Institute" =: | , "Institute" =: | |||
"#+INSTITUTE: ACME Inc." =?> | "#+institute: ACME Inc." =?> | |||
Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty | Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty | |||
, testGroup "LaTeX" | , testGroup "LaTeX" | |||
[ "LATEX_HEADER" =: | [ "LATEX_HEADER" =: | |||
"#+LaTeX_header: \\usepackage{tikz}" =?> | "#+latex_header: \\usepackage{tikz}" =?> | |||
let latexInlines = rawInline "latex" "\\usepackage{tikz}" | let latexInlines = rawInline "latex" "\\usepackage{tikz}" | |||
inclList = MetaList [MetaInlines (toList latexInlines)] | inclList = MetaList [MetaInlines (toList latexInlines)] | |||
meta = setMeta "header-includes" inclList nullMeta | meta = setMeta "header-includes" inclList nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, "LATEX_HEADER_EXTRA" =: | , "LATEX_HEADER_EXTRA" =: | |||
"#+LATEX_HEADER_EXTRA: \\usepackage{calc}" =?> | "#+latex_header_extra: \\usepackage{calc}" =?> | |||
let latexInlines = rawInline "latex" "\\usepackage{calc}" | let latexInlines = rawInline "latex" "\\usepackage{calc}" | |||
inclList = toMetaValue [latexInlines] | inclList = toMetaValue [latexInlines] | |||
in Pandoc (setMeta "header-includes" inclList nullMeta) mempty | in Pandoc (setMeta "header-includes" inclList nullMeta) mempty | |||
, testGroup "LaTeX_CLASS" | , testGroup "LaTeX_CLASS" | |||
[ "stored as documentclass" =: | [ "stored as documentclass" =: | |||
"#+LATEX_CLASS: article" =?> | "#+latex_class: article" =?> | |||
let meta = setMeta "documentclass" (MetaString "article") nullMeta | let meta = setMeta "documentclass" (MetaString "article") nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, "last definition takes precedence" =: | , "last definition takes precedence" =: | |||
T.unlines [ "#+LATEX_CLASS: this will not be used" | T.unlines [ "#+latex_class: this will not be used" | |||
, "#+LATEX_CLASS: report" | , "#+latex_class: report" | |||
] =?> | ] =?> | |||
let meta = setMeta "documentclass" (MetaString "report") nullMeta | let meta = setMeta "documentclass" (MetaString "report") nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
] | ] | |||
, "LATEX_CLASS_OPTIONS as classoption" =: | , "LATEX_CLASS_OPTIONS as classoption" =: | |||
"#+LATEX_CLASS_OPTIONS: [a4paper]" =?> | "#+latex_class_options: [a4paper]" =?> | |||
let meta = setMeta "classoption" (MetaString "a4paper") nullMeta | let meta = setMeta "classoption" (MetaString "a4paper") nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
] | ] | |||
, testGroup "HTML" | , testGroup "HTML" | |||
[ "HTML_HEAD values are added to header-includes" =: | [ "HTML_HEAD values are added to header-includes" =: | |||
"#+html_head: <meta/>" =?> | "#+html_head: <meta/>" =?> | |||
let html = rawInline "html" "<meta/>" | let html = rawInline "html" "<meta/>" | |||
inclList = MetaList [MetaInlines (toList html)] | inclList = MetaList [MetaInlines (toList html)] | |||
meta = setMeta "header-includes" inclList nullMeta | meta = setMeta "header-includes" inclList nullMeta | |||
in Pandoc meta mempty | in Pandoc meta mempty | |||
, "HTML_HEAD_EXTRA behaves like HTML_HEAD" =: | , "HTML_HEAD_EXTRA behaves like HTML_HEAD" =: | |||
T.unlines [ "#+HTML_HEAD: <meta name=\"generator\" content=\"pandoc\">" | T.unlines [ "#+html_head: <meta name=\"generator\" content=\"pandoc\">" | |||
, "#+HTML_HEAD_EXTRA: <meta charset=\"utf-8\">" | , "#+html_head_extra: <meta charset=\"utf-8\">" | |||
] =?> | ] =?> | |||
let generator = rawInline "html" | let generator = rawInline "html" | |||
"<meta name=\"generator\" content=\"pandoc\">" | "<meta name=\"generator\" content=\"pandoc\">" | |||
charset = rawInline "html" "<meta charset=\"utf-8\">" | charset = rawInline "html" "<meta charset=\"utf-8\">" | |||
inclList = toMetaValue [generator, charset] | inclList = toMetaValue [generator, charset] | |||
in Pandoc (setMeta "header-includes" inclList nullMeta) mempty | in Pandoc (setMeta "header-includes" inclList nullMeta) mempty | |||
] | ] | |||
] | ] | |||
, testGroup "Non-export keywords" | , testGroup "Non-export keywords" | |||
[ testGroup "#+LINK" | [ testGroup "#+link" | |||
[ "Link abbreviation" =: | [ "Link abbreviation" =: | |||
T.unlines [ "#+LINK: wp https://en.wikipedia.org/wiki/%s" | T.unlines [ "#+link: wp https://en.wikipedia.org/wiki/%s" | |||
, "[[wp:Org_mode][Wikipedia on Org-mode]]" | , "[[wp:Org_mode][Wikipedia on Org-mode]]" | |||
] =?> | ] =?> | |||
para (link "https://en.wikipedia.org/wiki/Org_mode" "" | para (link "https://en.wikipedia.org/wiki/Org_mode" "" | |||
("Wikipedia" <> space <> "on" <> space <> "Org-mode")) | ("Wikipedia" <> space <> "on" <> space <> "Org-mode")) | |||
, "Link abbreviation, defined after first use" =: | , "Link abbreviation, defined after first use" =: | |||
T.unlines [ "[[zl:non-sense][Non-sense articles]]" | T.unlines [ "[[zl:non-sense][Non-sense articles]]" | |||
, "#+LINK: zl http://zeitlens.com/tags/%s.html" | , "#+link: zl http://zeitlens.com/tags/%s.html" | |||
] =?> | ] =?> | |||
para (link "http://zeitlens.com/tags/non-sense.html" "" | para (link "http://zeitlens.com/tags/non-sense.html" "" | |||
("Non-sense" <> space <> "articles")) | ("Non-sense" <> space <> "articles")) | |||
, "Link abbreviation, URL encoded arguments" =: | , "Link abbreviation, URL encoded arguments" =: | |||
T.unlines [ "#+link: expl http://example.com/%h/foo" | T.unlines [ "#+link: expl http://example.com/%h/foo" | |||
, "[[expl:Hello, World!][Moin!]]" | , "[[expl:Hello, World!][Moin!]]" | |||
] =?> | ] =?> | |||
para (link "http://example.com/Hello%2C%20World%21/foo" "" "Moin!") | para (link "http://example.com/Hello%2C%20World%21/foo" "" "Moin!") | |||
skipping to change at line 217 | skipping to change at line 217 | |||
T.unlines [ "#+pandoc-emphasis-pre: \"[\"" | T.unlines [ "#+pandoc-emphasis-pre: \"[\"" | |||
, "#+pandoc-emphasis-post: \"]\"" | , "#+pandoc-emphasis-post: \"]\"" | |||
, "#+pandoc-emphasis-pre:" | , "#+pandoc-emphasis-pre:" | |||
, "#+pandoc-emphasis-post:" | , "#+pandoc-emphasis-post:" | |||
, "[/noemph/]" | , "[/noemph/]" | |||
] =?> | ] =?> | |||
para "[/noemph/]" | para "[/noemph/]" | |||
] | ] | |||
, "Unknown keyword" =: | , "Unknown keyword" =: | |||
T.unlines [ "#+UNKNOWN_KEYWORD: Chumbawamba" | T.unlines [ "#+unknown_keyword: Chumbawamba" | |||
, "#+ANOTHER_UNKNOWN: Blur" | , "#+another_unknown: Blur" | |||
] =?> | ] =?> | |||
rawBlock "org" "#+UNKNOWN_KEYWORD: Chumbawamba" <> | rawBlock "org" "#+unknown_keyword: Chumbawamba" <> | |||
rawBlock "org" "#+ANOTHER_UNKNOWN: Blur" | rawBlock "org" "#+another_unknown: Blur" | |||
] | ] | |||
, "Properties drawer" =: | , "Properties drawer" =: | |||
T.unlines [ " :PROPERTIES:" | T.unlines [ " :PROPERTIES:" | |||
, " :setting: foo" | , " :setting: foo" | |||
, " :END:" | , " :END:" | |||
] =?> | ] =?> | |||
(mempty::Blocks) | (mempty::Blocks) | |||
, "Logbook drawer" =: | , "Logbook drawer" =: | |||
End of changes. 18 change blocks. | ||||
25 lines changed or deleted | 25 lines changed or added |