2012-07-25 10:18:57 -07:00
|
|
|
{-
|
|
|
|
Copyright (C) 2012 John MacFarlane <jgm@berkeley.edu>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
-}
|
|
|
|
|
|
|
|
{- |
|
|
|
|
Module : Text.Pandoc.Options
|
|
|
|
Copyright : Copyright (C) 2012 John MacFarlane
|
|
|
|
License : GNU GPL, version 2 or above
|
|
|
|
|
|
|
|
Maintainer : John MacFarlane <jgm@berkeley.edu>
|
|
|
|
Stability : alpha
|
|
|
|
Portability : portable
|
|
|
|
|
|
|
|
Data structures and functions for representing parser and writer
|
|
|
|
options.
|
|
|
|
-}
|
|
|
|
module Text.Pandoc.Options ( Extension(..)
|
2012-07-25 11:08:06 -07:00
|
|
|
, ReaderOptions(..)
|
2012-07-25 22:35:41 -07:00
|
|
|
, def
|
2012-07-25 10:18:57 -07:00
|
|
|
) where
|
|
|
|
import Data.Set (Set)
|
2012-07-25 10:45:45 -07:00
|
|
|
import qualified Data.Set as Set
|
|
|
|
import Data.Default
|
2012-07-25 10:18:57 -07:00
|
|
|
|
2012-07-25 10:45:45 -07:00
|
|
|
-- | Individually selectable syntax extensions.
|
2012-07-25 10:18:57 -07:00
|
|
|
data Extension = Footnotes
|
2012-07-26 18:56:19 -07:00
|
|
|
| Tex_math
|
2012-07-25 10:18:57 -07:00
|
|
|
| Delimited_code_blocks
|
2012-07-26 18:56:19 -07:00
|
|
|
| Markdown_in_html_blocks
|
2012-07-25 10:18:57 -07:00
|
|
|
| Fancy_lists
|
2012-07-26 18:56:19 -07:00
|
|
|
| Startnum
|
2012-07-25 10:18:57 -07:00
|
|
|
| Definition_lists
|
|
|
|
| Header_identifiers
|
|
|
|
| All_symbols_escapable
|
|
|
|
| Intraword_underscores
|
|
|
|
| Blank_before_blockquote
|
|
|
|
| Blank_before_header
|
|
|
|
| Significant_bullets
|
2012-07-25 10:45:45 -07:00
|
|
|
deriving (Show, Read, Enum, Eq, Ord, Bounded)
|
2012-07-25 10:18:57 -07:00
|
|
|
|
2012-07-25 11:08:06 -07:00
|
|
|
data ReaderOptions = ReaderOptions{
|
2012-07-25 20:20:03 -07:00
|
|
|
readerExtensions :: Set Extension -- ^ Syntax extensions
|
|
|
|
, readerSmart :: Bool -- ^ Smart punctuation
|
|
|
|
, readerStrict :: Bool -- ^ FOR TRANSITION ONLY
|
2012-07-25 22:04:23 -07:00
|
|
|
, readerStandalone :: Bool -- ^ Standalone document with header
|
2012-07-25 20:20:03 -07:00
|
|
|
, readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
|
|
|
|
, readerColumns :: Int -- ^ Number of columns in terminal
|
|
|
|
, readerTabStop :: Int -- ^ Tab stop
|
|
|
|
, readerOldDashes :: Bool -- ^ Use pandoc <= 1.8.2.1 behavior
|
2012-07-25 12:37:04 -07:00
|
|
|
-- in parsing dashes; -- is em-dash;
|
|
|
|
-- - before numerial is en-dash
|
2012-07-25 20:20:03 -07:00
|
|
|
, readerLiterateHaskell :: Bool -- ^ Interpret as literate Haskell
|
2012-07-25 20:27:20 -07:00
|
|
|
, readerCitations :: [String] -- ^ List of available citations
|
2012-07-25 20:42:15 -07:00
|
|
|
, readerApplyMacros :: Bool -- ^ Apply macros to TeX math
|
|
|
|
, readerIndentedCodeClasses :: [String] -- ^ Default classes for
|
|
|
|
-- indented code blocks
|
2012-07-25 12:37:04 -07:00
|
|
|
} deriving (Show, Read)
|
2012-07-25 10:18:57 -07:00
|
|
|
|
2012-07-25 11:08:06 -07:00
|
|
|
instance Default ReaderOptions
|
|
|
|
where def = ReaderOptions{
|
2012-07-25 20:42:15 -07:00
|
|
|
readerExtensions = Set.fromList [minBound..maxBound]
|
|
|
|
, readerSmart = False
|
|
|
|
, readerStrict = False
|
2012-07-25 22:04:23 -07:00
|
|
|
, readerStandalone = False
|
2012-07-25 20:42:15 -07:00
|
|
|
, readerParseRaw = False
|
|
|
|
, readerColumns = 80
|
|
|
|
, readerTabStop = 4
|
|
|
|
, readerOldDashes = False
|
|
|
|
, readerLiterateHaskell = False
|
|
|
|
, readerCitations = []
|
|
|
|
, readerApplyMacros = True
|
|
|
|
, readerIndentedCodeClasses = []
|
2012-07-25 10:45:45 -07:00
|
|
|
}
|