@@ -29,6 +29,7 @@ Parsers for Org-mode meta declarations.
30module Text.Pandoc.Readers.Org.Meta
30module Text.Pandoc.Readers.Org.Meta
31 ( metaLine
31 ( metaLine
34import Text.Pandoc.Readers.Org.BlockStarts
35import Text.Pandoc.Readers.Org.BlockStarts
@@ -48,6 +49,22 @@ import Data.List ( intersperse )
48import qualified Data.Map as M
49import qualified Data.Map as M
49import Network.HTTP ( urlEncode )
50import Network.HTTP ( urlEncode )
52+-- | Returns the current meta, respecting export options.
53+metaExport :: OrgParser (F Meta)
56+ let withAuthor = extractExportOption exportWithAuthor st
57+ return $ (if withAuthor then id else removeMeta "author")
60+removeMeta :: String -> Meta -> Meta
61+removeMeta key meta' =
62+ let metaMap = unMeta meta'
63+ in Meta $ M.delete key metaMap
65+extractExportOption :: (ExportSettings -> a) -> OrgParserState -> a
66+extractExportOption ex = ex . orgStateExportSettings
51-- | Parse and handle a single line containing meta information
68-- | Parse and handle a single line containing meta information
52-- The order, in which blocks are tried, makes sure that we're not looking at
69-- The order, in which blocks are tried, makes sure that we're not looking at
53-- the beginning of a block, so we don't need to check for it
70-- the beginning of a block, so we don't need to check for it