-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Conversion between markup formats -- -- Pandoc is a Haskell library for converting from one markup format to -- another, and a command-line tool that uses this library. It can read -- several dialects of Markdown and (subsets of) HTML, reStructuredText, -- LaTeX, DocBook, JATS, MediaWiki markup, DokuWiki markup, TWiki markup, -- TikiWiki markup, Jira markup, Creole 1.0, Haddock markup, OPML, Emacs -- Org-Mode, Emacs Muse, txt2tags, ipynb (Jupyter notebooks), Vimwiki, -- Word Docx, ODT, EPUB, FictionBook2, roff man, Textile, BibTeX, -- BibLaTeX, CSL JSON, , and CSV, and it can write Markdown, -- reStructuredText, XHTML, HTML 5, LaTeX, ConTeXt, DocBook, JATS, OPML, -- TEI, OpenDocument, ODT, Word docx, PowerPoint pptx, RTF, MediaWiki, -- DokuWiki, XWiki, ZimWiki, Textile, Jira, roff man, roff ms, plain -- text, Emacs Org-Mode, AsciiDoc, Haddock markup, EPUB (v2 and v3), -- ipynb, FictionBook2, InDesign ICML, Muse, CSL JSON, LaTeX beamer -- slides, and several kinds of HTML/JavaScript slide shows (S5, Slidy, -- Slideous, DZSlides, reveal.js). -- -- In contrast to most existing tools for converting Markdown to HTML, -- pandoc has a modular design: it consists of a set of readers, which -- parse text in a given format and produce a native representation of -- the document, and a set of writers, which convert this native -- representation into a target format. Thus, adding an input or output -- format requires only adding a reader or writer. @package pandoc @version 2.13 -- | Function to convert accented latin letters to their unaccented ascii -- equivalents (used in constructing HTML identifiers). module Text.Pandoc.Asciify toAsciiChar :: Char -> Maybe Char -- | Emoji symbol lookup from canonical string identifier. module Text.Pandoc.Emoji emojis :: Map Text Text emojiToInline :: Text -> Maybe Inline -- | Data structures and functions for representing markup extensions. module Text.Pandoc.Extensions -- | Individually selectable syntax extensions. data Extension -- | PHP markdown extra abbreviation definitions Ext_abbreviations :: Extension -- | Make all non-alphanumerics escapable Ext_all_symbols_escapable :: Extension -- | Enable Text::Amuse extensions to Emacs Muse markup Ext_amuse :: Extension -- | Make and escapable Ext_angle_brackets_escapable :: Extension -- | ascii-only identifiers for headers; presupposes Ext_auto_identifiers Ext_ascii_identifiers :: Extension -- | Automatic identifiers for headers Ext_auto_identifiers :: Extension -- | Make all absolute URIs into links Ext_autolink_bare_uris :: Extension -- | GitHub style ``` code blocks Ext_backtick_code_blocks :: Extension -- | Require blank line before a blockquote Ext_blank_before_blockquote :: Extension -- | Require blank line before a header Ext_blank_before_header :: Extension -- | Bracketed spans with attributes Ext_bracketed_spans :: Extension -- | Pandoc/citeproc citations Ext_citations :: Extension -- | Definition lists without space between items, and disallow laziness Ext_compact_definition_lists :: Extension -- | Definition lists as in pandoc, mmd, php Ext_definition_lists :: Extension -- | Newlines in paragraphs are ignored between East Asian wide characters. -- Note: this extension does not affect readers/writers directly; it -- causes the eastAsianLineBreakFilter to be applied after parsing, in -- Text.Pandoc.App.convertWithOpts. Ext_east_asian_line_breaks :: Extension -- | Use element-citation elements for JATS citations Ext_element_citations :: Extension -- | Support emoji like :smile: Ext_emoji :: Extension -- | Allow empty paragraphs Ext_empty_paragraphs :: Extension -- | Recognise the EPUB extended version of HTML Ext_epub_html_exts :: Extension -- | Treat a backslash at EOL as linebreak Ext_escaped_line_breaks :: Extension -- | Markdown-style numbered examples Ext_example_lists :: Extension -- | Enable fancy list numbers and delimiters Ext_fancy_lists :: Extension -- | Allow attributes on fenced code blocks Ext_fenced_code_attributes :: Extension -- | Parse fenced code blocks Ext_fenced_code_blocks :: Extension -- | Allow fenced div syntax ::: Ext_fenced_divs :: Extension -- | Pandoc/PHP/MMD style footnotes Ext_footnotes :: Extension -- | Require 4-space indent for list contents Ext_four_space_rule :: Extension -- | Use GitHub's method for generating header identifiers; presupposes -- Ext_auto_identifiers Ext_gfm_auto_identifiers :: Extension -- | Grid tables (pandoc, reST) Ext_grid_tables :: Extension -- | All newlines become hard line breaks Ext_hard_line_breaks :: Extension -- | Explicit header attributes {#id .class k=v} Ext_header_attributes :: Extension -- | Newlines in paragraphs are ignored Ext_ignore_line_breaks :: Extension -- | A paragraph with just an image is a figure Ext_implicit_figures :: Extension -- | Implicit reference links for headers Ext_implicit_header_references :: Extension -- | Allow attributes on inline code Ext_inline_code_attributes :: Extension -- | Pandoc-style inline notes Ext_inline_notes :: Extension -- | Treat underscore inside word as literal Ext_intraword_underscores :: Extension -- | Parse LaTeX macro definitions (for math only) Ext_latex_macros :: Extension -- | RST style line blocks Ext_line_blocks :: Extension -- | link and image attributes Ext_link_attributes :: Extension -- | Allow lists without preceding blank Ext_lists_without_preceding_blankline :: Extension -- | Enable literate Haskell conventions Ext_literate_haskell :: Extension -- | Interpret text inside HTML as markdown iff container has attribute -- markdown Ext_markdown_attribute :: Extension -- | Interpret as markdown inside HTML blocks Ext_markdown_in_html_blocks :: Extension -- | Multimarkdown style header identifiers [myid] Ext_mmd_header_identifiers :: Extension -- | MMD style reference link attributes Ext_mmd_link_attributes :: Extension -- | Multimarkdown metadata block Ext_mmd_title_block :: Extension -- | Pandoc-style multiline tables Ext_multiline_tables :: Extension -- | Use Div blocks for contents of div tags Ext_native_divs :: Extension -- | Use Span inlines for contents of span Ext_native_spans :: Extension -- | Use output format's native numbering for figures and tables Ext_native_numbering :: Extension -- | ConTeXt Natural Tables Ext_ntb :: Extension -- | Ext_old_dashes :: Extension -- | Pandoc title block Ext_pandoc_title_block :: Extension -- | Pipe tables (as in PHP markdown extra) Ext_pipe_tables :: Extension -- | Allow explicit raw blocks/inlines Ext_raw_attribute :: Extension -- | Allow raw HTML Ext_raw_html :: Extension -- | Allow raw TeX (other than math) Ext_raw_tex :: Extension -- | Parse markdown in ipynb as raw markdown Ext_raw_markdown :: Extension -- | Shortcut reference links Ext_shortcut_reference_links :: Extension -- | Pandoc-style simple tables Ext_simple_tables :: Extension -- | Smart quotes, apostrophes, ellipses, dashes Ext_smart :: Extension -- | Require space between # and header text Ext_space_in_atx_header :: Extension -- | Allow space between two parts of ref link Ext_spaced_reference_links :: Extension -- | Make start number of ordered list significant Ext_startnum :: Extension -- | Strikeout using ~~this~~ syntax Ext_strikeout :: Extension -- | Subscript using ~this~ syntax Ext_subscript :: Extension -- | Superscript using ^this^ syntax Ext_superscript :: Extension -- | Read styles that pandoc doesn't know Ext_styles :: Extension -- | Parse certain list items as task list items Ext_task_lists :: Extension -- | Pandoc-style table captions Ext_table_captions :: Extension -- | TeX math between $..$ or $$..$$ Ext_tex_math_dollars :: Extension -- | TeX math btw \(..\) \[..\] Ext_tex_math_double_backslash :: Extension -- | TeX math btw <math> <math> Ext_tex_math_single_backslash :: Extension -- | Use xrefs with names Ext_xrefs_name :: Extension -- | Use xrefs with numbers Ext_xrefs_number :: Extension -- | YAML metadata block Ext_yaml_metadata_block :: Extension -- | Use Project Gutenberg conventions for plain Ext_gutenberg :: Extension -- | Generic attribute syntax Ext_attributes :: Extension -- | Include source position attributes Ext_sourcepos :: Extension data Extensions emptyExtensions :: Extensions extensionsFromList :: [Extension] -> Extensions -- | Parse a format-specifying string into a markup format, a set of -- extensions to enable, and a set of extensions to disable. parseFormatSpec :: Text -> Either ParseError (Text, [Extension], [Extension]) extensionEnabled :: Extension -> Extensions -> Bool enableExtension :: Extension -> Extensions -> Extensions disableExtension :: Extension -> Extensions -> Extensions -- | Default extensions from format-describing string. getDefaultExtensions :: Text -> Extensions -- | Get all valid extensions for a format. This is used mainly in checking -- format specifications for validity. getAllExtensions :: Text -> Extensions -- | Extensions to be used with pandoc-flavored markdown. pandocExtensions :: Extensions -- | Extensions to be used with plain text output. plainExtensions :: Extensions -- | Language extensions to be used with strict markdown. strictExtensions :: Extensions -- | Extensions to be used with PHP Markdown Extra. phpMarkdownExtraExtensions :: Extensions -- | Extensions to be used with github-flavored markdown. githubMarkdownExtensions :: Extensions -- | Extensions to be used with multimarkdown. multimarkdownExtensions :: Extensions instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Extensions.Extensions instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Extensions.Extensions instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Extensions.Extension instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Extensions.Extension instance GHC.Generics.Generic Text.Pandoc.Extensions.Extensions instance Data.Data.Data Text.Pandoc.Extensions.Extensions instance GHC.Classes.Ord Text.Pandoc.Extensions.Extensions instance GHC.Classes.Eq Text.Pandoc.Extensions.Extensions instance GHC.Read.Read Text.Pandoc.Extensions.Extensions instance GHC.Show.Show Text.Pandoc.Extensions.Extensions instance GHC.Generics.Generic Text.Pandoc.Extensions.Extension instance Data.Data.Data Text.Pandoc.Extensions.Extension instance GHC.Enum.Bounded Text.Pandoc.Extensions.Extension instance GHC.Classes.Ord Text.Pandoc.Extensions.Extension instance GHC.Classes.Eq Text.Pandoc.Extensions.Extension instance GHC.Enum.Enum Text.Pandoc.Extensions.Extension instance GHC.Read.Read Text.Pandoc.Extensions.Extension instance GHC.Show.Show Text.Pandoc.Extensions.Extension instance GHC.Base.Semigroup Text.Pandoc.Extensions.Extensions instance GHC.Base.Monoid Text.Pandoc.Extensions.Extensions -- | Mime type lookup. module Text.Pandoc.MIME type MimeType = Text -- | Determine mime type appropriate for file path. getMimeType :: FilePath -> Maybe MimeType -- | Determime mime type appropriate for file path, defaulting to -- “application/octet-stream” if nothing else fits. getMimeTypeDef :: FilePath -> MimeType -- | Get the charset from a mime type, if one is present. getCharset :: MimeType -> Maybe Text extensionFromMimeType :: MimeType -> Maybe Text -- | Determine general media category for file path, e.g. -- --
--   mediaCategory "foo.jpg" = Just "image"
--   
mediaCategory :: FilePath -> Maybe Text -- | Definition of a MediaBag object to hold binary resources, and an -- interface for interacting with it. module Text.Pandoc.MediaBag -- | A container for a collection of binary resources, with names and mime -- types. Note that a MediaBag is a Monoid, so mempty can -- be used for an empty MediaBag, and <> can be used -- to append two MediaBags. data MediaBag -- | Delete a media item from a MediaBag, or do nothing if no item -- corresponds to the given path. deleteMedia :: FilePath -> MediaBag -> MediaBag -- | Lookup a media item in a MediaBag, returning mime type and -- contents. lookupMedia :: FilePath -> MediaBag -> Maybe (MimeType, ByteString) -- | Insert a media item into a MediaBag, replacing any existing -- value with the same name. insertMedia :: FilePath -> Maybe MimeType -> ByteString -> MediaBag -> MediaBag -- | Get a list of the file paths stored in a MediaBag, with their -- corresponding mime types and the lengths in bytes of the contents. mediaDirectory :: MediaBag -> [(FilePath, MimeType, Int)] mediaItems :: MediaBag -> [(FilePath, MimeType, ByteString)] instance Data.Data.Data Text.Pandoc.MediaBag.MediaBag instance GHC.Base.Monoid Text.Pandoc.MediaBag.MediaBag instance GHC.Base.Semigroup Text.Pandoc.MediaBag.MediaBag instance GHC.Show.Show Text.Pandoc.MediaBag.MediaBag -- | ByteString variant of readProcessWithExitCode. module Text.Pandoc.Process -- | Version of readProcessWithExitCode that uses lazy bytestrings -- instead of strings and allows setting environment variables. -- -- readProcessWithExitCode creates an external process, reads -- its standard output strictly, waits until the process terminates, and -- then returns the ExitCode of the process and the standard -- output. stderr is inherited from the parent. -- -- If an asynchronous exception is thrown to the thread executing -- readProcessWithExitCode, the forked process will be -- terminated and readProcessWithExitCode will wait (block) -- until the process has been terminated. -- -- This function was adapted from readProcessWithExitCode of -- module System.Process, package process-1.6.3.0. The original code is -- BSD licensed and © University of Glasgow 2004-2008. pipeProcess :: Maybe [(String, String)] -> FilePath -> [String] -> ByteString -> IO (ExitCode, ByteString) -- | Utility functions and definitions used by the various Pandoc modules. module Text.Pandoc.Shared -- | Split list by groups of one or more sep. splitBy :: (a -> Bool) -> [a] -> [[a]] -- | Split text by groups of one or more separator. splitTextBy :: (Char -> Bool) -> Text -> [Text] splitTextByIndices :: [Int] -> Text -> [Text] ordNub :: Ord a => [a] -> [a] findM :: forall m t a. (Monad m, Foldable t) => (a -> m Bool) -> t a -> m (Maybe a) tshow :: Show a => a -> Text -- | True exactly when the Char appears in the -- Text. elemText :: Char -> Text -> Bool -- | True exactly when the Char does not appear in the -- Text. notElemText :: Char -> Text -> Bool -- | Strip trailing newlines from string. stripTrailingNewlines :: Text -> Text -- | Remove leading and trailing space (including newlines) from string. trim :: Text -> Text -- | Remove leading space (including newlines) from string. triml :: Text -> Text -- | Remove trailing space (including newlines) from string. trimr :: Text -> Text -- | Trim leading space and trailing space unless after . trimMath :: Text -> Text -- | Strip leading and trailing characters from string stripFirstAndLast :: Text -> Text -- | Change CamelCase word to hyphenated lowercase (e.g., camel-case). camelCaseToHyphenated :: Text -> Text camelCaseStrToHyphenated :: String -> String -- | Convert number < 4000 to uppercase roman numeral. toRomanNumeral :: Int -> Text -- | Escape whitespace and some punctuation characters in URI. escapeURI :: Text -> Text -- | Convert tabs to spaces. Tabs will be preserved if tab stop is set to -- 0. tabFilter :: Int -> Text -> Text -- | Strip out DOS line endings. crFilter :: Text -> Text -- | Parse a date and convert (if possible) to "YYYY-MM-DD" format. We -- limit years to the range 1601-9999 (ISO 8601 accepts greater than or -- equal to 1583, but MS Word only accepts dates starting 1601). normalizeDate :: Text -> Maybe Text -- | Generate infinite lazy list of markers for an ordered list, depending -- on list attributes. orderedListMarkers :: (Int, ListNumberStyle, ListNumberDelim) -> [Text] -- | Extract the leading and trailing spaces from inside an inline element -- and place them outside the element. SoftBreaks count as Spaces for -- these purposes. extractSpaces :: (Inlines -> Inlines) -> Inlines -> Inlines -- | Extract inlines, removing formatting. removeFormatting :: Walkable Inline a => a -> [Inline] deNote :: Inline -> Inline deLink :: Inline -> Inline -- | Convert pandoc structure to a string with formatting removed. -- Footnotes are skipped (since we don't want their contents in link -- labels). stringify :: Walkable Inline a => a -> Text -- | Bring all regular text in a pandoc structure to uppercase. -- -- This function correctly handles cases where a lowercase character -- doesn't match to a single uppercase character – e.g. “Straße” would be -- converted to “STRASSE”, not “STRAßE”. capitalize :: Walkable Inline a => a -> a -- | Change final list item from Para to Plain if the -- list contains no other Para blocks. Otherwise (if the list -- items contain Para blocks besides possibly at the end), turn -- any Plains into Paras (#5285). compactify :: [Blocks] -> [Blocks] -- | Like compactify, but acts on items of definition lists. compactifyDL :: [(Inlines, [Blocks])] -> [(Inlines, [Blocks])] -- | Convert a list of lines into a paragraph with hard line breaks. This -- is useful e.g. for rudimentary support of LineBlock elements in -- writers. linesToPara :: [[Inline]] -> Block -- | Put a list of Pandoc blocks into a hierarchical structure: a list of -- sections (each a Div with class "section" and first element a Header). -- If the numbering parameter is True, Header numbers are added -- via the number attribute on the header. If the baseLevel parameter is -- Just n, Header levels are adjusted to be gapless starting at level n. makeSections :: Bool -> Maybe Int -> [Block] -> [Block] -- | Generate a unique identifier from a list of inlines. Second argument -- is a list of already used identifiers. uniqueIdent :: Extensions -> [Inline] -> Set Text -> Text -- | Convert Pandoc inline list to plain text identifier. HTML identifiers -- must start with a letter, and may contain only letters, digits, and -- the characters _-. inlineListToIdentifier :: Extensions -> [Inline] -> Text -- | True if block is a Header block. isHeaderBlock :: Block -> Bool -- | Shift header levels up or down. headerShift :: Int -> Pandoc -> Pandoc -- | Remove empty paragraphs. stripEmptyParagraphs :: Pandoc -> Pandoc -- | Detect if table rows contain only cells consisting of a single -- paragraph that has no LineBreak. onlySimpleTableCells :: [[[Block]]] -> Bool -- | Detect if a list is tight. isTightList :: [[Block]] -> Bool -- | Convert a list item containing tasklist syntax (e.g. [x]) to -- using U+2610 BALLOT BOX or U+2612 BALLOT BOX WITH X. taskListItemFromAscii :: Extensions -> [Block] -> [Block] -- | Convert a list item containing text starting with U+2610 BALLOT -- BOX or U+2612 BALLOT BOX WITH X to tasklist syntax (e.g. -- [x]). taskListItemToAscii :: Extensions -> [Block] -> [Block] handleTaskListItem :: ([Inline] -> [Inline]) -> Extensions -> [Block] -> [Block] -- | Set a field of a Meta object. If the field already has a value, -- convert it into a list with the new value appended to the old -- value(s). addMetaField :: ToMetaValue a => Text -> a -> Meta -> Meta -- | Create Meta from old-style title, authors, date. This is -- provided to ease the transition from the old API. makeMeta :: [Inline] -> [[Inline]] -> [Inline] -> Meta -- | Remove soft breaks between East Asian characters. eastAsianLineBreakFilter :: Pandoc -> Pandoc -- | Set of HTML elements that are represented as Span with a class equal -- as the element tag itself. htmlSpanLikeElements :: Set Text -- | Split a list of inlines into sentences. splitSentences :: [Inline] -> [[Inline]] -- | Process ipynb output cells. If mode is Nothing, remove all output. If -- mode is Just format, select best output for the format. If format is -- not ipynb, strip out ANSI escape sequences from CodeBlocks (see -- #5633). filterIpynbOutput :: Maybe Format -> Pandoc -> Pandoc -- | Render HTML tags. renderTags' :: [Tag Text] -> Text -- | Perform an IO action in a directory, returning to starting directory. inDirectory :: FilePath -> IO a -> IO a -- | Remove intermediate "." and ".." directories from a path. -- --
--   collapseFilePath "./foo" == "foo"
--   collapseFilePath "/bar/../baz" == "/baz"
--   collapseFilePath "/../baz" == "/../baz"
--   collapseFilePath "parent/foo/baz/../bar" ==  "parent/foo/bar"
--   collapseFilePath "parent/foo/baz/../../bar" ==  "parent/bar"
--   collapseFilePath "parent/foo/.." ==  "parent"
--   collapseFilePath "/parent/foo/../../bar" ==  "/bar"
--   
collapseFilePath :: FilePath -> FilePath uriPathToPath :: Text -> FilePath filteredFilesFromArchive :: Archive -> (FilePath -> Bool) -> [(FilePath, ByteString)] -- | Schemes from http://www.iana.org/assignments/uri-schemes.html -- plus the unofficial schemes doi, javascript, isbn, pmid. schemes :: Set Text -- | Check if the string is a valid URL with a IANA or frequently used but -- unofficial scheme (see schemes). isURI :: Text -> Bool mapLeft :: (a -> b) -> Either a c -> Either b c blocksToInlines :: [Block] -> [Inline] blocksToInlines' :: [Block] -> Inlines blocksToInlinesWithSep :: Inlines -> [Block] -> Inlines -- | Inline elements used to separate blocks when squashing blocks into -- inlines. defaultBlocksSeparator :: Inlines safeRead :: (MonadPlus m, Read a) => Text -> m a safeStrRead :: (MonadPlus m, Read a) => String -> m a -- | Return appropriate user data directory for platform. We use -- XDG_DATA_HOME (or its default value), but for backwards compatibility, -- we fall back to the legacy user data directory ($HOME/.pandoc on *nix) -- if the XDG_DATA_HOME is missing and this exists. If neither directory -- is present, we return the XDG data directory. defaultUserDataDir :: IO FilePath -- | Version number of pandoc library. pandocVersion :: Text -- | This module provides data types and functions for warnings and info -- messages. module Text.Pandoc.Logging -- | Verbosity level. data Verbosity ERROR :: Verbosity WARNING :: Verbosity INFO :: Verbosity data LogMessage SkippedContent :: Text -> SourcePos -> LogMessage IgnoredElement :: Text -> LogMessage DuplicateLinkReference :: Text -> SourcePos -> LogMessage DuplicateNoteReference :: Text -> SourcePos -> LogMessage NoteDefinedButNotUsed :: Text -> SourcePos -> LogMessage DuplicateIdentifier :: Text -> SourcePos -> LogMessage ReferenceNotFound :: Text -> SourcePos -> LogMessage CircularReference :: Text -> SourcePos -> LogMessage UndefinedToggle :: Text -> SourcePos -> LogMessage ParsingUnescaped :: Text -> SourcePos -> LogMessage CouldNotLoadIncludeFile :: Text -> SourcePos -> LogMessage MacroAlreadyDefined :: Text -> SourcePos -> LogMessage InlineNotRendered :: Inline -> LogMessage BlockNotRendered :: Block -> LogMessage DocxParserWarning :: Text -> LogMessage IgnoredIOError :: Text -> LogMessage CouldNotFetchResource :: Text -> Text -> LogMessage CouldNotDetermineImageSize :: Text -> Text -> LogMessage CouldNotConvertImage :: Text -> Text -> LogMessage CouldNotDetermineMimeType :: Text -> LogMessage CouldNotConvertTeXMath :: Text -> Text -> LogMessage CouldNotParseCSS :: Text -> LogMessage Fetching :: Text -> LogMessage Extracting :: Text -> LogMessage NoTitleElement :: Text -> LogMessage NoLangSpecified :: LogMessage InvalidLang :: Text -> LogMessage CouldNotHighlight :: Text -> LogMessage MissingCharacter :: Text -> LogMessage Deprecated :: Text -> Text -> LogMessage NoTranslation :: Text -> LogMessage CouldNotLoadTranslations :: Text -> Text -> LogMessage UnusualConversion :: Text -> LogMessage UnexpectedXmlElement :: Text -> Text -> LogMessage UnknownOrgExportOption :: Text -> LogMessage CouldNotDeduceFormat :: [Text] -> Text -> LogMessage RunningFilter :: FilePath -> LogMessage FilterCompleted :: FilePath -> Integer -> LogMessage CiteprocWarning :: Text -> LogMessage ATXHeadingInLHS :: Int -> Text -> LogMessage EnvironmentVariableUndefined :: Text -> LogMessage DuplicateAttribute :: Text -> Text -> LogMessage encodeLogMessages :: [LogMessage] -> ByteString showLogMessage :: LogMessage -> Text messageVerbosity :: LogMessage -> Verbosity instance GHC.Generics.Generic Text.Pandoc.Logging.Verbosity instance GHC.Enum.Bounded Text.Pandoc.Logging.Verbosity instance GHC.Classes.Ord Text.Pandoc.Logging.Verbosity instance GHC.Enum.Enum Text.Pandoc.Logging.Verbosity instance Data.Data.Data Text.Pandoc.Logging.Verbosity instance GHC.Classes.Eq Text.Pandoc.Logging.Verbosity instance GHC.Read.Read Text.Pandoc.Logging.Verbosity instance GHC.Show.Show Text.Pandoc.Logging.Verbosity instance GHC.Generics.Generic Text.Pandoc.Logging.LogMessage instance GHC.Classes.Ord Text.Pandoc.Logging.LogMessage instance Data.Data.Data Text.Pandoc.Logging.LogMessage instance GHC.Classes.Eq Text.Pandoc.Logging.LogMessage instance GHC.Show.Show Text.Pandoc.Logging.LogMessage instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Logging.LogMessage instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Logging.Verbosity instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Logging.Verbosity instance Data.YAML.FromYAML Text.Pandoc.Logging.Verbosity -- | Exports functions for syntax highlighting. module Text.Pandoc.Highlighting highlightingStyles :: [(Text, Style)] languages :: [Text] languagesByExtension :: Text -> [Text] highlight :: SyntaxMap -> (FormatOptions -> [SourceLine] -> a) -> Attr -> Text -> Either Text a -- | Formats tokens as LaTeX using custom commands inside | -- characters. Assumes that | is defined as a short verbatim -- command by the macros produced by styleToLaTeX. A -- KeywordTok is rendered using \KeywordTok{..}, and so -- on. formatLaTeXInline :: FormatOptions -> [SourceLine] -> Text -- | Format tokens as a LaTeX Highlighting environment inside a -- Shaded environment. Highlighting and Shaded -- are defined by the macros produced by styleToLaTeX. -- Highlighting is a verbatim environment using -- fancyvrb; \, {, and } have their -- normal meanings inside this environment, so that formatting commands -- work. Shaded is either nothing (if the style's background -- color is default) or a snugshade environment from -- framed, providing a background color for the whole code -- block, even if it spans multiple pages. formatLaTeXBlock :: FormatOptions -> [SourceLine] -> Text -- | Converts a Style to a set of LaTeX macro definitions, which -- should be placed in the document's preamble. Note: default LaTeX setup -- doesn't allow boldface typewriter font. To make boldface work in -- styles, you need to use a different typewriter font. This will work -- for computer modern: -- --
--   \DeclareFontShape{OT1}{cmtt}{bx}{n}{<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10}{}
--   
-- -- Or, with xelatex: -- --
--   \usepackage{fontspec}
--   \setmainfont[SmallCapsFont={* Caps}]{Latin Modern Roman}
--   \setsansfont{Latin Modern Sans}
--   \setmonofont[SmallCapsFont={Latin Modern Mono Caps}]{Latin Modern Mono Light}
--   
styleToLaTeX :: Style -> Text -- | Format tokens using HTML spans inside code tags. For example, -- A KeywordTok is rendered as a span with class kw. -- Short class names correspond to TokenTypes as follows: -- KeywordTok = kw, DataTypeTok = dt, -- DecValTok = dv, BaseNTok = bn, -- FloatTok = fl, CharTok = ch, -- StringTok = st, CommentTok = co, -- OtherTok = ot, AlertTok = al, -- FunctionTok = fu, RegionMarkerTok = -- re, ErrorTok = er, ConstantTok = -- cn, SpecialCharTok = sc, -- VerbatimStringTok = vs, SpecialStringTok = -- ss, ImportTok = im, DocumentationTok = -- do, AnnotationTok = an, CommentVarTok -- = cv, VariableTok = va, ControlFlowTok -- = cf, OperatorTok = op, BuiltInTok = -- bu, ExtensionTok = ex, PreprocessorTok -- = pp, AttributeTok = at, -- InformationTok = in, WarningTok = wa. -- A NormalTok is not marked up at all. formatHtmlInline :: FormatOptions -> [SourceLine] -> Html -- | Format tokens as an HTML pre block. Each line is wrapped in -- an a element with the class ‘source-line’. If line numbering is -- selected, the surrounding pre is given the class ‘numberSource’, and -- the resulting html will display line numbers thanks to the included -- CSS. See the documentation for formatHtmlInline for information -- about how tokens are encoded. formatHtmlBlock :: FormatOptions -> [SourceLine] -> Html -- | Returns CSS for styling highlighted code according to the given style. styleToCss :: Style -> String -- | Style based on pygments's default colors. pygments :: Style -- | Style based on ultraviolet's espresso_libre.css (dark background). espresso :: Style -- | Style based on the popular zenburn vim color scheme zenburn :: Style -- | Style based on pygments's tango colors. tango :: Style -- | Style based on kate's default colors. kate :: Style -- | Style with no colors. monochrome :: Style -- | Style from the breeze-dark KDE syntax highlighting theme. breezeDark :: Style -- | Style based on haddock's source highlighting. haddock :: Style -- | A rendering style. This determines how each kind of token is to be -- rendered, and sets a default color and background color for normal -- tokens. Line numbers can have a different color and background color. data Style -- | Determine skylighting language name from listings language name. fromListingsLanguage :: Text -> Maybe Text -- | Determine listings language name from skylighting language name. toListingsLanguage :: Text -> Maybe Text -- | Data structures and functions for representing parser and writer -- options. module Text.Pandoc.Options data ReaderOptions ReaderOptions :: Extensions -> Bool -> Int -> Int -> [Text] -> Set Text -> Text -> TrackChanges -> Bool -> ReaderOptions -- | Syntax extensions [readerExtensions] :: ReaderOptions -> Extensions -- | Standalone document with header [readerStandalone] :: ReaderOptions -> Bool -- | Number of columns in terminal [readerColumns] :: ReaderOptions -> Int -- | Tab stop [readerTabStop] :: ReaderOptions -> Int -- | Default classes for indented code blocks [readerIndentedCodeClasses] :: ReaderOptions -> [Text] -- | Strings to treat as abbreviations [readerAbbreviations] :: ReaderOptions -> Set Text -- | Default extension for images [readerDefaultImageExtension] :: ReaderOptions -> Text -- | Track changes setting for docx [readerTrackChanges] :: ReaderOptions -> TrackChanges -- | Strip HTML comments instead of parsing as raw HTML (only implemented -- in commonmark) [readerStripComments] :: ReaderOptions -> Bool data HTMLMathMethod PlainMath :: HTMLMathMethod WebTeX :: Text -> HTMLMathMethod GladTeX :: HTMLMathMethod MathML :: HTMLMathMethod MathJax :: Text -> HTMLMathMethod KaTeX :: Text -> HTMLMathMethod data CiteMethod Citeproc :: CiteMethod Natbib :: CiteMethod Biblatex :: CiteMethod -- | Methods for obfuscating email addresses in HTML. data ObfuscationMethod NoObfuscation :: ObfuscationMethod ReferenceObfuscation :: ObfuscationMethod JavascriptObfuscation :: ObfuscationMethod -- | Varieties of HTML slide shows. data HTMLSlideVariant S5Slides :: HTMLSlideVariant SlidySlides :: HTMLSlideVariant SlideousSlides :: HTMLSlideVariant DZSlides :: HTMLSlideVariant RevealJsSlides :: HTMLSlideVariant NoSlides :: HTMLSlideVariant data EPUBVersion EPUB2 :: EPUBVersion EPUB3 :: EPUBVersion -- | Options for wrapping text in the output. data WrapOption -- | Automatically wrap to width WrapAuto :: WrapOption -- | No non-semantic newlines WrapNone :: WrapOption -- | Preserve wrapping of input source WrapPreserve :: WrapOption -- | Options defining the type of top-level headers. data TopLevelDivision -- | Top-level headers become parts TopLevelPart :: TopLevelDivision -- | Top-level headers become chapters TopLevelChapter :: TopLevelDivision -- | Top-level headers become sections TopLevelSection :: TopLevelDivision -- | Top-level type is determined via heuristics TopLevelDefault :: TopLevelDivision -- | Options for writers data WriterOptions WriterOptions :: Maybe (Template Text) -> Context Text -> Int -> Bool -> Bool -> HTMLMathMethod -> Bool -> [Int] -> Bool -> Extensions -> Bool -> Int -> WrapOption -> Int -> ObfuscationMethod -> Text -> CiteMethod -> Bool -> Maybe Int -> TopLevelDivision -> Bool -> Maybe Style -> Bool -> Text -> Maybe Text -> [FilePath] -> Int -> Int -> Maybe FilePath -> ReferenceLocation -> SyntaxMap -> Bool -> WriterOptions -- | Template to use [writerTemplate] :: WriterOptions -> Maybe (Template Text) -- | Variables to set in template [writerVariables] :: WriterOptions -> Context Text -- | Tabstop for conversion btw spaces and tabs [writerTabStop] :: WriterOptions -> Int -- | Include table of contents [writerTableOfContents] :: WriterOptions -> Bool -- | True if lists should be incremental [writerIncremental] :: WriterOptions -> Bool -- | How to print math in HTML [writerHTMLMathMethod] :: WriterOptions -> HTMLMathMethod -- | Number sections in LaTeX [writerNumberSections] :: WriterOptions -> Bool -- | Starting number for section, subsection, ... [writerNumberOffset] :: WriterOptions -> [Int] -- | Put sections in div tags in HTML [writerSectionDivs] :: WriterOptions -> Bool -- | Markdown extensions that can be used [writerExtensions] :: WriterOptions -> Extensions -- | Use reference links in writing markdown, rst [writerReferenceLinks] :: WriterOptions -> Bool -- | Dpi for pixel to/from inch/cm conversions [writerDpi] :: WriterOptions -> Int -- | Option for wrapping text [writerWrapText] :: WriterOptions -> WrapOption -- | Characters in a line (for text wrapping) [writerColumns] :: WriterOptions -> Int -- | How to obfuscate emails [writerEmailObfuscation] :: WriterOptions -> ObfuscationMethod -- | Prefix for section & note ids in HTML and for footnote marks in -- markdown [writerIdentifierPrefix] :: WriterOptions -> Text -- | How to print cites [writerCiteMethod] :: WriterOptions -> CiteMethod -- | Use q tags for quotes in HTML [writerHtmlQTags] :: WriterOptions -> Bool -- | Force header level of slides [writerSlideLevel] :: WriterOptions -> Maybe Int -- | Type of top-level divisions [writerTopLevelDivision] :: WriterOptions -> TopLevelDivision -- | Use listings package for code [writerListings] :: WriterOptions -> Bool -- | Style to use for highlighting (Nothing = no highlighting) [writerHighlightStyle] :: WriterOptions -> Maybe Style -- | Use setext headers for levels 1-2 in markdown [writerSetextHeaders] :: WriterOptions -> Bool -- | Subdir for epub in OCF [writerEpubSubdirectory] :: WriterOptions -> Text -- | Metadata to include in EPUB [writerEpubMetadata] :: WriterOptions -> Maybe Text -- | Paths to fonts to embed [writerEpubFonts] :: WriterOptions -> [FilePath] -- | Header level for chapters (separate files) [writerEpubChapterLevel] :: WriterOptions -> Int -- | Number of levels to include in TOC [writerTOCDepth] :: WriterOptions -> Int -- | Path to reference document if specified [writerReferenceDoc] :: WriterOptions -> Maybe FilePath -- | Location of footnotes and references for writing markdown [writerReferenceLocation] :: WriterOptions -> ReferenceLocation [writerSyntaxMap] :: WriterOptions -> SyntaxMap -- | Prefer ASCII representations of characters when possible [writerPreferAscii] :: WriterOptions -> Bool -- | Options for accepting or rejecting MS Word track-changes. data TrackChanges AcceptChanges :: TrackChanges RejectChanges :: TrackChanges AllChanges :: TrackChanges -- | Locations for footnotes and references in markdown output data ReferenceLocation -- | End of block EndOfBlock :: ReferenceLocation -- | prior to next section header (or end of document) EndOfSection :: ReferenceLocation -- | at end of document EndOfDocument :: ReferenceLocation -- | The default value for this type. def :: Default a => a -- | Returns True if the given extension is enabled. isEnabled :: HasSyntaxExtensions a => Extension -> a -> Bool defaultMathJaxURL :: Text defaultKaTeXURL :: Text instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.ReferenceLocation instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.ReferenceLocation instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.TopLevelDivision instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.TopLevelDivision instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.WrapOption instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.WrapOption instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.TrackChanges instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.TrackChanges instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.HTMLSlideVariant instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.HTMLSlideVariant instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.ObfuscationMethod instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.ObfuscationMethod instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.CiteMethod instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.CiteMethod instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.HTMLMathMethod instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.HTMLMathMethod instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Options.ReaderOptions instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Options.ReaderOptions instance GHC.Generics.Generic Text.Pandoc.Options.EPUBVersion instance Data.Data.Data Text.Pandoc.Options.EPUBVersion instance GHC.Read.Read Text.Pandoc.Options.EPUBVersion instance GHC.Show.Show Text.Pandoc.Options.EPUBVersion instance GHC.Classes.Eq Text.Pandoc.Options.EPUBVersion instance GHC.Generics.Generic Text.Pandoc.Options.HTMLMathMethod instance Data.Data.Data Text.Pandoc.Options.HTMLMathMethod instance GHC.Classes.Eq Text.Pandoc.Options.HTMLMathMethod instance GHC.Read.Read Text.Pandoc.Options.HTMLMathMethod instance GHC.Show.Show Text.Pandoc.Options.HTMLMathMethod instance GHC.Generics.Generic Text.Pandoc.Options.CiteMethod instance Data.Data.Data Text.Pandoc.Options.CiteMethod instance GHC.Classes.Eq Text.Pandoc.Options.CiteMethod instance GHC.Read.Read Text.Pandoc.Options.CiteMethod instance GHC.Show.Show Text.Pandoc.Options.CiteMethod instance GHC.Generics.Generic Text.Pandoc.Options.ObfuscationMethod instance Data.Data.Data Text.Pandoc.Options.ObfuscationMethod instance GHC.Classes.Eq Text.Pandoc.Options.ObfuscationMethod instance GHC.Read.Read Text.Pandoc.Options.ObfuscationMethod instance GHC.Show.Show Text.Pandoc.Options.ObfuscationMethod instance GHC.Generics.Generic Text.Pandoc.Options.HTMLSlideVariant instance Data.Data.Data Text.Pandoc.Options.HTMLSlideVariant instance GHC.Classes.Eq Text.Pandoc.Options.HTMLSlideVariant instance GHC.Read.Read Text.Pandoc.Options.HTMLSlideVariant instance GHC.Show.Show Text.Pandoc.Options.HTMLSlideVariant instance GHC.Generics.Generic Text.Pandoc.Options.TrackChanges instance Data.Data.Data Text.Pandoc.Options.TrackChanges instance GHC.Classes.Eq Text.Pandoc.Options.TrackChanges instance GHC.Read.Read Text.Pandoc.Options.TrackChanges instance GHC.Show.Show Text.Pandoc.Options.TrackChanges instance GHC.Generics.Generic Text.Pandoc.Options.ReaderOptions instance Data.Data.Data Text.Pandoc.Options.ReaderOptions instance GHC.Read.Read Text.Pandoc.Options.ReaderOptions instance GHC.Show.Show Text.Pandoc.Options.ReaderOptions instance GHC.Generics.Generic Text.Pandoc.Options.WrapOption instance Data.Data.Data Text.Pandoc.Options.WrapOption instance GHC.Classes.Eq Text.Pandoc.Options.WrapOption instance GHC.Read.Read Text.Pandoc.Options.WrapOption instance GHC.Show.Show Text.Pandoc.Options.WrapOption instance GHC.Generics.Generic Text.Pandoc.Options.TopLevelDivision instance Data.Data.Data Text.Pandoc.Options.TopLevelDivision instance GHC.Classes.Eq Text.Pandoc.Options.TopLevelDivision instance GHC.Read.Read Text.Pandoc.Options.TopLevelDivision instance GHC.Show.Show Text.Pandoc.Options.TopLevelDivision instance GHC.Generics.Generic Text.Pandoc.Options.ReferenceLocation instance Data.Data.Data Text.Pandoc.Options.ReferenceLocation instance GHC.Classes.Eq Text.Pandoc.Options.ReferenceLocation instance GHC.Read.Read Text.Pandoc.Options.ReferenceLocation instance GHC.Show.Show Text.Pandoc.Options.ReferenceLocation instance GHC.Generics.Generic Text.Pandoc.Options.WriterOptions instance Data.Data.Data Text.Pandoc.Options.WriterOptions instance GHC.Show.Show Text.Pandoc.Options.WriterOptions instance Data.Default.Class.Default Text.Pandoc.Options.WriterOptions instance Text.Pandoc.Options.HasSyntaxExtensions Text.Pandoc.Options.WriterOptions instance Data.YAML.FromYAML Text.Pandoc.Options.ReferenceLocation instance Data.YAML.FromYAML Text.Pandoc.Options.TopLevelDivision instance Data.YAML.FromYAML Text.Pandoc.Options.WrapOption instance Text.Pandoc.Options.HasSyntaxExtensions Text.Pandoc.Options.ReaderOptions instance Data.Default.Class.Default Text.Pandoc.Options.ReaderOptions instance Data.YAML.FromYAML Text.Pandoc.Options.TrackChanges instance Data.YAML.FromYAML Text.Pandoc.Options.ObfuscationMethod instance Data.YAML.FromYAML Text.Pandoc.Options.CiteMethod instance Data.YAML.FromYAML Text.Pandoc.Options.HTMLMathMethod -- | Functions for parsing and rendering BCP47 language identifiers. module Text.Pandoc.BCP47 -- | Get the contents of the lang metadata field or variable. getLang :: WriterOptions -> Meta -> Maybe Text -- | Parse a BCP 47 string as a Lang. Currently we parse extensions and -- private-use fields as "variants," even though officially they aren't. parseBCP47 :: Text -> Either Text Lang -- | Represents BCP 47 language/country code. data Lang Lang :: Text -> Text -> Text -> [Text] -> Lang [langLanguage] :: Lang -> Text [langScript] :: Lang -> Text [langRegion] :: Lang -> Text [langVariants] :: Lang -> [Text] -- | Render a Lang as BCP 47. renderLang :: Lang -> Text instance GHC.Show.Show Text.Pandoc.BCP47.Lang instance GHC.Classes.Ord Text.Pandoc.BCP47.Lang instance GHC.Classes.Eq Text.Pandoc.BCP47.Lang -- | UTF-8 aware string IO functions that will work with GHC 6.10, 6.12, or -- 7. module Text.Pandoc.UTF8 readFile :: FilePath -> IO Text getContents :: IO Text writeFileWith :: Newline -> FilePath -> Text -> IO () writeFile :: FilePath -> Text -> IO () putStrWith :: Newline -> Text -> IO () putStr :: Text -> IO () putStrLnWith :: Newline -> Text -> IO () putStrLn :: Text -> IO () hPutStrWith :: Newline -> Handle -> Text -> IO () hPutStr :: Handle -> Text -> IO () hPutStrLnWith :: Newline -> Handle -> Text -> IO () hPutStrLn :: Handle -> Text -> IO () hGetContents :: Handle -> IO Text -- | Convert UTF8-encoded ByteString to String, also removing 'r' -- characters. toString :: ByteString -> String -- | Convert UTF8-encoded ByteString to Text, also removing 'r' characters. toText :: ByteString -> Text fromString :: String -> ByteString fromText :: Text -> ByteString -- | Convert UTF8-encoded ByteString to String, also removing 'r' -- characters. toStringLazy :: ByteString -> String fromTextLazy :: Text -> ByteString -- | Convert UTF8-encoded ByteString to Text, also removing 'r' characters. toTextLazy :: ByteString -> Text fromStringLazy :: String -> ByteString encodePath :: FilePath -> FilePath decodeArg :: String -> String -- | This module provides a standard way to deal with possible errors -- encountered during parsing. module Text.Pandoc.Error data PandocError PandocIOError :: Text -> IOError -> PandocError PandocHttpError :: Text -> HttpException -> PandocError PandocShouldNeverHappenError :: Text -> PandocError PandocSomeError :: Text -> PandocError PandocParseError :: Text -> PandocError PandocParsecError :: Input -> ParseError -> PandocError PandocMakePDFError :: Text -> PandocError PandocOptionError :: Text -> PandocError PandocSyntaxMapError :: Text -> PandocError PandocFailOnWarningError :: PandocError PandocPDFProgramNotFoundError :: Text -> PandocError PandocPDFError :: Text -> PandocError PandocXMLError :: Text -> Text -> PandocError PandocFilterError :: Text -> Text -> PandocError PandocLuaError :: Text -> PandocError PandocCouldNotFindDataFileError :: Text -> PandocError PandocResourceNotFound :: Text -> PandocError PandocTemplateError :: Text -> PandocError PandocAppError :: Text -> PandocError PandocEpubSubdirectoryError :: Text -> PandocError PandocMacroLoop :: Text -> PandocError PandocUTF8DecodingError :: Text -> Int -> Word8 -> PandocError PandocIpynbDecodingError :: Text -> PandocError PandocUnsupportedCharsetError :: Text -> PandocError PandocUnknownReaderError :: Text -> PandocError PandocUnknownWriterError :: Text -> PandocError PandocUnsupportedExtensionError :: Text -> Text -> PandocError PandocCiteprocError :: CiteprocError -> PandocError PandocBibliographyError :: Text -> Text -> PandocError renderError :: PandocError -> Text -- | Handle PandocError by exiting with an error message. handleError :: Either PandocError a -> IO a instance GHC.Generics.Generic Text.Pandoc.Error.PandocError instance GHC.Show.Show Text.Pandoc.Error.PandocError instance GHC.Exception.Type.Exception Text.Pandoc.Error.PandocError -- | Utility functions for working with pandoc templates. module Text.Pandoc.Templates -- | A template. data Template a -- | Wrap a Monad in this if you want partials to be taken only from the -- default data files. newtype WithDefaultPartials m a WithDefaultPartials :: m a -> WithDefaultPartials m a [runWithDefaultPartials] :: WithDefaultPartials m a -> m a -- | Wrap a Monad in this if you want partials to be looked for locally -- (or, when the main template is at a URL, via HTTP), falling back to -- default data files. newtype WithPartials m a WithPartials :: m a -> WithPartials m a [runWithPartials] :: WithPartials m a -> m a -- | Compile a template. The FilePath parameter is used to determine a -- default path and extension for partials and may be left empty if -- partials are not used. compileTemplate :: (TemplateMonad m, TemplateTarget a) => FilePath -> Text -> m (Either String (Template a)) -- | Render a compiled template in a "context" which provides values for -- the template's variables. renderTemplate :: (TemplateTarget a, ToContext a b) => Template a -> b -> Doc a -- | Retrieve text for a template. getTemplate :: PandocMonad m => FilePath -> m Text -- | Get default template for the specified writer. getDefaultTemplate :: PandocMonad m => Text -> m Text -- | Get and compile default template for the specified writer. Raise an -- error on compilation failure. compileDefaultTemplate :: PandocMonad m => Text -> m (Template Text) instance GHC.Base.Monad m => GHC.Base.Monad (Text.Pandoc.Templates.WithDefaultPartials m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Text.Pandoc.Templates.WithDefaultPartials m) instance GHC.Base.Functor m => GHC.Base.Functor (Text.Pandoc.Templates.WithDefaultPartials m) instance GHC.Base.Monad m => GHC.Base.Monad (Text.Pandoc.Templates.WithPartials m) instance GHC.Base.Applicative m => GHC.Base.Applicative (Text.Pandoc.Templates.WithPartials m) instance GHC.Base.Functor m => GHC.Base.Functor (Text.Pandoc.Templates.WithPartials m) instance Text.Pandoc.Class.PandocMonad.PandocMonad m => Text.DocTemplates.Internal.TemplateMonad (Text.Pandoc.Templates.WithPartials m) instance Text.Pandoc.Class.PandocMonad.PandocMonad m => Text.DocTemplates.Internal.TemplateMonad (Text.Pandoc.Templates.WithDefaultPartials m) -- | Functions for converting an HTML file into one that can be viewed -- offline, by incorporating linked images, CSS, and scripts into the -- HTML using data URIs. module Text.Pandoc.SelfContained makeDataURI :: (MimeType, ByteString) -> Text -- | Convert HTML into self-contained HTML, incorporating images, scripts, -- and CSS using data: URIs. makeSelfContained :: PandocMonad m => Text -> m Text -- | Conversion of a string representation of a pandoc type -- (Pandoc, [Block], Block, [Inline], -- or Inline) to a Pandoc document. module Text.Pandoc.Readers.Native -- | Read native formatted text and return a Pandoc document. The input may -- be a full pandoc document, a block list, a block, an inline list, or -- an inline. Thus, for example, -- --
--   Str "hi"
--   
-- -- will be treated as if it were -- --
--   Pandoc nullMeta [Plain [Str "hi"]]
--   
readNative :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of jira wiki formatted plain text to Pandoc -- document. module Text.Pandoc.Readers.Jira -- | Read Jira wiki markup. readJira :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of Haddock markup to Pandoc document. module Text.Pandoc.Readers.Haddock -- | Parse Haddock markup and return a Pandoc document. readHaddock :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | This module defines a type class, PandocMonad, for pandoc -- readers and writers. A pure instance PandocPure and an impure -- instance PandocIO are provided. This allows users of the -- library to choose whether they want conversions to perform IO -- operations (such as reading include files or images). module Text.Pandoc.Class -- | CommonState represents state that is used by all instances of -- PandocMonad. Normally users should not need to interact with -- it directly; instead, auxiliary functions like setVerbosity -- and withMediaBag should be used. data CommonState CommonState :: [LogMessage] -> Maybe FilePath -> Maybe Text -> [(Text, Text)] -> Bool -> MediaBag -> Maybe (Lang, Maybe Translations) -> [FilePath] -> Maybe FilePath -> [FilePath] -> Verbosity -> Bool -> CommonState -- | A list of log messages in reverse order [stLog] :: CommonState -> [LogMessage] -- | Directory to search for data files [stUserDataDir] :: CommonState -> Maybe FilePath -- | Absolute URL + dir of 1st source file [stSourceURL] :: CommonState -> Maybe Text -- | Headers to add for HTTP requests [stRequestHeaders] :: CommonState -> [(Text, Text)] -- | Controls whether certificate validation is disabled [stNoCheckCertificate] :: CommonState -> Bool -- | Media parsed from binary containers [stMediaBag] :: CommonState -> MediaBag -- | Translations for localization [stTranslations] :: CommonState -> Maybe (Lang, Maybe Translations) -- | List of input files from command line [stInputFiles] :: CommonState -> [FilePath] -- | Output file from command line [stOutputFile] :: CommonState -> Maybe FilePath -- | Path to search for resources like included images [stResourcePath] :: CommonState -> [FilePath] -- | Verbosity level [stVerbosity] :: CommonState -> Verbosity -- | Controls whether tracing messages are issued. [stTrace] :: CommonState -> Bool newtype PandocIO a PandocIO :: ExceptT PandocError (StateT CommonState IO) a -> PandocIO a [unPandocIO] :: PandocIO a -> ExceptT PandocError (StateT CommonState IO) a -- | Evaluate a PandocIO operation. runIO :: PandocIO a -> IO (Either PandocError a) -- | Evaluate a PandocIO operation, handling any errors by exiting -- with an appropriate message and error status. runIOorExplode :: PandocIO a -> IO a -- | Extract media from the mediabag into a directory. extractMedia :: FilePath -> Pandoc -> PandocIO Pandoc -- | The PandocMonad typeclass contains all the potentially IO-related -- functions used in pandoc's readers and writers. Instances of this -- typeclass may implement these functions in IO (as in -- PandocIO) or using an internal state that represents a file -- system, time, and so on (as in PandocPure). class (Functor m, Applicative m, Monad m, MonadError PandocError m) => PandocMonad m -- | Lookup an environment variable. lookupEnv :: PandocMonad m => Text -> m (Maybe Text) -- | Get the current (UTC) time. getCurrentTime :: PandocMonad m => m UTCTime -- | Get the locale's time zone. getCurrentTimeZone :: PandocMonad m => m TimeZone -- | Return a new generator for random numbers. newStdGen :: PandocMonad m => m StdGen -- | Return a new unique integer. newUniqueHash :: PandocMonad m => m Int -- | Retrieve contents and mime type from a URL, raising an error on -- failure. openURL :: PandocMonad m => Text -> m (ByteString, Maybe MimeType) -- | Read the lazy ByteString contents from a file path, raising an error -- on failure. readFileLazy :: PandocMonad m => FilePath -> m ByteString -- | Read the strict ByteString contents from a file path, raising an error -- on failure. readFileStrict :: PandocMonad m => FilePath -> m ByteString -- | Return a list of paths that match a glob, relative to the working -- directory. See Glob for the glob syntax. glob :: PandocMonad m => String -> m [FilePath] -- | Returns True if file exists. fileExists :: PandocMonad m => FilePath -> m Bool -- | Returns the path of data file. getDataFileName :: PandocMonad m => FilePath -> m FilePath -- | Return the modification time of a file. getModificationTime :: PandocMonad m => FilePath -> m UTCTime -- | Get the value of the CommonState used by all instances of -- PandocMonad. getCommonState :: PandocMonad m => m CommonState -- | Set the value of the CommonState used by all instances of -- PandocMonad. | Get the value of a specific field of -- CommonState. putCommonState :: PandocMonad m => CommonState -> m () -- | Get the value of a specific field of CommonState. getsCommonState :: PandocMonad m => (CommonState -> a) -> m a -- | Modify the CommonState. modifyCommonState :: PandocMonad m => (CommonState -> CommonState) -> m () -- | Output a log message. logOutput :: PandocMonad m => LogMessage -> m () -- | Output a debug message to sterr, using trace, if tracing is -- enabled. Note: this writes to stderr even in pure instances. trace :: PandocMonad m => Text -> m () -- | Get the POSIX time. getPOSIXTime :: PandocMonad m => m POSIXTime -- | Get the zoned time. getZonedTime :: PandocMonad m => m ZonedTime -- | Read file, checking in any number of directories. readFileFromDirs :: PandocMonad m => [FilePath] -> FilePath -> m (Maybe Text) -- | Log a message using logOutput. Note that logOutput is -- called only if the verbosity level exceeds the level of the message, -- but the message is added to the list of log messages that will be -- retrieved by getLog regardless of its verbosity level. report :: PandocMonad m => LogMessage -> m () -- | Determine whether tracing is enabled. This affects the behavior of -- trace. If tracing is not enabled, trace does nothing. setTrace :: PandocMonad m => Bool -> m () -- | Set request header to use in HTTP requests. setRequestHeader :: PandocMonad m => Text -> Text -> m () -- | Determine whether certificate validation is disabled setNoCheckCertificate :: PandocMonad m => Bool -> m () -- | Get the accumulated log messages (in temporal order). getLog :: PandocMonad m => m [LogMessage] -- | Set the verbosity level. setVerbosity :: PandocMonad m => Verbosity -> m () -- | Get the verbosity level. getVerbosity :: PandocMonad m => m Verbosity -- | Retrieve the media bag. getMediaBag :: PandocMonad m => m MediaBag -- | Initialize the media bag. setMediaBag :: PandocMonad m => MediaBag -> m () -- | Insert an item into the media bag. insertMedia :: PandocMonad m => FilePath -> Maybe MimeType -> ByteString -> m () -- | Set the user data directory in common state. setUserDataDir :: PandocMonad m => Maybe FilePath -> m () -- | Get the user data directory from common state. getUserDataDir :: PandocMonad m => m (Maybe FilePath) -- | Fetch an image or other item from the local filesystem or the net. -- Returns raw content and maybe mime type. fetchItem :: PandocMonad m => Text -> m (ByteString, Maybe MimeType) -- | Fetch local or remote resource (like an image) and provide data -- suitable for adding it to the MediaBag. fetchMediaResource :: PandocMonad m => Text -> m (FilePath, Maybe MimeType, ByteString) -- | Retrieve the input filenames. getInputFiles :: PandocMonad m => m [FilePath] -- | Set the input filenames. setInputFiles :: PandocMonad m => [FilePath] -> m () -- | Retrieve the output filename. getOutputFile :: PandocMonad m => m (Maybe FilePath) -- | Set the output filename. setOutputFile :: PandocMonad m => Maybe FilePath -> m () -- | Set the resource path searched by fetchItem. setResourcePath :: PandocMonad m => [FilePath] -> m () -- | Retrieve the resource path searched by fetchItem. getResourcePath :: PandocMonad m => m [FilePath] -- | Read file from from the default data files. readDefaultDataFile :: PandocMonad m => FilePath -> m ByteString -- | Read file from user data directory or, if not found there, from the -- default data files. readDataFile :: PandocMonad m => FilePath -> m ByteString -- | Traverse tree, filling media bag for any images that aren't already in -- the media bag. fillMediaBag :: PandocMonad m => Pandoc -> m Pandoc -- | Convert BCP47 string to a Lang, issuing warning if there are problems. toLang :: PandocMonad m => Maybe Text -> m (Maybe Lang) -- | Select the language to use with translateTerm. Note that this -- does not read a translation file; that is only done the first time -- translateTerm is used. setTranslations :: PandocMonad m => Lang -> m () -- | Get a translation from the current term map. Issue a warning if the -- term is not defined. translateTerm :: PandocMonad m => Term -> m Text -- | Canonicalizes a file path by removing redundant . and -- ... makeCanonical :: FilePath -> FilePath -- | Get the time from the SOURCE_DATE_EPOCH environment variable. -- The variable should contain a unix time stamp, the number of seconds -- since midnight Jan 01 1970 UTC. If the variable is not set or cannot -- be parsed as a unix time stamp, the current time is returned. This -- function is designed to make possible reproducible builds in formats -- that include a creation timestamp. getTimestamp :: PandocMonad m => m UTCTime -- | The PureState contains ersatz representations of things that -- would normally be obtained through IO. data PureState PureState :: StdGen -> [Word8] -> [Int] -> [(Text, Text)] -> UTCTime -> TimeZone -> Archive -> Archive -> Archive -> FileTree -> FileTree -> FileTree -> PureState [stStdGen] :: PureState -> StdGen -- | should be infinite, i.e. [1..] [stWord8Store] :: PureState -> [Word8] -- | should be infinite and contain every element at most once, e.g. [1..] [stUniqStore] :: PureState -> [Int] [stEnv] :: PureState -> [(Text, Text)] [stTime] :: PureState -> UTCTime [stTimeZone] :: PureState -> TimeZone [stReferenceDocx] :: PureState -> Archive [stReferencePptx] :: PureState -> Archive [stReferenceODT] :: PureState -> Archive [stFiles] :: PureState -> FileTree [stUserDataFiles] :: PureState -> FileTree [stCabalDataFiles] :: PureState -> FileTree -- | Retrieve the underlying state of the PandocPure type. getPureState :: PandocPure PureState -- | Retrieve a value from the underlying state of the -- PandocPure type. getsPureState :: (PureState -> a) -> PandocPure a -- | Set a new state for the PandocPure type. putPureState :: PureState -> PandocPure () -- | Modify the underlying state of the PandocPure type. modifyPureState :: (PureState -> PureState) -> PandocPure () newtype PandocPure a PandocPure :: ExceptT PandocError (StateT CommonState (State PureState)) a -> PandocPure a [unPandocPure] :: PandocPure a -> ExceptT PandocError (StateT CommonState (State PureState)) a -- | Basis of the mock file system used by PandocPure. data FileTree -- | Captures all file-level information necessary for a -- PandocMonad conforming mock file system. data FileInfo FileInfo :: UTCTime -> ByteString -> FileInfo [infoFileMTime] :: FileInfo -> UTCTime [infoFileContents] :: FileInfo -> ByteString -- | Add the specified file to the FileTree. If file is a directory, add -- its contents recursively. addToFileTree :: FileTree -> FilePath -> IO FileTree -- | Insert an ersatz file into the FileTree. insertInFileTree :: FilePath -> FileInfo -> FileTree -> FileTree -- | Run a PandocPure operation. runPure :: PandocPure a -> Either PandocError a data Translations -- | Parses CSL JSON bibliographies into a Pandoc document with empty body -- and references and nocite fields in the metadata. A -- wildcard nocite is used so that if the document is rendered -- in another format, the entire bibliography will be printed. -- -- -- https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html. module Text.Pandoc.Readers.CslJson -- | Read CSL JSON from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readCslJson :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion from CSV to a Pandoc table. module Text.Pandoc.Readers.CSV readCSV :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Definitions and conversion functions for an intermediate Table -- and related types, which annotates the existing Pandoc Table -- types with additional inferred information. For use in writers that -- need to know the details of columns that cells span, row numbers, and -- the cells that are in the row head. module Text.Pandoc.Writers.AnnotatedTable -- | Convert a Pandoc Table to an annotated Table. This -- function also performs the same normalization that the table -- builder does (fixing overlapping cells, cells that protrude out of -- their table section, and so on). If the input table happens to satisfy -- the conditions that table guarantees, then the resulting -- Table will be identical, save for the addition of the inferred -- table information. toTable :: Attr -> Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> Table -- | Convert an annotated Table to a Pandoc Table. This is -- the inverse of toTable on well-formed tables (i.e. tables -- satisfying the guarantees of table). fromTable :: Table -> (Attr, Caption, [ColSpec], TableHead, [TableBody], TableFoot) -- | An annotated table type, corresponding to the Pandoc Table -- constructor and the HTML <table> element. It records -- the data of the columns that cells span, the cells in the row head, -- the row numbers of rows, and the column numbers of cells, in addition -- to the data in a Table. The type itself does not enforce any -- guarantees about the consistency of this data. Use toTable to -- produce a Table from a Pandoc Table. data Table Table :: Attr -> Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> Table -- | An annotated table head, corresponding to a Pandoc TableHead -- and the HTML <thead> element. data TableHead TableHead :: Attr -> [HeaderRow] -> TableHead -- | An annotated table body, with an intermediate head and body, -- corresponding to a Pandoc TableBody and the HTML -- <tbody> element. data TableBody TableBody :: Attr -> RowHeadColumns -> [HeaderRow] -> [BodyRow] -> TableBody -- | An annotated table foot, corresponding to a Pandoc TableFoot -- and the HTML <tfoot> element. data TableFoot TableFoot :: Attr -> [HeaderRow] -> TableFoot -- | An annotated header row, corresponding to a Pandoc Row and the -- HTML <tr> element, and also recording the row number of -- the row. All the cells in a HeaderRow are header -- (<th>) cells. data HeaderRow HeaderRow :: Attr -> RowNumber -> [Cell] -> HeaderRow -- | An annotated body row, corresponding to a Pandoc Row and the -- HTML <tr> element, and also recording its row number -- and separating the row head cells from the row body cells. data BodyRow BodyRow :: Attr -> RowNumber -> RowHead -> RowBody -> BodyRow -- | The row number of a row. Note that rows are numbered continuously from -- zero from the start of the table, so the first row in a table body, -- for instance, may have a large RowNumber. newtype RowNumber RowNumber :: Int -> RowNumber -- | The head of a body row; the portion of the row lying in the stub of -- the TableBody. Its cells correspond to HTML <th> -- cells. type RowHead = [Cell] -- | The body of a body row; the portion of the row lying after the stub of -- the TableBody. Its cells correspond to HTML <td> -- cells. type RowBody = [Cell] -- | An annotated table cell, wrapping a Pandoc Cell with its -- ColNumber and the ColSpec data for the columns that the -- cell spans. data Cell Cell :: NonEmpty ColSpec -> ColNumber -> Cell -> Cell -- | The column number of a cell, meaning the column number of the first -- column that the cell spans, if the table were laid on a grid. Columns -- are numbered starting from zero. newtype ColNumber ColNumber :: Int -> ColNumber instance GHC.Enum.Enum Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Num.Num Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.RowNumber instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.RowNumber instance GHC.Enum.Enum Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Num.Num Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.ColNumber instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.ColNumber instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.Cell instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.Cell instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.Cell instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.Cell instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.Cell instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.Cell instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.BodyRow instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.BodyRow instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.BodyRow instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.BodyRow instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.BodyRow instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.BodyRow instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.TableFoot instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.TableFoot instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.TableFoot instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.TableFoot instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.TableFoot instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.TableFoot instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.TableBody instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.TableBody instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.TableBody instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.TableBody instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.TableBody instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.TableBody instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.TableHead instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.TableHead instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.TableHead instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.TableHead instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.TableHead instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.TableHead instance GHC.Generics.Generic Text.Pandoc.Writers.AnnotatedTable.Table instance Data.Data.Data Text.Pandoc.Writers.AnnotatedTable.Table instance GHC.Show.Show Text.Pandoc.Writers.AnnotatedTable.Table instance GHC.Read.Read Text.Pandoc.Writers.AnnotatedTable.Table instance GHC.Classes.Ord Text.Pandoc.Writers.AnnotatedTable.Table instance GHC.Classes.Eq Text.Pandoc.Writers.AnnotatedTable.Table instance Text.Pandoc.Walk.Walkable a Text.Pandoc.Definition.Cell => Text.Pandoc.Walk.Walkable a Text.Pandoc.Writers.AnnotatedTable.TableHead instance Text.Pandoc.Walk.Walkable a Text.Pandoc.Definition.Cell => Text.Pandoc.Walk.Walkable a Text.Pandoc.Writers.AnnotatedTable.HeaderRow instance Text.Pandoc.Walk.Walkable a Text.Pandoc.Definition.Cell => Text.Pandoc.Walk.Walkable a Text.Pandoc.Writers.AnnotatedTable.Cell -- | Conversion of references from Pandoc metadata to CSL JSON: -- https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html. -- -- Note that this writer ignores everything in the body of the document -- and everything in the metadata except references. It assumes -- that the references field is a list with the structure of a -- CSL JSON bibliography. module Text.Pandoc.Writers.CslJson writeCslJson :: PandocMonad m => WriterOptions -> Pandoc -> m Text module Text.Pandoc.Writers.Math -- | Converts a raw TeX math formula to a list of Pandoc inlines. -- Defaults to raw formula between $ or $$ characters -- if entire formula can't be converted. texMathToInlines :: PandocMonad m => MathType -> Text -> m [Inline] -- | Converts a raw TeX math formula using a writer function, issuing a -- warning and producing a fallback (a raw string) on failure. convertMath :: PandocMonad m => (DisplayType -> [Exp] -> a) -> MathType -> Text -> m (Either Inline a) defaultMathJaxURL :: Text defaultKaTeXURL :: Text -- | Conversion of a Pandoc document to a string representation. module Text.Pandoc.Writers.Native -- | Prettyprint Pandoc document. writeNative :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Functions for escaping and formatting XML. module Text.Pandoc.XML -- | Escape one character as needed for XML. escapeCharForXML :: Char -> Text -- | Escape string as needed for XML. Entity references are not preserved. escapeStringForXML :: Text -> Text -- | Put the supplied contents between start and end tags of tagType, with -- specified attributes and (if specified) indentation. inTags :: (HasChars a, IsString a) => Bool -> Text -> [(Text, Text)] -> Doc a -> Doc a -- | Return a self-closing tag of tagType with specified attributes selfClosingTag :: (HasChars a, IsString a) => Text -> [(Text, Text)] -> Doc a -- | Put the supplied contents between start and end tags of tagType. inTagsSimple :: (HasChars a, IsString a) => Text -> Doc a -> Doc a -- | Put the supplied contents in indented block btw start and end tags. inTagsIndented :: (HasChars a, IsString a) => Text -> Doc a -> Doc a -- | Escape all non-ascii characters using numerical entities. toEntities :: Text -> Text -- | Escape all non-ascii characters using HTML5 entities, falling back to -- numerical entities. toHtml5Entities :: Text -> Text fromEntities :: Text -> Text html4Attributes :: Set Text html5Attributes :: Set Text rdfaAttributes :: Set Text -- | Shared utility functions for pandoc writers. module Text.Pandoc.Writers.Shared -- | Create template Context from a Meta and an association list of -- variables, specified at the command line or in the writer. Variables -- overwrite metadata fields with the same names. If multiple variables -- are set with the same name, a list is assigned. Does nothing if -- writerTemplate is Nothing. metaToContext :: (Monad m, TemplateTarget a) => WriterOptions -> ([Block] -> m (Doc a)) -> ([Inline] -> m (Doc a)) -> Meta -> m (Context a) -- | Like 'metaToContext, but does not include variables and is not -- sensitive to writerTemplate. metaToContext' :: (Monad m, TemplateTarget a) => ([Block] -> m (Doc a)) -> ([Inline] -> m (Doc a)) -> Meta -> m (Context a) -- | Add variables to a template Context, using monoidal append. Also add -- `meta-json`. Note that metadata values are used in template contexts -- only when like-named variables aren't set. addVariablesToContext :: TemplateTarget a => WriterOptions -> Context a -> Context a -- | Retrieve a field value from a template context. getField :: FromContext a b => Text -> Context a -> Maybe b -- | Set a field of a template context. If the field already has a value, -- convert it into a list with the new value appended to the old -- value(s). This is a utility function to be used in preparing template -- contexts. setField :: ToContext a b => Text -> b -> Context a -> Context a -- | Reset a field of a template context. If the field already has a value, -- the new value replaces it. This is a utility function to be used in -- preparing template contexts. resetField :: ToContext a b => Text -> b -> Context a -> Context a -- | Set a field of a template context if it currently has no value. If it -- has a value, do nothing. This is a utility function to be used in -- preparing template contexts. defField :: ToContext a b => Text -> b -> Context a -> Context a -- | Produce an HTML tag with the given pandoc attributes. tagWithAttrs :: HasChars a => Text -> Attr -> Doc a -- | Returns True iff the argument is an inline Math element -- of type DisplayMath. isDisplayMath :: Inline -> Bool -- | Put display math in its own block (for ODT/DOCX). fixDisplayMath :: Block -> Block -- | Converts a Unicode character into the ASCII sequence used to represent -- the character in "smart" Markdown. unsmartify :: WriterOptions -> Text -> Text gridTable :: (Monad m, HasChars a) => WriterOptions -> (WriterOptions -> [Block] -> m (Doc a)) -> Bool -> [Alignment] -> [Double] -> [[Block]] -> [[[Block]]] -> m (Doc a) -- | Retrieve the metadata value for a given key and convert to -- Bool. lookupMetaBool :: Text -> Meta -> Bool -- | Retrieve the metadata value for a given key and extract -- blocks. lookupMetaBlocks :: Text -> Meta -> [Block] -- | Retrieve the metadata value for a given key and extract -- inlines. lookupMetaInlines :: Text -> Meta -> [Inline] -- | Retrieve the metadata value for a given key and convert to -- String. lookupMetaString :: Text -> Meta -> Text -- | Remove leading and trailing Space and SoftBreak -- elements. stripLeadingTrailingSpace :: [Inline] -> [Inline] -- | Tries to convert a character into a unicode subscript version of the -- character. toSubscript :: Char -> Maybe Char -- | Tries to convert a character into a unicode superscript version of the -- character. toSuperscript :: Char -> Maybe Char -- | Construct table of contents (as a bullet list) from document body. toTableOfContents :: WriterOptions -> [Block] -> Block -- | Returns True iff the list of blocks has a Plain -- as its last element. endsWithPlain :: [Block] -> Bool -- | Convert the relevant components of a new-style table (with block -- caption, row headers, row and column spans, and so on) to those of an -- old-style table (inline caption, table head with one row, no foot, and -- so on). Cells with a RowSpan and ColSpan of (h, -- w) will be cut up into h * w cells of dimension (1, -- 1), with the content placed in the upper-left corner. toLegacyTable :: Caption -> [ColSpec] -> TableHead -> [TableBody] -> TableFoot -> ([Inline], [Alignment], [Double], [[Block]], [[[Block]]]) -- | Conversion of Pandoc documents to Emacs Org-Mode. -- -- Org-Mode: http://orgmode.org module Text.Pandoc.Writers.Org -- | Convert Pandoc to Org. writeOrg :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to roff man page format. module Text.Pandoc.Writers.Man -- | Convert Pandoc to Man. writeMan :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to Jira markup. -- -- JIRA: -- https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all module Text.Pandoc.Writers.Jira -- | Convert Pandoc to Jira. writeJira :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to haddock markup. -- -- Haddock: http://www.haskell.org/haddock/doc/html/ module Text.Pandoc.Writers.Haddock -- | Convert Pandoc to Haddock. writeHaddock :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance Data.Default.Class.Default Text.Pandoc.Writers.Haddock.WriterState -- | Conversion of LaTeX documents to PDF. module Text.Pandoc.PDF makePDF :: String -> [String] -> (WriterOptions -> Pandoc -> PandocIO Text) -> WriterOptions -> Pandoc -> PandocIO (Either ByteString ByteString) -- | Conversion of Pandoc documents to OpenDocument XML. module Text.Pandoc.Writers.OpenDocument -- | Convert Pandoc document to string in OpenDocument format. writeOpenDocument :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance GHC.Classes.Ord Text.Pandoc.Writers.OpenDocument.TextStyle instance GHC.Classes.Eq Text.Pandoc.Writers.OpenDocument.TextStyle -- | A utility library with parsers used in pandoc readers. module Text.Pandoc.Parsing -- | Parse characters while a predicate is true. take1WhileP :: Monad m => (Char -> Bool) -> ParserT Text st m Text takeP :: Monad m => Int -> ParserT Text st m Text -- | Like count, but packs its result countChar :: (Stream s m Char, Monad m) => Int -> ParsecT s st m Char -> ParsecT s st m Text -- | Like string, but uses Text. textStr :: Stream s m Char => Text -> ParsecT s u m Text -- | Parse any line of text anyLine :: Monad m => ParserT Text st m Text -- | Parse any line, include the final newline in the output anyLineNewline :: Monad m => ParserT Text st m Text -- | Parse indent by specified number of spaces (or equiv. tabs) indentWith :: Stream s m Char => HasReaderOptions st => Int -> ParserT s st m Text -- | Like many, but packs its result. manyChar :: Stream s m t => ParserT s st m Char -> ParserT s st m Text -- | Like many1, but packs its result. many1Char :: Stream s m t => ParserT s st m Char -> ParserT s st m Text -- | Like manyTill, but packs its result. manyTillChar :: Stream s m t => ParserT s st m Char -> ParserT s st m a -> ParserT s st m Text -- | Like many1Till, but packs its result many1TillChar :: (Show end, Stream s m t) => ParserT s st m Char -> ParserT s st m end -> ParserT s st m Text -- | Like manyTill, but reads at least one item. many1Till :: (Show end, Stream s m t) => ParserT s st m a -> ParserT s st m end -> ParserT s st m [a] -- | Like manyTill, but also returns the result of end parser. manyUntil :: ParserT s u m a -> ParserT s u m b -> ParserT s u m ([a], b) -- | Like manyUntil, but also packs its result. manyUntilChar :: ParserT s u m Char -> ParserT s u m b -> ParserT s u m (Text, b) -- | Like sepBy1 from Parsec, but does not fail if it sep -- succeeds and p fails. sepBy1' :: ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | A more general form of notFollowedBy. This one allows any -- type of parser to be specified, and succeeds only if that parser -- fails. It does not consume any input. notFollowedBy' :: (Show b, Stream s m a) => ParserT s st m b -> ParserT s st m () -- | Parses one of a list of strings. If the list contains two strings one -- of which is a prefix of the other, the longer string will be matched -- if possible. oneOfStrings :: Stream s m Char => [Text] -> ParserT s st m Text -- | Parses one of a list of strings (tried in order), case insensitive. oneOfStringsCI :: Stream s m Char => [Text] -> ParserT s st m Text -- | Parses a space or tab. spaceChar :: Stream s m Char => ParserT s st m Char -- | Parses a nonspace, nonnewline character. nonspaceChar :: Stream s m Char => ParserT s st m Char -- | Skips zero or more spaces or tabs. skipSpaces :: Stream s m Char => ParserT s st m () -- | Skips zero or more spaces or tabs, then reads a newline. blankline :: Stream s m Char => ParserT s st m Char -- | Parses one or more blank lines and returns a string of newlines. blanklines :: Stream s m Char => ParserT s st m Text -- | Gobble n spaces; if tabs are encountered, expand them and gobble some -- or all of their spaces, leaving the rest. gobbleSpaces :: (HasReaderOptions st, Monad m) => Int -> ParserT Text st m () -- | Gobble up to n spaces; if tabs are encountered, expand them and gobble -- some or all of their spaces, leaving the rest. gobbleAtMostSpaces :: (HasReaderOptions st, Monad m) => Int -> ParserT Text st m Int -- | Parses material enclosed between start and end parsers. enclosed :: (Show end, Stream s m Char) => ParserT s st m t -> ParserT s st m end -> ParserT s st m a -> ParserT s st m [a] -- | Parse string, case insensitive. stringAnyCase :: Stream s m Char => Text -> ParserT s st m Text -- | Parse contents of str using parser and return -- result. parseFromString :: (Stream s m Char, IsString s) => ParserT s st m r -> Text -> ParserT s st m r -- | Like parseFromString but specialized for ParserState. -- This resets stateLastStrPos, which is almost always what we -- want. parseFromString' :: (Stream s m Char, IsString s, HasLastStrPosition u) => ParserT s u m a -> Text -> ParserT s u m a -- | Parse raw line block up to and including blank lines. lineClump :: Monad m => ParserT Text st m Text -- | Parse a string of characters between an open character and a close -- character, including text between balanced pairs of open and close, -- which must be different. For example, charsInBalanced '(' ')' -- anyChar will parse "(hello (there))" and return "hello (there)". charsInBalanced :: Stream s m Char => Char -> Char -> ParserT s st m Char -> ParserT s st m Text -- | Parses a roman numeral (uppercase or lowercase), returns number. romanNumeral :: Stream s m Char => Bool -> ParserT s st m Int -- | Parses an email address; returns original and corresponding escaped -- mailto: URI. emailAddress :: Stream s m Char => ParserT s st m (Text, Text) -- | Parses a URI. Returns pair of original and URI-escaped version. uri :: Stream s m Char => ParserT s st m (Text, Text) mathInline :: (HasReaderOptions st, Stream s m Char) => ParserT s st m Text mathDisplay :: (HasReaderOptions st, Stream s m Char) => ParserT s st m Text -- | Applies a parser, returns tuple of its results and its horizontal -- displacement (the difference between the source column at the end and -- the source column at the beginning). Vertical displacement (source -- row) is ignored. withHorizDisplacement :: Stream s m Char => ParserT s st m a -> ParserT s st m (a, Int) -- | Applies a parser and returns the raw string that was parsed, along -- with the value produced by the parser. withRaw :: Monad m => ParsecT Text st m a -> ParsecT Text st m (a, Text) -- | Parses backslash, then applies character parser. escaped :: Stream s m Char => ParserT s st m Char -> ParserT s st m Char -- | Parse character entity. characterReference :: Stream s m Char => ParserT s st m Char -- | Parses an uppercase roman numeral and returns (UpperRoman, number). upperRoman :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) -- | Parses a lowercase roman numeral and returns (LowerRoman, number). lowerRoman :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) -- | Parses a decimal numeral and returns (Decimal, number). decimal :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) -- | Parses a lowercase letter and returns (LowerAlpha, number). lowerAlpha :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) -- | Parses an uppercase letter and returns (UpperAlpha, number). upperAlpha :: Stream s m Char => ParserT s st m (ListNumberStyle, Int) -- | Parses an ordered list marker and returns list attributes. anyOrderedListMarker :: Stream s m Char => ParserT s ParserState m ListAttributes -- | Parses an ordered list marker with a given style and delimiter, -- returns number. orderedListMarker :: Stream s m Char => ListNumberStyle -> ListNumberDelim -> ParserT s ParserState m Int -- | Parses a character reference and returns a Str element. charRef :: Stream s m Char => ParserT s st m Inline -- | Parses an RST-style line block and returns a list of strings. lineBlockLines :: Monad m => ParserT Text st m [Text] -- | Parse a table using headerParser, rowParser, -- lineParser, and footerParser. tableWith :: (Stream s m Char, HasReaderOptions st, Monad mf) => ParserT s st m (mf [Blocks], [Alignment], [Int]) -> ([Int] -> ParserT s st m (mf [Blocks])) -> ParserT s st m sep -> ParserT s st m end -> ParserT s st m (mf Blocks) widthsFromIndices :: Int -> [Int] -> [Double] gridTableWith :: (Stream s m Char, HasReaderOptions st, HasLastStrPosition st, Monad mf, IsString s) => ParserT s st m (mf Blocks) -> Bool -> ParserT s st m (mf Blocks) gridTableWith' :: (Stream s m Char, HasReaderOptions st, HasLastStrPosition st, Monad mf, IsString s) => ParserT s st m (mf Blocks) -> Bool -> ParserT s st m (TableComponents mf) -- | Parse a string with a given parser and state readWith :: Parser Text st a -> st -> Text -> Either PandocError a -- | Removes the ParsecT layer from the monad transformer stack readWithM :: Monad m => ParserT Text st m a -> st -> Text -> m (Either PandocError a) -- | Parse a string with parser (for testing). testStringWith :: Show a => ParserT Text ParserState Identity a -> Text -> IO () -- | Succeed only if the extension is enabled. guardEnabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m () -- | Succeed only if the extension is disabled. guardDisabled :: (Stream s m a, HasReaderOptions st) => Extension -> ParserT s st m () -- | Update the position on which the last string ended. updateLastStrPos :: (Stream s m a, HasLastStrPosition st) => ParserT s st m () -- | Whether we are right after the end of a string. notAfterString :: (Stream s m a, HasLastStrPosition st) => ParserT s st m Bool -- | Add a log message. logMessage :: (Stream s m a, HasLogMessages st) => LogMessage -> ParserT s st m () -- | Report all the accumulated log messages, according to verbosity level. reportLogMessages :: (PandocMonad m, HasLogMessages st) => ParserT s st m () -- | Parsing options. data ParserState ParserState :: ReaderOptions -> ParserContext -> QuoteContext -> Bool -> Bool -> Int -> Maybe SourcePos -> KeyTable -> KeyTable -> SubstTable -> NoteTable -> NoteTable' -> Set Text -> Bool -> Int -> Meta -> Future ParserState Meta -> Map Text Text -> [HeaderType] -> Set Text -> Int -> Map Text Int -> Map Text Macro -> Text -> Maybe Text -> Map Text (Text, Maybe Text, Attr) -> Maybe Inlines -> Maybe Text -> Int -> [Text] -> [LogMessage] -> Bool -> ParserState -- | User options [stateOptions] :: ParserState -> ReaderOptions -- | Inside list? [stateParserContext] :: ParserState -> ParserContext -- | Inside quoted environment? [stateQuoteContext] :: ParserState -> QuoteContext -- | Allow parsing of links [stateAllowLinks] :: ParserState -> Bool -- | Allow parsing of line breaks [stateAllowLineBreaks] :: ParserState -> Bool -- | Max # of nested Strong/Emph [stateMaxNestingLevel] :: ParserState -> Int -- | Position after last str parsed [stateLastStrPos] :: ParserState -> Maybe SourcePos -- | List of reference keys [stateKeys] :: ParserState -> KeyTable -- | List of implicit header ref keys [stateHeaderKeys] :: ParserState -> KeyTable -- | List of substitution references [stateSubstitutions] :: ParserState -> SubstTable -- | List of notes (raw bodies) [stateNotes] :: ParserState -> NoteTable -- | List of notes (parsed bodies) [stateNotes'] :: ParserState -> NoteTable' -- | List of note references used [stateNoteRefs] :: ParserState -> Set Text -- | True if parsing note contents [stateInNote] :: ParserState -> Bool -- | Last note number for citations [stateNoteNumber] :: ParserState -> Int -- | Document metadata [stateMeta] :: ParserState -> Meta -- | Document metadata [stateMeta'] :: ParserState -> Future ParserState Meta -- | RST-style citations [stateCitations] :: ParserState -> Map Text Text -- | Ordered list of header types used [stateHeaderTable] :: ParserState -> [HeaderType] -- | Header identifiers used [stateIdentifiers] :: ParserState -> Set Text -- | Number of next example [stateNextExample] :: ParserState -> Int -- | Map from example labels to numbers [stateExamples] :: ParserState -> Map Text Int -- | Table of macros defined so far [stateMacros] :: ParserState -> Map Text Macro -- | Current rST default interpreted text role [stateRstDefaultRole] :: ParserState -> Text -- | Current rST literal block language [stateRstHighlight] :: ParserState -> Maybe Text -- | Current rST custom text roles Triple represents: 1) Base role, 2) -- Optional format (only for :raw: roles), 3) Additional classes (rest of -- Attr is unused)). [stateRstCustomRoles] :: ParserState -> Map Text (Text, Maybe Text, Attr) -- | Caption in current environment [stateCaption] :: ParserState -> Maybe Inlines -- | Tag type of HTML block being parsed [stateInHtmlBlock] :: ParserState -> Maybe Text -- | Depth of fenced div [stateFencedDivLevel] :: ParserState -> Int -- | parent include files [stateContainers] :: ParserState -> [Text] -- | log messages [stateLogMessages] :: ParserState -> [LogMessage] -- | True if in markdown=1 context [stateMarkdownAttribute] :: ParserState -> Bool class HasReaderOptions st extractReaderOptions :: HasReaderOptions st => st -> ReaderOptions getOption :: (HasReaderOptions st, Stream s m t) => (ReaderOptions -> b) -> ParserT s st m b class HasIdentifierList st extractIdentifierList :: HasIdentifierList st => st -> Set Text updateIdentifierList :: HasIdentifierList st => (Set Text -> Set Text) -> st -> st class HasMacros st extractMacros :: HasMacros st => st -> Map Text Macro updateMacros :: HasMacros st => (Map Text Macro -> Map Text Macro) -> st -> st class HasLogMessages st addLogMessage :: HasLogMessages st => LogMessage -> st -> st getLogMessages :: HasLogMessages st => st -> [LogMessage] class HasLastStrPosition st setLastStrPos :: HasLastStrPosition st => Maybe SourcePos -> st -> st getLastStrPos :: HasLastStrPosition st => st -> Maybe SourcePos class HasIncludeFiles st getIncludeFiles :: HasIncludeFiles st => st -> [Text] addIncludeFile :: HasIncludeFiles st => Text -> st -> st dropLatestIncludeFile :: HasIncludeFiles st => st -> st defaultParserState :: ParserState data HeaderType -- | Single line of characters underneath SingleHeader :: Char -> HeaderType -- | Lines of characters above and below DoubleHeader :: Char -> HeaderType data ParserContext -- | Used when running parser on list item contents ListItemState :: ParserContext -- | Default state NullState :: ParserContext data QuoteContext -- | Used when parsing inside single quotes InSingleQuote :: QuoteContext -- | Used when parsing inside double quotes InDoubleQuote :: QuoteContext -- | Used when not parsing inside quotes NoQuote :: QuoteContext class HasQuoteContext st m getQuoteContext :: (HasQuoteContext st m, Stream s m t) => ParsecT s st m QuoteContext withQuoteContext :: HasQuoteContext st m => QuoteContext -> ParsecT s st m a -> ParsecT s st m a type NoteTable = [(Text, Text)] type NoteTable' = Map Text (SourcePos, Future ParserState Blocks) type KeyTable = Map Key (Target, Attr) type SubstTable = Map Key Inlines newtype Key Key :: Text -> Key toKey :: Text -> Key registerHeader :: (Stream s m a, HasReaderOptions st, HasLogMessages st, HasIdentifierList st) => Attr -> Inlines -> ParserT s st m Attr smartPunctuation :: (HasReaderOptions st, HasLastStrPosition st, HasQuoteContext st m, Stream s m Char) => ParserT s st m Inlines -> ParserT s st m Inlines singleQuoteStart :: (HasLastStrPosition st, HasQuoteContext st m, Stream s m Char) => ParserT s st m () singleQuoteEnd :: Stream s m Char => ParserT s st m () doubleQuoteStart :: (HasQuoteContext st m, Stream s m Char) => ParserT s st m () doubleQuoteEnd :: Stream s m Char => ParserT s st m () ellipses :: Stream s m Char => ParserT s st m Inlines apostrophe :: Stream s m Char => ParserT s st m Inlines dash :: (HasReaderOptions st, Stream s m Char) => ParserT s st m Inlines nested :: Stream s m a => ParserT s ParserState m a -> ParserT s ParserState m a citeKey :: (Stream s m Char, HasLastStrPosition st) => ParserT s st m (Bool, Text) type Parser t s = Parsec t s type ParserT = ParsecT -- | Reader monad wrapping the parser state. This is used to possibly delay -- evaluation until all relevant information has been parsed and made -- available in the parser state. newtype Future s a Future :: Reader s a -> Future s a [runDelayed] :: Future s a -> Reader s a runF :: Future s a -> s -> a askF :: Future s s asksF :: (s -> a) -> Future s a returnF :: Monad m => a -> m (Future s a) trimInlinesF :: Future s Inlines -> Future s Inlines token :: Stream s m t => (t -> Text) -> (t -> SourcePos) -> (t -> Maybe a) -> ParsecT s st m a (<+?>) :: Monoid a => ParserT s st m a -> ParserT s st m a -> ParserT s st m a infixr 5 <+?> extractIdClass :: Attr -> Attr -- | Parse content of include file as blocks. Circular includes result in -- an PandocParseError. insertIncludedFile :: (PandocMonad m, HasIncludeFiles st) => ParserT [a] st m Blocks -> (Text -> [a]) -> [FilePath] -> FilePath -> ParserT [a] st m Blocks -- | Parse content of include file as future blocks. Circular includes -- result in an PandocParseError. insertIncludedFileF :: (PandocMonad m, HasIncludeFiles st) => ParserT Text st m (Future st Blocks) -> [FilePath] -> FilePath -> ParserT Text st m (Future st Blocks) -- | An instance of Stream has stream type s, underlying -- monad m and token type t determined by the stream -- -- Some rough guidelines for a "correct" instance of Stream: -- -- class Monad m => Stream s (m :: Type -> Type) t | s -> t -- | The most general way to run a parser over the Identity monad. -- runParser p state filePath input runs parser p on -- the input list of tokens input, obtained from source -- filePath with the initial user state st. The -- filePath is only used in error messages and may be the empty -- string. Returns either a ParseError (Left) or a value of -- type a (Right). -- --
--   parseFromFile p fname
--     = do{ input <- readFile fname
--         ; return (runParser p () fname input)
--         }
--   
runParser :: Stream s Identity t => Parsec s u a -> u -> SourceName -> s -> Either ParseError a -- | The most general way to run a parser. runParserT p state filePath -- input runs parser p on the input list of tokens -- input, obtained from source filePath with the -- initial user state st. The filePath is only used in -- error messages and may be the empty string. Returns a computation in -- the underlying monad m that return either a ParseError -- (Left) or a value of type a (Right). runParserT :: Stream s m t => ParsecT s u m a -> u -> SourceName -> s -> m (Either ParseError a) -- | parse p filePath input runs a parser p over Identity -- without user state. The filePath is only used in error -- messages and may be the empty string. Returns either a -- ParseError (Left) or a value of type a -- (Right). -- --
--   main    = case (parse numbers "" "11, 2, 43") of
--              Left err  -> print err
--              Right xs  -> print (sum xs)
--   
--   numbers = commaSep integer
--   
parse :: Stream s Identity t => Parsec s () a -> SourceName -> s -> Either ParseError a -- | The parser tokenPrim showTok nextPos testTok accepts a token -- t with result x when the function testTok t -- returns Just x. The token can be shown using -- showTok t. The position of the next token should be -- returned when nextPos is called with the current source -- position pos, the current token t and the rest of -- the tokens toks, nextPos pos t toks. -- -- This is the most primitive combinator for accepting tokens. For -- example, the char parser could be implemented as: -- --
--   char c
--     = tokenPrim showChar nextPos testChar
--     where
--       showChar x        = "'" ++ x ++ "'"
--       testChar x        = if x == c then Just x else Nothing
--       nextPos pos x xs  = updatePosChar pos x
--   
tokenPrim :: forall s (m :: Type -> Type) t a u. Stream s m t => (t -> String) -> (SourcePos -> t -> s -> SourcePos) -> (t -> Maybe a) -> ParsecT s u m a -- | The parser anyToken accepts any kind of token. It is for -- example used to implement eof. Returns the accepted token. anyToken :: forall s (m :: Type -> Type) t u. (Stream s m t, Show t) => ParsecT s u m t -- | Returns the current input getInput :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m s -- | setInput input continues parsing with input. The -- getInput and setInput functions can for example be -- used to deal with #include files. setInput :: forall (m :: Type -> Type) s u. Monad m => s -> ParsecT s u m () -- | The parser unexpected msg always fails with an unexpected -- error message msg without consuming any input. -- -- The parsers fail, (<?>) and unexpected -- are the three parsers used to generate error messages. Of these, only -- (<?>) is commonly used. For an example of the use of -- unexpected, see the definition of notFollowedBy. unexpected :: forall s (m :: Type -> Type) t u a. Stream s m t => String -> ParsecT s u m a -- | char c parses a single character c. Returns the -- parsed character (i.e. c). -- --
--   semiColon  = char ';'
--   
char :: forall s (m :: Type -> Type) u. Stream s m Char => Char -> ParsecT s u m Char -- | Parses an alphabetic Unicode characters (lower-case, upper-case and -- title-case letters, plus letters of caseless scripts and modifiers -- letters according to isAlpha). Returns the parsed character. letter :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | Parses an ASCII digit. Returns the parsed character. digit :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | Parses a alphabetic or numeric Unicode characters according to -- isAlphaNum. Returns the parsed character. -- -- Note that numeric digits outside the ASCII range (such as arabic-indic -- digits like e.g. "٤" or U+0664), as well as numeric -- characters which aren't digits, are parsed by this function but not by -- digit. alphaNum :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | skipMany p applies the parser p zero or more -- times, skipping its result. -- --
--   spaces  = skipMany space
--   
skipMany :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m () -- | skipMany1 p applies the parser p one or more -- times, skipping its result. skipMany1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m () -- | Skips zero or more white space characters. See also -- skipMany. spaces :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m () -- | Parses a white space character (any character which satisfies -- isSpace) Returns the parsed character. space :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | This parser succeeds for any character. Returns the parsed character. anyChar :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | The parser satisfy f succeeds for any character for which the -- supplied function f returns True. Returns the -- character that is actually parsed. satisfy :: forall s (m :: Type -> Type) u. Stream s m Char => (Char -> Bool) -> ParsecT s u m Char -- | Parses a newline character ('\n'). Returns a newline character. newline :: forall s (m :: Type -> Type) u. Stream s m Char => ParsecT s u m Char -- | string s parses a sequence of characters given by s. -- Returns the parsed string (i.e. s). -- --
--   divOrMod    =   string "div"
--               <|> string "mod"
--   
string :: forall s (m :: Type -> Type) u. Stream s m Char => String -> ParsecT s u m String -- | count n p parses n occurrences of p. If -- n is smaller or equal to zero, the parser equals to -- return []. Returns a list of n values returned by -- p. count :: forall s (m :: Type -> Type) t u a. Stream s m t => Int -> ParsecT s u m a -> ParsecT s u m [a] -- | This parser only succeeds at the end of the input. This is not a -- primitive parser but it is defined using notFollowedBy. -- --
--   eof  = notFollowedBy anyToken <?> "end of input"
--   
eof :: forall s (m :: Type -> Type) t u. (Stream s m t, Show t) => ParsecT s u m () -- | As the dual of oneOf, noneOf cs succeeds if the -- current character not in the supplied list of characters -- cs. Returns the parsed character. -- --
--   consonant = noneOf "aeiou"
--   
noneOf :: forall s (m :: Type -> Type) u. Stream s m Char => [Char] -> ParsecT s u m Char -- | oneOf cs succeeds if the current character is in the supplied -- list of characters cs. Returns the parsed character. See also -- satisfy. -- --
--   vowel  = oneOf "aeiou"
--   
oneOf :: forall s (m :: Type -> Type) u. Stream s m Char => [Char] -> ParsecT s u m Char -- | lookAhead p parses p without consuming any input. -- -- If p fails and consumes some input, so does -- lookAhead. Combine with try if this is undesirable. lookAhead :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m a -- | notFollowedBy p only succeeds when parser p fails. -- This parser does not consume any input. This parser can be used to -- implement the 'longest match' rule. For example, when recognizing -- keywords (for example let), we want to make sure that a -- keyword is not followed by a legal identifier character, in which case -- the keyword is actually an identifier (for example lets). We -- can program this behaviour as follows: -- --
--   keywordLet  = try (do{ string "let"
--                        ; notFollowedBy alphaNum
--                        })
--   
-- -- NOTE: Currently, notFollowedBy exhibits surprising -- behaviour when applied to a parser p that doesn't consume any -- input; specifically -- -- -- -- See haskell/parsec#8 for more details. notFollowedBy :: forall s (m :: Type -> Type) t a u. (Stream s m t, Show a) => ParsecT s u m a -> ParsecT s u m () -- | many p applies the parser p zero or more -- times. Returns a list of the returned values of p. -- --
--   identifier  = do{ c  <- letter
--                   ; cs <- many (alphaNum <|> char '_')
--                   ; return (c:cs)
--                   }
--   
many :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m [a] -- | many1 p applies the parser p one or more -- times. Returns a list of the returned values of p. -- --
--   word  = many1 letter
--   
many1 :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m [a] -- | manyTill p end applies parser p zero or more -- times until parser end succeeds. Returns the list of values -- returned by p. This parser can be used to scan comments: -- --
--   simpleComment   = do{ string "<!--"
--                       ; manyTill anyChar (try (string "-->"))
--                       }
--   
-- -- Note the overlapping parsers anyChar and string -- "-->", and therefore the use of the try combinator. manyTill :: forall s (m :: Type -> Type) t u a end. Stream s m t => ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a] -- | This combinator implements choice. The parser p <|> q -- first applies p. If it succeeds, the value of p is -- returned. If p fails without consuming any input, -- parser q is tried. This combinator is defined equal to the -- mplus member of the MonadPlus class and the -- (<|>) member of Alternative. -- -- The parser is called predictive since q is only tried -- when parser p didn't consume any input (i.e.. the look ahead -- is 1). This non-backtracking behaviour allows for both an efficient -- implementation of the parser combinators and the generation of good -- error messages. (<|>) :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a infixr 1 <|> -- | The parser p <?> msg behaves as parser p, but -- whenever the parser p fails without consuming any -- input, it replaces expect error messages with the expect error -- message msg. -- -- This is normally used at the end of a set alternatives where we want -- to return an error message in terms of a higher level construct rather -- than returning all possible characters. For example, if the -- expr parser from the try example would fail, the error -- message is: '...: expecting expression'. Without the -- (<?>) combinator, the message would be like '...: -- expecting "let" or letter', which is less friendly. () :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> String -> ParsecT s u m a infix 0 -- | choice ps tries to apply the parsers in the list ps -- in order, until one of them succeeds. Returns the value of the -- succeeding parser. choice :: forall s (m :: Type -> Type) t u a. Stream s m t => [ParsecT s u m a] -> ParsecT s u m a -- | The parser try p behaves like parser p, except that -- it pretends that it hasn't consumed any input when an error occurs. -- -- This combinator is used whenever arbitrary look ahead is needed. Since -- it pretends that it hasn't consumed any input when p fails, -- the (<|>) combinator will try its second alternative even -- when the first parser failed while consuming input. -- -- The try combinator can for example be used to distinguish -- identifiers and reserved words. Both reserved words and identifiers -- are a sequence of letters. Whenever we expect a certain reserved word -- where we can also expect an identifier we have to use the try -- combinator. Suppose we write: -- --
--   expr        = letExpr <|> identifier <?> "expression"
--   
--   letExpr     = do{ string "let"; ... }
--   identifier  = many1 letter
--   
-- -- If the user writes "lexical", the parser fails with: unexpected -- 'x', expecting 't' in "let". Indeed, since the (<|>) -- combinator only tries alternatives when the first alternative hasn't -- consumed input, the identifier parser is never tried (because -- the prefix "le" of the string "let" parser is already -- consumed). The right behaviour can be obtained by adding the -- try combinator: -- --
--   expr        = letExpr <|> identifier <?> "expression"
--   
--   letExpr     = do{ try (string "let"); ... }
--   identifier  = many1 letter
--   
try :: forall s u (m :: Type -> Type) a. ParsecT s u m a -> ParsecT s u m a -- | sepBy p sep parses zero or more occurrences of -- p, separated by sep. Returns a list of values -- returned by p. -- --
--   commaSep p  = p `sepBy` (symbol ",")
--   
sepBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | sepBy1 p sep parses one or more occurrences of -- p, separated by sep. Returns a list of values -- returned by p. sepBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | sepEndBy p sep parses zero or more occurrences of -- p, separated and optionally ended by sep, ie. -- haskell style statements. Returns a list of values returned by -- p. -- --
--   haskellStatements  = haskellStatement `sepEndBy` semi
--   
sepEndBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | sepEndBy1 p sep parses one or more occurrences of -- p, separated and optionally ended by sep. Returns a -- list of values returned by p. sepEndBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | endBy p sep parses zero or more occurrences of -- p, separated and ended by sep. Returns a list of -- values returned by p. -- --
--   cStatements  = cStatement `endBy` semi
--   
endBy :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | endBy1 p sep parses one or more occurrences of -- p, separated and ended by sep. Returns a list of -- values returned by p. endBy1 :: forall s (m :: Type -> Type) t u a sep. Stream s m t => ParsecT s u m a -> ParsecT s u m sep -> ParsecT s u m [a] -- | option x p tries to apply parser p. If p -- fails without consuming input, it returns the value x, -- otherwise the value returned by p. -- --
--   priority  = option 0 (do{ d <- digit
--                           ; return (digitToInt d)
--                           })
--   
option :: forall s (m :: Type -> Type) t a u. Stream s m t => a -> ParsecT s u m a -> ParsecT s u m a -- | optional p tries to apply parser p. It will parse -- p or nothing. It only fails if p fails after -- consuming input. It discards the result of p. optional :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m () -- | optionMaybe p tries to apply parser p. If p -- fails without consuming input, it return Nothing, otherwise it -- returns Just the value returned by p. optionMaybe :: forall s (m :: Type -> Type) t u a. Stream s m t => ParsecT s u m a -> ParsecT s u m (Maybe a) -- | Returns the current user state. getState :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m u -- | An alias for putState for backwards compatibility. setState :: forall (m :: Type -> Type) u s. Monad m => u -> ParsecT s u m () -- | An alias for modifyState for backwards compatibility. updateState :: forall (m :: Type -> Type) u s. Monad m => (u -> u) -> ParsecT s u m () -- | The abstract data type SourcePos represents source positions. -- It contains the name of the source (i.e. file name), a line number and -- a column number. SourcePos is an instance of the Show, -- Eq and Ord class. data SourcePos -- | Returns the current source position. See also SourcePos. getPosition :: forall (m :: Type -> Type) s u. Monad m => ParsecT s u m SourcePos -- | setPosition pos sets the current source position to -- pos. setPosition :: forall (m :: Type -> Type) s u. Monad m => SourcePos -> ParsecT s u m () -- | Extracts the column number from a source position. sourceColumn :: SourcePos -> Column -- | Extracts the line number from a source position. sourceLine :: SourcePos -> Line -- | Set the column number of a source position. setSourceColumn :: SourcePos -> Column -> SourcePos -- | Set the line number of a source position. setSourceLine :: SourcePos -> Line -> SourcePos -- | Increments the column number of a source position. incSourceColumn :: SourcePos -> Column -> SourcePos -- | Increments the line number of a source position. incSourceLine :: SourcePos -> Line -> SourcePos -- | Create a new SourcePos with the given source name, line number -- and column number. newPos :: SourceName -> Line -> Column -> SourcePos -- | Create a new SourcePos with the given source name, and line -- number and column number set to 1, the upper left. initialPos :: SourceName -> SourcePos type Line = Int type Column = Int -- | The abstract data type ParseError represents parse errors. It -- provides the source position (SourcePos) of the error and a -- list of error messages (Message). A ParseError can be -- returned by the function parse. ParseError is an -- instance of the Show and Eq classes. data ParseError instance GHC.Base.Functor (Text.Pandoc.Parsing.Future s) instance GHC.Base.Applicative (Text.Pandoc.Parsing.Future s) instance GHC.Base.Monad (Text.Pandoc.Parsing.Future s) instance GHC.Show.Show Text.Pandoc.Parsing.HeaderType instance GHC.Classes.Eq Text.Pandoc.Parsing.HeaderType instance GHC.Show.Show Text.Pandoc.Parsing.ParserContext instance GHC.Classes.Eq Text.Pandoc.Parsing.ParserContext instance GHC.Show.Show Text.Pandoc.Parsing.QuoteContext instance GHC.Classes.Eq Text.Pandoc.Parsing.QuoteContext instance GHC.Classes.Ord Text.Pandoc.Parsing.Key instance GHC.Classes.Eq Text.Pandoc.Parsing.Key instance GHC.Read.Read Text.Pandoc.Parsing.Key instance GHC.Show.Show Text.Pandoc.Parsing.Key instance Data.Default.Class.Default Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Parsing.HasReaderOptions Text.Pandoc.Parsing.ParserState instance GHC.Base.Monad m => Text.Pandoc.Parsing.HasQuoteContext Text.Pandoc.Parsing.ParserState m instance Text.Pandoc.Parsing.HasIdentifierList Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Parsing.HasMacros Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Parsing.HasLastStrPosition Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Parsing.HasLogMessages Text.Pandoc.Parsing.ParserState instance Text.Pandoc.Parsing.HasIncludeFiles Text.Pandoc.Parsing.ParserState instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Text.Pandoc.Parsing.Future s a) instance (GHC.Base.Semigroup a, GHC.Base.Monoid a) => GHC.Base.Monoid (Text.Pandoc.Parsing.Future s a) -- | Conversion of vimwiki text to Pandoc document. module Text.Pandoc.Readers.Vimwiki readVimwiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of txt2tags formatted plain text to Pandoc document. module Text.Pandoc.Readers.Txt2Tags -- | Read Txt2Tags from an input string returning a Pandoc document readTxt2Tags :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Get the meta information required by Txt2Tags macros getT2TMeta :: PandocMonad m => m T2TMeta -- | An object for the T2T macros meta information the contents of each -- field is simply substituted verbatim into the file data T2TMeta T2TMeta :: Text -> Text -> FilePath -> FilePath -> T2TMeta -- | Current date [date] :: T2TMeta -> Text -- | Last modification time of infile [mtime] :: T2TMeta -> Text -- | Input file [infile] :: T2TMeta -> FilePath -- | Output file [outfile] :: T2TMeta -> FilePath instance GHC.Show.Show Text.Pandoc.Readers.Txt2Tags.T2TMeta instance Data.Default.Class.Default Text.Pandoc.Readers.Txt2Tags.T2TMeta -- | Conversion of TikiWiki text to Pandoc document. module Text.Pandoc.Readers.TikiWiki -- | Read TikiWiki from an input string and return a Pandoc document. readTikiWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.TikiWiki.ListType instance GHC.Classes.Eq Text.Pandoc.Readers.TikiWiki.ListType instance GHC.Classes.Ord Text.Pandoc.Readers.TikiWiki.ListType instance GHC.Show.Show Text.Pandoc.Readers.TikiWiki.ListNesting instance GHC.Classes.Eq Text.Pandoc.Readers.TikiWiki.ListNesting instance GHC.Classes.Ord Text.Pandoc.Readers.TikiWiki.ListNesting -- | Conversion of Muse text to Pandoc document. module Text.Pandoc.Readers.Muse -- | Read Muse from an input string and return a Pandoc document. readMuse :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance Data.Default.Class.Default Text.Pandoc.Readers.Muse.MuseEnv instance Data.Default.Class.Default Text.Pandoc.Readers.Muse.MuseState instance Text.Pandoc.Parsing.HasReaderOptions Text.Pandoc.Readers.Muse.MuseState instance Text.Pandoc.Parsing.HasIdentifierList Text.Pandoc.Readers.Muse.MuseState instance Text.Pandoc.Parsing.HasLastStrPosition Text.Pandoc.Readers.Muse.MuseState instance Text.Pandoc.Parsing.HasLogMessages Text.Pandoc.Readers.Muse.MuseState -- | Conversion of man to Pandoc document. module Text.Pandoc.Readers.Man -- | Read man (troff) from an input string and return a Pandoc document. readMan :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.Man.ManState instance Data.Default.Class.Default Text.Pandoc.Readers.Man.ManState -- | Conversion of DokuWiki text to Pandoc document. module Text.Pandoc.Readers.DokuWiki -- | Read DokuWiki from an input string and return a Pandoc document. readDokuWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of creole text to Pandoc document. module Text.Pandoc.Readers.Creole -- | Read creole from an input string and return a Pandoc document. readCreole :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of CommonMark-formatted plain text to Pandoc -- document. -- -- CommonMark is a strongly specified variant of Markdown: -- http://commonmark.org. module Text.Pandoc.Readers.CommonMark -- | Parse a CommonMark formatted string into a Pandoc structure. readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Functions common to OOXML writers (Docx and Powerpoint) module Text.Pandoc.Writers.OOXML mknode :: Node t => Text -> [(Text, Text)] -> t -> Element mktnode :: Text -> [(Text, Text)] -> Text -> Element nodename :: Text -> QName toLazy :: ByteString -> ByteString renderXml :: Element -> ByteString parseXml :: PandocMonad m => Archive -> Archive -> String -> m Element elemToNameSpaces :: Element -> NameSpaces elemName :: NameSpaces -> Text -> Text -> QName isElem :: NameSpaces -> Text -> Text -> Element -> Bool type NameSpaces = [(Text, Text)] -- | Scales the image to fit the page sizes are passed in emu fitToPage :: (Double, Double) -> Integer -> (Integer, Integer) -- | Conversion of Pandoc documents to FB2 (FictionBook2) format. -- -- FictionBook is an XML-based e-book format. For more information see: -- http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1 module Text.Pandoc.Writers.FB2 -- | Produce an FB2 document from a Pandoc document. writeFB2 :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance GHC.Show.Show Text.Pandoc.Writers.FB2.FbRenderState instance GHC.Classes.Eq Text.Pandoc.Writers.FB2.ImageMode instance GHC.Show.Show Text.Pandoc.Writers.FB2.ImageMode -- | Entry point to the odt reader. module Text.Pandoc.Readers.Odt readOdt :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc -- | Conversion of JATS XML to Pandoc document. module Text.Pandoc.Readers.JATS readJATS :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.JATS.JATSState instance Data.Default.Class.Default Text.Pandoc.Readers.JATS.JATSState instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Readers.JATS.JATSState -- | Conversion of FB2 to Pandoc document. module Text.Pandoc.Readers.FB2 readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.FB2.FB2State instance Data.Default.Class.Default Text.Pandoc.Readers.FB2.FB2State instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Readers.FB2.FB2State -- | Conversion of Docx type (defined in Text.Pandoc.Readers.Docx.Parse) to -- Pandoc document. module Text.Pandoc.Readers.Docx readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc instance Data.Default.Class.Default Text.Pandoc.Readers.Docx.DEnv instance Data.Default.Class.Default Text.Pandoc.Readers.Docx.DState -- | Conversion of DocBook XML to Pandoc document. module Text.Pandoc.Readers.DocBook readDocBook :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.DocBook.DBState instance Data.Default.Class.Default Text.Pandoc.Readers.DocBook.DBState instance Text.Pandoc.Builder.HasMeta Text.Pandoc.Readers.DocBook.DBState -- | Functions for determining the size of a PNG, JPEG, or GIF image. module Text.Pandoc.ImageSize data ImageType Png :: ImageType Gif :: ImageType Jpeg :: ImageType Svg :: ImageType Pdf :: ImageType Eps :: ImageType Emf :: ImageType imageType :: ByteString -> Maybe ImageType imageSize :: WriterOptions -> ByteString -> Either Text ImageSize sizeInPixels :: ImageSize -> (Integer, Integer) -- | Calculate (height, width) in points using the image file's dpi -- metadata, using 72 Points == 1 Inch. sizeInPoints :: ImageSize -> (Double, Double) -- | Calculate (height, width) in points, considering the desired -- dimensions in the attribute, while falling back on the image file's -- dpi metadata if no dimensions are specified in the attribute (or only -- dimensions in percentages). desiredSizeInPoints :: WriterOptions -> Attr -> ImageSize -> (Double, Double) data Dimension Pixel :: Integer -> Dimension Centimeter :: Double -> Dimension Millimeter :: Double -> Dimension Inch :: Double -> Dimension Percent :: Double -> Dimension Em :: Double -> Dimension data Direction Width :: Direction Height :: Direction -- | Read a Dimension from an Attr attribute. `dimension Width attr` might -- return `Just (Pixel 3)` or for example `Just (Centimeter 2.0)`, etc. dimension :: Direction -> Attr -> Maybe Dimension lengthToDim :: Text -> Maybe Dimension -- | Scale a dimension by a factor. scaleDimension :: Double -> Dimension -> Dimension inInch :: WriterOptions -> Dimension -> Double inPixel :: WriterOptions -> Dimension -> Integer inPoints :: WriterOptions -> Dimension -> Double inEm :: WriterOptions -> Dimension -> Double -- | Maybe split a string into a leading number and trailing unit, e.g. -- "3cm" to Just (3.0, "cm") numUnit :: Text -> Maybe (Double, Text) -- | Convert a Dimension to Text denoting its equivalent in inches, for -- example "2.00000". Note: Dimensions in percentages are converted to -- the empty string. showInInch :: WriterOptions -> Dimension -> Text -- | Convert a Dimension to Text denoting its equivalent in pixels, for -- example "600". Note: Dimensions in percentages are converted to the -- empty string. showInPixel :: WriterOptions -> Dimension -> Text showFl :: RealFloat a => a -> Text instance GHC.Show.Show Text.Pandoc.ImageSize.ImageType instance GHC.Classes.Eq Text.Pandoc.ImageSize.Dimension instance GHC.Classes.Eq Text.Pandoc.ImageSize.ImageSize instance GHC.Show.Show Text.Pandoc.ImageSize.ImageSize instance GHC.Read.Read Text.Pandoc.ImageSize.ImageSize instance Data.Default.Class.Default Text.Pandoc.ImageSize.ImageSize instance GHC.Show.Show Text.Pandoc.ImageSize.Dimension instance GHC.Show.Show Text.Pandoc.ImageSize.Direction -- | Conversion of Pandoc documents to ZimWiki markup. -- -- http://zim-wiki.org/manual/Help/Wiki_Syntax.html module Text.Pandoc.Writers.ZimWiki -- | Convert Pandoc to ZimWiki. writeZimWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance Data.Default.Class.Default Text.Pandoc.Writers.ZimWiki.WriterState -- | Conversion of Pandoc documents to Textile markup. -- -- Textile: -- http://thresholdstate.com/articles/4312/the-textile-reference-manual module Text.Pandoc.Writers.Textile -- | Convert Pandoc to Textile. writeTextile :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc format into Texinfo. module Text.Pandoc.Writers.Texinfo -- | Convert Pandoc to Texinfo. writeTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to Docbook XML. module Text.Pandoc.Writers.TEI -- | Convert Pandoc document to string in Docbook format. writeTEI :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to RTF (rich text format). module Text.Pandoc.Writers.RTF -- | Convert Pandoc to a string in rich text format. writeRTF :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to reStructuredText. -- -- reStructuredText: http://docutils.sourceforge.net/rst.html module Text.Pandoc.Writers.RST -- | Convert Pandoc to RST. writeRST :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Flattens nested inlines. Extracts nested inlines and goes through them -- either collapsing them in the outer inline container or pulling them -- out of it flatten :: Inline -> [Inline] -- | Conversion of Pandoc documents to powerpoint (pptx). module Text.Pandoc.Writers.Powerpoint writePowerpoint :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Conversion of Pandoc documents to ODT. module Text.Pandoc.Writers.ODT -- | Produce an ODT file from a Pandoc document. writeODT :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Conversion of Pandoc documents to Muse. -- -- This module is mostly intended for Amusewiki markup support, as -- described by Text::Amuse markup manual. Original Emacs -- Muse markup support is a secondary goal. -- -- Where Text::Amuse markup differs from Emacs Muse markup, -- Text::Amuse markup is supported. For example, native tables are always -- used instead of Org Mode tables. However, <literal -- style="html"> tag is used for HTML raw blocks even though it -- is supported only in Emacs Muse. module Text.Pandoc.Writers.Muse -- | Convert Pandoc to Muse. writeMuse :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance Data.Default.Class.Default Text.Pandoc.Writers.Muse.WriterState -- | Conversion of Pandoc documents to roff ms format. -- -- TODO: -- -- module Text.Pandoc.Writers.Ms -- | Convert Pandoc to Ms. writeMs :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to MediaWiki markup. -- -- MediaWiki: http://www.mediawiki.org/wiki/MediaWiki module Text.Pandoc.Writers.MediaWiki -- | Convert Pandoc to MediaWiki. writeMediaWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text highlightingLangs :: Set Text -- | Conversion of Pandoc documents to XWiki markup. -- -- XWiki: http://www.xwiki.org/ XWiki Syntax: -- http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/ module Text.Pandoc.Writers.XWiki -- | Convert Pandoc to XWiki. writeXWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc format into LaTeX. module Text.Pandoc.Writers.LaTeX -- | Convert Pandoc to LaTeX. writeLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to LaTeX Beamer. writeBeamer :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to Adobe InCopy ICML, a -- stand-alone XML format which is a subset of the zipped IDML format for -- which the documentation is available here: -- http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/sdk/cs6/idml/idml-specification.pdf -- InCopy is the companion word-processor to Adobe InDesign and ICML -- documents can be integrated into InDesign with File -> Place. module Text.Pandoc.Writers.ICML -- | Convert Pandoc document to string in ICML format. writeICML :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to HTML. module Text.Pandoc.Writers.HTML -- | Convert Pandoc document to Html 4 structure. writeHtml4 :: PandocMonad m => WriterOptions -> Pandoc -> m Html -- | Convert Pandoc document to Html 4 string. writeHtml4String :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Html 5 structure. writeHtml5 :: PandocMonad m => WriterOptions -> Pandoc -> m Html -- | Convert Pandoc document to Html 5 string. writeHtml5String :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Html appropriate for an epub version. writeHtmlStringForEPUB :: PandocMonad m => EPUBVersion -> WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to S5 HTML slide show. writeS5 :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Slidy HTML slide show. writeSlidy :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Slideous HTML slide show. writeSlideous :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to DZSlides HTML slide show. writeDZSlides :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Reveal JS HTML slide show. writeRevealJs :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Create HTML tag with attributes. tagWithAttributes :: WriterOptions -> Bool -> Bool -> Text -> Attr -> Text instance GHC.Classes.Eq Text.Pandoc.Writers.HTML.TablePart -- | Conversion of Pandoc documents to markdown-formatted plain -- text. -- -- Markdown: https://daringfireball.net/projects/markdown/ module Text.Pandoc.Writers.Markdown -- | Convert Pandoc to Markdown. writeMarkdown :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Commonmark. writeCommonMark :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to plain text (like markdown, but without links, -- pictures, or inline formatting). writePlain :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to OPML XML. module Text.Pandoc.Writers.OPML -- | Convert Pandoc document to string in OPML format. writeOPML :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Ipynb (Jupyter notebook JSON format) writer for pandoc. module Text.Pandoc.Writers.Ipynb writeIpynb :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to CommonMark. -- -- CommonMark: http://commonmark.org module Text.Pandoc.Writers.CommonMark -- | Convert Pandoc to Commonmark. writeCommonMark :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion of Pandoc documents to EPUB. module Text.Pandoc.Writers.EPUB -- | Produce an EPUB2 file from a Pandoc document. writeEPUB2 :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Produce an EPUB3 file from a Pandoc document. writeEPUB3 :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString instance GHC.Show.Show Text.Pandoc.Writers.EPUB.Chapter instance GHC.Show.Show Text.Pandoc.Writers.EPUB.Date instance GHC.Show.Show Text.Pandoc.Writers.EPUB.Creator instance GHC.Show.Show Text.Pandoc.Writers.EPUB.Identifier instance GHC.Show.Show Text.Pandoc.Writers.EPUB.Title instance GHC.Show.Show Text.Pandoc.Writers.EPUB.ProgressionDirection instance GHC.Show.Show Text.Pandoc.Writers.EPUB.EPUBMetadata -- | Conversion of Pandoc documents to DokuWiki markup. -- -- DokuWiki: https://www.dokuwiki.org/dokuwiki module Text.Pandoc.Writers.DokuWiki -- | Convert Pandoc to DokuWiki. writeDokuWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance Data.Default.Class.Default Text.Pandoc.Writers.DokuWiki.WriterEnvironment instance Data.Default.Class.Default Text.Pandoc.Writers.DokuWiki.WriterState -- | Conversion of Pandoc documents to docx. module Text.Pandoc.Writers.Docx writeDocx :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString instance GHC.Classes.Ord Text.Pandoc.Writers.Docx.ListMarker instance GHC.Classes.Eq Text.Pandoc.Writers.Docx.ListMarker instance GHC.Read.Read Text.Pandoc.Writers.Docx.ListMarker instance GHC.Show.Show Text.Pandoc.Writers.Docx.ListMarker instance GHC.Base.Semigroup Text.Pandoc.Writers.Docx.EnvProps instance GHC.Base.Monoid Text.Pandoc.Writers.Docx.EnvProps -- | Conversion of Pandoc documents to Docbook XML. module Text.Pandoc.Writers.Docbook writeDocbook4 :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeDocbook5 :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance GHC.Show.Show Text.Pandoc.Writers.Docbook.DocBookVersion instance GHC.Classes.Eq Text.Pandoc.Writers.Docbook.DocBookVersion -- | Conversion of Pandoc format into ConTeXt. module Text.Pandoc.Writers.ConTeXt -- | Convert Pandoc to ConTeXt. writeConTeXt :: PandocMonad m => WriterOptions -> Pandoc -> m Text instance GHC.Classes.Eq Text.Pandoc.Writers.ConTeXt.Tabl instance GHC.Show.Show Text.Pandoc.Writers.ConTeXt.Tabl -- | Conversion of Pandoc documents to asciidoc. -- -- Note that some information may be lost in conversion, due to -- expressive limitations of asciidoc. Footnotes and table cells with -- paragraphs (or other block items) are not possible in asciidoc. If -- pandoc encounters one of these, it will insert a message indicating -- that it has omitted the construct. -- -- AsciiDoc: http://www.methods.co.nz/asciidoc/ module Text.Pandoc.Writers.AsciiDoc -- | Convert Pandoc to AsciiDoc. writeAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to AsciiDoctor compatible AsciiDoc. writeAsciiDoctor :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Conversion from reStructuredText to Pandoc document. module Text.Pandoc.Readers.RST -- | Parse reStructuredText string and return Pandoc document. readRST :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of LaTeX to Pandoc document. module Text.Pandoc.Readers.LaTeX -- | Parse LaTeX from string and return Pandoc document. readLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc applyMacros :: (PandocMonad m, HasMacros s, HasReaderOptions s) => Text -> ParserT Text s m Text rawLaTeXInline :: (PandocMonad m, HasMacros s, HasReaderOptions s) => ParserT Text s m Text rawLaTeXBlock :: (PandocMonad m, HasMacros s, HasReaderOptions s) => ParserT Text s m Text inlineCommand :: PandocMonad m => ParserT Text ParserState m Inlines -- | Conversion of org-mode formatted plain text to Pandoc document. module Text.Pandoc.Readers.Org -- | Parse org-mode string and return a Pandoc document. readOrg :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of HTML to Pandoc document. module Text.Pandoc.Readers.HTML -- | Convert HTML-formatted string to Pandoc document. readHtml :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Matches a tag meeting a certain condition. htmlTag :: (HasReaderOptions st, Monad m) => (Tag Text -> Bool) -> ParserT Text st m (Tag Text, Text) -- | Matches a stretch of HTML in balanced tags. htmlInBalanced :: Monad m => (Tag Text -> Bool) -> ParserT Text st m Text isInlineTag :: Tag Text -> Bool isBlockTag :: Tag Text -> Bool isTextTag :: Tag Text -> Bool isCommentTag :: Tag Text -> Bool -- | Conversion from Textile to Pandoc document, based on the spec -- available at https://www.promptworks.com/textile/. -- -- Implemented and parsed: - Paragraphs - Code blocks - Lists - -- blockquote - Inlines : strong, emph, cite, code, deleted, superscript, -- subscript, links - footnotes - HTML-specific and CSS-specific -- attributes on headers -- -- Left to be implemented: - dimension sign - all caps - continued blocks -- (ex bq..) -- -- TODO : refactor common patterns across readers : - more ... module Text.Pandoc.Readers.Textile -- | Parse a Textile text and return a Pandoc document. readTextile :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of twiki text to Pandoc document. module Text.Pandoc.Readers.TWiki -- | Read twiki from an input string and return a Pandoc document. readTWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of mediawiki text to Pandoc document. module Text.Pandoc.Readers.MediaWiki -- | Read mediawiki from an input string and return a Pandoc document. readMediaWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance Text.Pandoc.Parsing.HasReaderOptions Text.Pandoc.Readers.MediaWiki.MWState instance Text.Pandoc.Parsing.HasIdentifierList Text.Pandoc.Readers.MediaWiki.MWState instance Text.Pandoc.Parsing.HasLogMessages Text.Pandoc.Readers.MediaWiki.MWState -- | Conversion of markdown-formatted plain text to Pandoc document. module Text.Pandoc.Readers.Markdown -- | Read markdown from an input string and return a Pandoc document. readMarkdown :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read a YAML string and convert it to pandoc metadata. String scalars -- in the YAML are parsed as Markdown. yamlToMeta :: PandocMonad m => ReaderOptions -> Maybe FilePath -> ByteString -> m Meta -- | Read a YAML string and extract references from the references -- field, filter using an id predicate and parsing fields as Markdown. yamlToRefs :: PandocMonad m => (Text -> Bool) -> ReaderOptions -> Maybe FilePath -> ByteString -> m [MetaValue] -- | Conversion of OPML to Pandoc document. module Text.Pandoc.Readers.OPML readOPML :: PandocMonad m => ReaderOptions -> Text -> m Pandoc instance GHC.Show.Show Text.Pandoc.Readers.OPML.OPMLState instance Data.Default.Class.Default Text.Pandoc.Readers.OPML.OPMLState -- | Ipynb (Jupyter notebook JSON format) reader for pandoc. module Text.Pandoc.Readers.Ipynb readIpynb :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Conversion of EPUB to Pandoc document. module Text.Pandoc.Readers.EPUB readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc -- | Writes a BibTeX or BibLaTeX bibliographies based on the -- references metadata in a Pandoc document. module Text.Pandoc.Writers.BibTeX -- | Write BibTeX based on the references metadata from a Pandoc document. writeBibTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Write BibLaTeX based on the references metadata from a Pandoc -- document. writeBibLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Parses BibTeX or BibLaTeX bibliographies into a Pandoc document with -- empty body and references and nocite fields in the -- metadata. A wildcard nocite is used so that if the document -- is rendered in another format, the entire bibliography will be -- printed. module Text.Pandoc.Readers.BibTeX -- | Read BibTeX from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readBibTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read BibLaTeX from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readBibLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | This helper module exports the readers. -- -- Note: all of the readers assume that the input text has 'n' -- line endings. So if you get your input text from a web form, you -- should remove 'r' characters using filter (/='r'). module Text.Pandoc.Readers data Reader m TextReader :: (ReaderOptions -> Text -> m Pandoc) -> Reader m ByteStringReader :: (ReaderOptions -> ByteString -> m Pandoc) -> Reader m -- | Association list of formats and readers. readers :: PandocMonad m => [(Text, Reader m)] readDocx :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc readOdt :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc -- | Read markdown from an input string and return a Pandoc document. readMarkdown :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse a CommonMark formatted string into a Pandoc structure. readCommonMark :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read creole from an input string and return a Pandoc document. readCreole :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read DokuWiki from an input string and return a Pandoc document. readDokuWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read mediawiki from an input string and return a Pandoc document. readMediaWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readVimwiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse reStructuredText string and return Pandoc document. readRST :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse org-mode string and return a Pandoc document. readOrg :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse LaTeX from string and return Pandoc document. readLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Convert HTML-formatted string to Pandoc document. readHtml :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readJATS :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read Jira wiki markup. readJira :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse a Textile text and return a Pandoc document. readTextile :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readDocBook :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readOPML :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Parse Haddock markup and return a Pandoc document. readHaddock :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read native formatted text and return a Pandoc document. The input may -- be a full pandoc document, a block list, a block, an inline list, or -- an inline. Thus, for example, -- --
--   Str "hi"
--   
-- -- will be treated as if it were -- --
--   Pandoc nullMeta [Plain [Str "hi"]]
--   
readNative :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read pandoc document from JSON format. readJSON :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read twiki from an input string and return a Pandoc document. readTWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read TikiWiki from an input string and return a Pandoc document. readTikiWiki :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read Txt2Tags from an input string returning a Pandoc document readTxt2Tags :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readEPUB :: PandocMonad m => ReaderOptions -> ByteString -> m Pandoc -- | Read Muse from an input string and return a Pandoc document. readMuse :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readIpynb :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readCSV :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read CSL JSON from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readCslJson :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read BibTeX from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readBibTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Read BibLaTeX from an input string and return a Pandoc document. The -- document will have only metadata, with an empty body. The metadata -- will contain a references field with the bibliography -- entries, and a nocite field with the wildcard `[@*]`. readBibLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc -- | Retrieve reader, extensions based on formatSpec (format+extensions). getReader :: PandocMonad m => Text -> m (Reader m, Extensions) -- | Default extensions from format-describing string. getDefaultExtensions :: Text -> Extensions -- | Running pandoc Lua filters. module Text.Pandoc.Lua -- | Run the lua interpreter, using pandoc's default way of environment -- initialization. runLua :: Lua a -> PandocIO (Either PandocError a) -- | Permissible global Lua variables. data Global FORMAT :: Text -> Global PANDOC_API_VERSION :: Global PANDOC_DOCUMENT :: Pandoc -> Global PANDOC_READER_OPTIONS :: ReaderOptions -> Global PANDOC_SCRIPT_FILE :: FilePath -> Global PANDOC_STATE :: CommonState -> Global PANDOC_VERSION :: Global -- | Set all given globals. setGlobals :: [Global] -> Lua () -- | Transform document using the filter defined in the given file. runFilterFile :: FilePath -> Pandoc -> Lua Pandoc -- | Conversion of Pandoc documents to custom markup using a lua -- writer. module Text.Pandoc.Writers.Custom -- | Convert Pandoc to custom markup. writeCustom :: FilePath -> WriterOptions -> Pandoc -> PandocIO Text instance (Foreign.Lua.Types.Pushable.Pushable a, Foreign.Lua.Types.Pushable.Pushable b) => Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.KeyValue a b) instance Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.Stringify Text.Pandoc.Definition.Format) instance Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.Stringify [Text.Pandoc.Definition.Inline]) instance Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.Stringify [Text.Pandoc.Definition.Block]) instance Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.Stringify Text.Pandoc.Definition.MetaValue) instance Foreign.Lua.Types.Pushable.Pushable (Text.Pandoc.Writers.Custom.Stringify Text.Pandoc.Definition.Citation) module Text.Pandoc.Citeproc processCitations :: PandocMonad m => Pandoc -> m Pandoc -- | Get references defined inline in the metadata and via an external -- bibliography. Only references that are actually cited in the document -- (either with a genuine citation or with nocite) are returned. -- URL variables are converted to links. getReferences :: PandocMonad m => Maybe Locale -> Pandoc -> m [Reference Inlines] -- | Retrieve the CSL style specified by the csl or citation-style metadata -- field in a pandoc document, or the default CSL style if none is -- specified. Retrieve the parent style if the style is a dependent -- style. Add abbreviations defined in an abbreviation file if one has -- been specified. getStyle :: PandocMonad m => Pandoc -> m (Style Inlines) instance GHC.Classes.Ord Text.Pandoc.Citeproc.BibFormat instance GHC.Classes.Eq Text.Pandoc.Citeproc.BibFormat instance GHC.Show.Show Text.Pandoc.Citeproc.BibFormat -- | Conversion of Pandoc documents to JATS XML. Reference: -- https:/jats.nlm.nih.govpublishing/tag-library module Text.Pandoc.Writers.JATS -- | Alias for writeJatsArchiving. This function exists for -- backwards compatibility, but will be deprecated in the future. Use -- writeJatsArchiving instead. writeJATS :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Archiving and -- Interchange Tag Set.) writeJatsArchiving :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Journal Publishing -- Tag Set.) writeJatsPublishing :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Archiving and -- Interchange Tag Set.) writeJatsArticleAuthoring :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | This helper module exports all writers functions. module Text.Pandoc.Writers data Writer m TextWriter :: (WriterOptions -> Pandoc -> m Text) -> Writer m ByteStringWriter :: (WriterOptions -> Pandoc -> m ByteString) -> Writer m -- | Association list of formats and writers. writers :: PandocMonad m => [(Text, Writer m)] -- | Convert Pandoc to AsciiDoc. writeAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to AsciiDoctor compatible AsciiDoc. writeAsciiDoctor :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to LaTeX Beamer. writeBeamer :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Write BibTeX based on the references metadata from a Pandoc document. writeBibTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Write BibLaTeX based on the references metadata from a Pandoc -- document. writeBibLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Commonmark. writeCommonMark :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to ConTeXt. writeConTeXt :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to custom markup. writeCustom :: FilePath -> WriterOptions -> Pandoc -> PandocIO Text writeCslJson :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to DZSlides HTML slide show. writeDZSlides :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeDocbook4 :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeDocbook5 :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeDocx :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Convert Pandoc to DokuWiki. writeDokuWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Produce an EPUB2 file from a Pandoc document. writeEPUB2 :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Produce an EPUB3 file from a Pandoc document. writeEPUB3 :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Produce an FB2 document from a Pandoc document. writeFB2 :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeIpynb :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Haddock. writeHaddock :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Html 4 structure. writeHtml4 :: PandocMonad m => WriterOptions -> Pandoc -> m Html -- | Convert Pandoc document to Html 4 string. writeHtml4String :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Html 5 structure. writeHtml5 :: PandocMonad m => WriterOptions -> Pandoc -> m Html -- | Convert Pandoc document to Html 5 string. writeHtml5String :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to string in ICML format. writeICML :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Alias for writeJatsArchiving. This function exists for -- backwards compatibility, but will be deprecated in the future. Use -- writeJatsArchiving instead. writeJATS :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Archiving and -- Interchange Tag Set.) writeJatsArchiving :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Archiving and -- Interchange Tag Set.) writeJatsArticleAuthoring :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert a Pandoc document to JATS (Journal Publishing -- Tag Set.) writeJatsPublishing :: PandocMonad m => WriterOptions -> Pandoc -> m Text writeJSON :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Jira. writeJira :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to LaTeX. writeLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Man. writeMan :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Markdown. writeMarkdown :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to MediaWiki. writeMediaWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Ms. writeMs :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Muse. writeMuse :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Prettyprint Pandoc document. writeNative :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Produce an ODT file from a Pandoc document. writeODT :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Convert Pandoc document to string in OPML format. writeOPML :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to string in OpenDocument format. writeOpenDocument :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Org. writeOrg :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to plain text (like markdown, but without links, -- pictures, or inline formatting). writePlain :: PandocMonad m => WriterOptions -> Pandoc -> m Text writePowerpoint :: PandocMonad m => WriterOptions -> Pandoc -> m ByteString -- | Convert Pandoc to RST. writeRST :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to a string in rich text format. writeRTF :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Reveal JS HTML slide show. writeRevealJs :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to S5 HTML slide show. writeS5 :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Slideous HTML slide show. writeSlideous :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to Slidy HTML slide show. writeSlidy :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc document to string in Docbook format. writeTEI :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Texinfo. writeTexinfo :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to Textile. writeTextile :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to XWiki. writeXWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Convert Pandoc to ZimWiki. writeZimWiki :: PandocMonad m => WriterOptions -> Pandoc -> m Text -- | Retrieve writer, extensions based on formatSpec (format+extensions). getWriter :: PandocMonad m => Text -> m (Writer m, Extensions) -- | This helper module exports the main writers, readers, and data -- structure definitions from the Pandoc libraries. -- -- A typical application will chain together a reader and a writer to -- convert strings from one format to another. For example, the following -- simple program will act as a filter converting markdown fragments to -- reStructuredText, using reference-style links instead of inline links: -- --
--   module Main where
--   import Text.Pandoc
--   import Data.Text (Text)
--   import qualified Data.Text.IO as T
--   
--   mdToRST :: Text -> IO Text
--   mdToRST txt = runIOorExplode $
--     readMarkdown def txt
--     >>= writeRST def{ writerReferenceLinks = True }
--   
--   main :: IO ()
--   main = do
--     T.getContents >>= mdToRST >>= T.putStrLn
--   
module Text.Pandoc -- | Version number of pandoc library. pandocVersion :: Text -- | Programmatically modifications of pandoc documents. module Text.Pandoc.Filter -- | Type of filter and path to filter file. data Filter LuaFilter :: FilePath -> Filter JSONFilter :: FilePath -> Filter CiteprocFilter :: Filter -- | Modify the given document using a filter. applyFilters :: ReaderOptions -> [Filter] -> [String] -> Pandoc -> PandocIO Pandoc instance Data.Aeson.Types.ToJSON.ToJSON Text.Pandoc.Filter.Filter instance Data.Aeson.Types.FromJSON.FromJSON Text.Pandoc.Filter.Filter instance GHC.Generics.Generic Text.Pandoc.Filter.Filter instance GHC.Show.Show Text.Pandoc.Filter.Filter instance Data.YAML.FromYAML Text.Pandoc.Filter.Filter -- | Does a pandoc conversion based on command-line options. module Text.Pandoc.App convertWithOpts :: Opt -> IO () -- | Data structure for command line options. data Opt Opt :: Int -> Bool -> Bool -> Maybe Text -> Maybe Text -> Bool -> Int -> Maybe FilePath -> Context Text -> Meta -> [FilePath] -> Maybe FilePath -> Maybe [FilePath] -> Bool -> [Int] -> Bool -> Bool -> Bool -> Bool -> Maybe Text -> [FilePath] -> TopLevelDivision -> HTMLMathMethod -> Maybe FilePath -> Maybe FilePath -> String -> Maybe FilePath -> [FilePath] -> Int -> Maybe FilePath -> Int -> Bool -> Bool -> Verbosity -> Bool -> Maybe FilePath -> Bool -> Bool -> ReferenceLocation -> Int -> WrapOption -> Int -> [Filter] -> ObfuscationMethod -> Text -> Bool -> [Text] -> Maybe FilePath -> CiteMethod -> Bool -> Maybe String -> [String] -> Maybe Int -> Bool -> Bool -> Text -> Maybe FilePath -> TrackChanges -> Bool -> Maybe Text -> [FilePath] -> IpynbOutput -> [FilePath] -> [FilePath] -> [FilePath] -> [FilePath] -> [(Text, Text)] -> Bool -> LineEnding -> Bool -> Maybe FilePath -> [FilePath] -> Maybe FilePath -> Opt -- | Number of spaces per tab [optTabStop] :: Opt -> Int -- | Preserve tabs instead of converting to spaces [optPreserveTabs] :: Opt -> Bool -- | Include header, footer [optStandalone] :: Opt -> Bool -- | Reader format [optFrom] :: Opt -> Maybe Text -- | Writer format [optTo] :: Opt -> Maybe Text -- | Include table of contents [optTableOfContents] :: Opt -> Bool -- | Shift heading level by [optShiftHeadingLevelBy] :: Opt -> Int -- | Custom template [optTemplate] :: Opt -> Maybe FilePath -- | Template variables to set [optVariables] :: Opt -> Context Text -- | Metadata fields to set [optMetadata] :: Opt -> Meta -- | Name of YAML metadata files [optMetadataFiles] :: Opt -> [FilePath] -- | Name of output file [optOutputFile] :: Opt -> Maybe FilePath -- | Names of input files [optInputFiles] :: Opt -> Maybe [FilePath] -- | Number sections in LaTeX [optNumberSections] :: Opt -> Bool -- | Starting number for sections [optNumberOffset] :: Opt -> [Int] -- | Put sections in div tags in HTML [optSectionDivs] :: Opt -> Bool -- | Use incremental lists in SlidySlideousS5 [optIncremental] :: Opt -> Bool -- | Make HTML accessible offline [optSelfContained] :: Opt -> Bool -- | Use q tags in HTML [optHtmlQTags] :: Opt -> Bool -- | Style to use for highlighted code [optHighlightStyle] :: Opt -> Maybe Text -- | xml syntax defs to load [optSyntaxDefinitions] :: Opt -> [FilePath] -- | Type of the top-level divisions [optTopLevelDivision] :: Opt -> TopLevelDivision -- | Method to print HTML math [optHTMLMathMethod] :: Opt -> HTMLMathMethod -- | Path to abbrevs file [optAbbreviations] :: Opt -> Maybe FilePath -- | Path of reference doc [optReferenceDoc] :: Opt -> Maybe FilePath -- | EPUB subdir in OCF container [optEpubSubdirectory] :: Opt -> String -- | EPUB metadata [optEpubMetadata] :: Opt -> Maybe FilePath -- | EPUB fonts to embed [optEpubFonts] :: Opt -> [FilePath] -- | Header level at which to split chapters [optEpubChapterLevel] :: Opt -> Int -- | Cover image for epub [optEpubCoverImage] :: Opt -> Maybe FilePath -- | Number of levels to include in TOC [optTOCDepth] :: Opt -> Int -- | Output command-line arguments [optDumpArgs] :: Opt -> Bool -- | Ignore command-line arguments [optIgnoreArgs] :: Opt -> Bool -- | Verbosity of diagnostic output [optVerbosity] :: Opt -> Verbosity -- | Enable tracing [optTrace] :: Opt -> Bool -- | File to write JSON log output [optLogFile] :: Opt -> Maybe FilePath -- | Fail on warnings [optFailIfWarnings] :: Opt -> Bool -- | Use reference links in writing markdown, rst [optReferenceLinks] :: Opt -> Bool -- | location for footnotes and link references in markdown output [optReferenceLocation] :: Opt -> ReferenceLocation -- | Dpi [optDpi] :: Opt -> Int -- | Options for wrapping text [optWrap] :: Opt -> WrapOption -- | Line length in characters [optColumns] :: Opt -> Int -- | Filters to apply [optFilters] :: Opt -> [Filter] [optEmailObfuscation] :: Opt -> ObfuscationMethod [optIdentifierPrefix] :: Opt -> Text -- | Strip empty paragraphs [optStripEmptyParagraphs] :: Opt -> Bool -- | Default classes for indented code blocks [optIndentedCodeClasses] :: Opt -> [Text] [optDataDir] :: Opt -> Maybe FilePath -- | Method to output cites [optCiteMethod] :: Opt -> CiteMethod -- | Use listings package for code blocks [optListings] :: Opt -> Bool -- | Program to use for latex/html -> pdf [optPdfEngine] :: Opt -> Maybe String -- | Flags to pass to the engine [optPdfEngineOpts] :: Opt -> [String] -- | Header level that creates slides [optSlideLevel] :: Opt -> Maybe Int -- | Use atx headers for markdown level 1-2 [optSetextHeaders] :: Opt -> Bool -- | Prefer ascii output [optAscii] :: Opt -> Bool -- | Default image extension [optDefaultImageExtension] :: Opt -> Text -- | Path to extract embedded media [optExtractMedia] :: Opt -> Maybe FilePath -- | Accept or reject MS Word track-changes. [optTrackChanges] :: Opt -> TrackChanges -- | Parse input files before combining [optFileScope] :: Opt -> Bool -- | Prefix for title [optTitlePrefix] :: Opt -> Maybe Text -- | CSS files to link to [optCss] :: Opt -> [FilePath] -- | How to treat ipynb output blocks [optIpynbOutput] :: Opt -> IpynbOutput -- | Files to include before [optIncludeBeforeBody] :: Opt -> [FilePath] -- | Files to include after body [optIncludeAfterBody] :: Opt -> [FilePath] -- | Files to include in header [optIncludeInHeader] :: Opt -> [FilePath] -- | Path to search for images etc [optResourcePath] :: Opt -> [FilePath] -- | Headers for HTTP requests [optRequestHeaders] :: Opt -> [(Text, Text)] -- | Disable certificate validation [optNoCheckCertificate] :: Opt -> Bool -- | Style of line-endings to use [optEol] :: Opt -> LineEnding -- | Skip HTML comments [optStripComments] :: Opt -> Bool -- | CSL stylesheet [optCSL] :: Opt -> Maybe FilePath -- | Bibliography files [optBibliography] :: Opt -> [FilePath] -- | Citation abbreviations [optCitationAbbreviations] :: Opt -> Maybe FilePath -- | The type of line-endings to be used when writing plain-text. data LineEnding LF :: LineEnding CRLF :: LineEnding Native :: LineEnding -- | Type of filter and path to filter file. data Filter LuaFilter :: FilePath -> Filter JSONFilter :: FilePath -> Filter -- | Defaults for command-line options. defaultOpts :: Opt parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt parseOptionsFromArgs :: [OptDescr (Opt -> IO Opt)] -> Opt -> String -> [String] -> IO Opt -- | A list of functions, each transforming the options data structure in -- response to a command-line option. options :: [OptDescr (Opt -> IO Opt)] -- | Modify the given document using a filter. applyFilters :: ReaderOptions -> [Filter] -> [String] -> Pandoc -> PandocIO Pandoc