@@ -467,7 +467,14 @@ tests =
467 , "Author" =:
467 , "Author" =:
468 "#+author: Albert /Emacs-Fanboy/ Krewinkel" =?>
468 "#+author: Albert /Emacs-Fanboy/ Krewinkel" =?>
469 let author = toList . spcSep $ [ "Albert", emph "Emacs-Fanboy", "Krewinkel" ]
469 let author = toList . spcSep $ [ "Albert", emph "Emacs-Fanboy", "Krewinkel" ]
470− meta = setMeta "author" (MetaInlines author) $ nullMeta
470+ meta = setMeta "author" (MetaList [MetaInlines author]) $ nullMeta
471+ in Pandoc meta mempty
473+ , "Multiple authors" =:
474+ "#+author: James Dewey Watson, Francis Harry Compton Crick " =?>
475+ let watson = MetaInlines $ toList "James Dewey Watson"
476+ crick = MetaInlines $ toList "Francis Harry Compton Crick"
477+ meta = setMeta "author" (MetaList [watson, crick]) $ nullMeta
471 in Pandoc meta mempty
478 in Pandoc meta mempty
473 , "Date" =:
480 , "Date" =:
@@ -478,8 +485,8 @@ tests =
479 , "Description" =:
486 , "Description" =:
480 "#+DESCRIPTION: Explanatory text" =?>
487 "#+DESCRIPTION: Explanatory text" =?>
481− let description = toList . spcSep $ [ "Explanatory", "text" ]
488+ let description = "Explanatory text"
482− meta = setMeta "description" (MetaInlines description) $ nullMeta
489+ meta = setMeta "description" (MetaString description) $ nullMeta
483 in Pandoc meta mempty
490 in Pandoc meta mempty
485 , "Properties drawer" =:
492 , "Properties drawer" =:
@@ -489,6 +496,38 @@ tests =
490 (mempty::Blocks)
497 (mempty::Blocks)
499+ , "LaTeX_headers options are translated to header-includes" =:
500+ "#+LaTeX_header: \\usepackage{tikz}" =?>
501+ let latexInlines = rawInline "latex" "\\usepackage{tikz}"
502+ inclList = MetaList [MetaInlines (toList latexInlines)]
503+ meta = setMeta "header-includes" inclList nullMeta
504+ in Pandoc meta mempty
506+ , "LaTeX_class option is translated to documentclass" =:
507+ "#+LATEX_CLASS: article" =?>
508+ let meta = setMeta "documentclass" (MetaString "article") nullMeta
509+ in Pandoc meta mempty
511+ , "LaTeX_class_options is translated to classoption" =:
512+ "#+LATEX_CLASS_OPTIONS: [a4paper]" =?>
513+ let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
514+ in Pandoc meta mempty
516+ , "LaTeX_class_options is translated to classoption" =:
517+ "#+html_head: <meta/>" =?>
518+ let html = rawInline "html" "<meta/>"
519+ inclList = MetaList [MetaInlines (toList html)]
520+ meta = setMeta "header-includes" inclList nullMeta
521+ in Pandoc meta mempty
523+ , "later meta definitions take precedence" =:
524+ unlines [ "#+AUTHOR: this will not be used"
527+ let author = MetaInlines [Str "Max"]
528+ meta = setMeta "author" (MetaList [author]) $ nullMeta
529+ in Pandoc meta mempty
492 , "Logbook drawer" =:
531 , "Logbook drawer" =:
493 unlines [ " :LogBook:"
532 unlines [ " :LogBook:"
494 , " - State \"DONE\" from \"TODO\" [2014-03-03 Mon 11:00]"
533 , " - State \"DONE\" from \"TODO\" [2014-03-03 Mon 11:00]"
@@ -563,69 +602,91 @@ tests =
564 (para (link "http://example.com/foo" "" "bar"))
603 (para (link "http://example.com/foo" "" "bar"))
566− , "Export option: Disable simple sub/superscript syntax" =:
567− unlines [ "#+OPTIONS: ^:nil"
572− , "Export option: directly select drawers to be exported" =:
573− unlines [ "#+OPTIONS: d:(\"IMPORTANT\")"
581− divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "23")
583− , "Export option: exclude drawers from being exported" =:
584− unlines [ "#+OPTIONS: d:(not \"BORING\")"
592− divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "5")
606+ , testGroup "export options"
608+ [ "disable simple sub/superscript syntax" =:
609+ unlines [ "#+OPTIONS: ^:nil"
614+ , "directly select drawers to be exported" =:
615+ unlines [ "#+OPTIONS: d:(\"IMPORTANT\")"
623+ divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "23")
625+ , "exclude drawers from being exported" =:
626+ unlines [ "#+OPTIONS: d:(not \"BORING\")"
634+ divWith (mempty, ["IMPORTANT", "drawer"], mempty) (para "5")
594− , "Export option: don't include archive trees" =:
636+ , "don't include archive trees" =:
595− unlines [ "#+OPTIONS: arch:nil"
637+ unlines [ "#+OPTIONS: arch:nil"
596− , "* old :ARCHIVE:"
638+ , "* old :ARCHIVE:"
598− (mempty ::Blocks)
640+ (mempty ::Blocks)
642+ , "include complete archive trees" =:
643+ unlines [ "#+OPTIONS: arch:t"
647+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
648+ in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
600− , "Export option: include complete archive trees" =:
652+ , "include archive tree header only" =:
601− unlines [ "#+OPTIONS: arch:t"
653+ unlines [ "#+OPTIONS: arch:headline"
602− , "* old :ARCHIVE:"
654+ , "* old :ARCHIVE:"
603− , " boring"
655+ , " boring"
605− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
657+ let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
606− in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
658+ in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
660+ , "limit headline depth" =:
661+ unlines [ "#+OPTIONS: H:2"
667+ mconcat [ headerWith ("section", [], []) 1 "section"
668+ , headerWith ("subsection", [], []) 2 "subsection"
669+ , orderedList [ para "list item 1", para "list item 2" ]
610− , "Export option: include archive tree header only" =:
672+ , "disable author export" =:
611− unlines [ "#+OPTIONS: arch:headline"
673+ unlines [ "#+OPTIONS: author:nil"
612− , "* old :ARCHIVE:"
674+ , "#+AUTHOR: ShyGuy"
615− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
676+ Pandoc nullMeta mempty
616− in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
677+
617−
678+ , "disable creator export" =:
618− , "Export option: limit headline depth" =:
619− unlines [ "#+OPTIONS: H:2"
679+ unlines [ "#+OPTIONS: creator:nil"
620− , "* section"
680+ , "#+creator: The Architect"
621− , "** subsection"
681+ ] =?>
622− , "*** list item 1"
682+ Pandoc nullMeta mempty
623− , "*** list item 2"
683+
624− ] =?>
684+ , "disable email export" =:
625− mconcat [ headerWith ("section", [], []) 1 "section"
685+ unlines [ "#+OPTIONS: email:nil"
626− , headerWith ("subsection", [], []) 2 "subsection"
686+ , "#+email: no-mail-please@example.com"
627− , orderedList [ para "list item 1", para "list item 2" ]
687+ ] =?>
688+ Pandoc nullMeta mempty
631 , testGroup "Basic Blocks" $
692 , testGroup "Basic Blocks" $