@@ -137,61 +137,63 @@ data Opt = Opt
137137 , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
138138 , optAscii :: Bool -- ^ Use ascii characters only in html
139139 , optTeXLigatures :: Bool -- ^ Use TeX ligatures for quotes/dashes
140+ , optDefaultImageExtension :: String -- ^ Default image extension
140141 }
141142
142143-- | Defaults for command-line options.
143144defaultOpts :: Opt
144145defaultOpts = Opt
145− { optTabStop = 4
146− , optPreserveTabs = False
147− , optStandalone = False
148− , optReader = "" -- null for default reader
149− , optWriter = "" -- null for default writer
150− , optParseRaw = False
151− , optTableOfContents = False
152− , optTransforms = []
153− , optTemplate = Nothing
154− , optVariables = []
155− , optOutputFile = "-" -- "-" means stdout
156− , optNumberSections = False
157− , optSectionDivs = False
158− , optIncremental = False
159− , optSelfContained = False
160− , optSmart = False
161− , optOldDashes = False
162− , optHtml5 = False
163− , optHtmlQTags = False
164− , optHighlight = True
165− , optHighlightStyle = pygments
166− , optChapters = False
167− , optHTMLMathMethod = PlainMath
168− , optReferenceODT = Nothing
169− , optReferenceDocx = Nothing
170− , optEpubStylesheet = Nothing
171− , optEpubMetadata = ""
172− , optEpubFonts = []
173− , optEpubChapterLevel = 1
174− , optTOCDepth = 3
175− , optDumpArgs = False
176− , optIgnoreArgs = False
177− , optReferenceLinks = False
178− , optWrapText = True
179− , optColumns = 72
180− , optPlugins = []
181− , optEmailObfuscation = JavascriptObfuscation
182− , optIdentifierPrefix = ""
183− , optIndentedCodeClasses = []
184− , optDataDir = Nothing
185− , optCiteMethod = Citeproc
186− , optBibliography = []
187− , optCslFile = Nothing
188− , optAbbrevsFile = Nothing
189− , optListings = False
190− , optLaTeXEngine = "pdflatex"
191− , optSlideLevel = Nothing
192− , optSetextHeaders = True
193− , optAscii = False
194− , optTeXLigatures = True
146+ { optTabStop = 4
147+ , optPreserveTabs = False
148+ , optStandalone = False
149+ , optReader = "" -- null for default reader
150+ , optWriter = "" -- null for default writer
151+ , optParseRaw = False
152+ , optTableOfContents = False
153+ , optTransforms = []
154+ , optTemplate = Nothing
155+ , optVariables = []
156+ , optOutputFile = "-" -- "-" means stdout
157+ , optNumberSections = False
158+ , optSectionDivs = False
159+ , optIncremental = False
160+ , optSelfContained = False
161+ , optSmart = False
162+ , optOldDashes = False
163+ , optHtml5 = False
164+ , optHtmlQTags = False
165+ , optHighlight = True
166+ , optHighlightStyle = pygments
167+ , optChapters = False
168+ , optHTMLMathMethod = PlainMath
169+ , optReferenceODT = Nothing
170+ , optReferenceDocx = Nothing
171+ , optEpubStylesheet = Nothing
172+ , optEpubMetadata = ""
173+ , optEpubFonts = []
174+ , optEpubChapterLevel = 1
175+ , optTOCDepth = 3
176+ , optDumpArgs = False
177+ , optIgnoreArgs = False
178+ , optReferenceLinks = False
179+ , optWrapText = True
180+ , optColumns = 72
181+ , optPlugins = []
182+ , optEmailObfuscation = JavascriptObfuscation
183+ , optIdentifierPrefix = ""
184+ , optIndentedCodeClasses = []
185+ , optDataDir = Nothing
186+ , optCiteMethod = Citeproc
187+ , optBibliography = []
188+ , optCslFile = Nothing
189+ , optAbbrevsFile = Nothing
190+ , optListings = False
191+ , optLaTeXEngine = "pdflatex"
192+ , optSlideLevel = Nothing
193+ , optSetextHeaders = True
194+ , optAscii = False
195+ , optTeXLigatures = True
196+ , optDefaultImageExtension = ""
195197 }
196198
197199-- | A list of functions, each transforming the options data structure
@@ -495,6 +497,12 @@ options =
495497 (\opt -> return opt { optSectionDivs = True }))
496498 "" -- "Put sections in div tags in HTML"
497499
500+ , Option "" ["default-image-extension"]
501+ (ReqArg
502+ (\arg opt -> return opt { optDefaultImageExtension = arg })
503+ "extension")
504+ "" -- "Default extension for extensionless images"
505+
498506 , Option "" ["email-obfuscation"]
499507 (ReqArg
500508 (\arg opt -> do
@@ -806,55 +814,56 @@ main = do
806814 -- thread option data structure through all supplied option actions
807815 opts <- foldl (>>=) (return defaultOpts') actions
808816
809− let Opt { optTabStop = tabStop
810− , optPreserveTabs = preserveTabs
811− , optStandalone = standalone
812− , optReader = readerName
813− , optWriter = writerName
814− , optParseRaw = parseRaw
815− , optVariables = variables
816− , optTableOfContents = toc
817− , optTransforms = transforms
818− , optTemplate = templatePath
819− , optOutputFile = outputFile
820− , optNumberSections = numberSections
821− , optSectionDivs = sectionDivs
822− , optIncremental = incremental
823− , optSelfContained = selfContained
824− , optSmart = smart
825− , optOldDashes = oldDashes
826− , optHtml5 = html5
827− , optHtmlQTags = htmlQTags
828− , optHighlight = highlight
829− , optHighlightStyle = highlightStyle
830− , optChapters = chapters
831− , optHTMLMathMethod = mathMethod
832− , optReferenceODT = referenceODT
833− , optReferenceDocx = referenceDocx
834− , optEpubStylesheet = epubStylesheet
835− , optEpubMetadata = epubMetadata
836− , optEpubFonts = epubFonts
837− , optEpubChapterLevel = epubChapterLevel
838− , optTOCDepth = epubTOCDepth
839− , optDumpArgs = dumpArgs
840− , optIgnoreArgs = ignoreArgs
841− , optReferenceLinks = referenceLinks
842− , optWrapText = wrap
843− , optColumns = columns
844− , optEmailObfuscation = obfuscationMethod
845− , optIdentifierPrefix = idPrefix
846− , optIndentedCodeClasses = codeBlockClasses
847− , optDataDir = mbDataDir
848− , optBibliography = reffiles
849− , optCslFile = mbCsl
850− , optAbbrevsFile = cslabbrevs
851− , optCiteMethod = citeMethod
852− , optListings = listings
853− , optLaTeXEngine = latexEngine
854− , optSlideLevel = slideLevel
855− , optSetextHeaders = setextHeaders
856− , optAscii = ascii
857− , optTeXLigatures = texLigatures
817+ let Opt { optTabStop = tabStop
818+ , optPreserveTabs = preserveTabs
819+ , optStandalone = standalone
820+ , optReader = readerName
821+ , optWriter = writerName
822+ , optParseRaw = parseRaw
823+ , optVariables = variables
824+ , optTableOfContents = toc
825+ , optTransforms = transforms
826+ , optTemplate = templatePath
827+ , optOutputFile = outputFile
828+ , optNumberSections = numberSections
829+ , optSectionDivs = sectionDivs
830+ , optIncremental = incremental
831+ , optSelfContained = selfContained
832+ , optSmart = smart
833+ , optOldDashes = oldDashes
834+ , optHtml5 = html5
835+ , optHtmlQTags = htmlQTags
836+ , optHighlight = highlight
837+ , optHighlightStyle = highlightStyle
838+ , optChapters = chapters
839+ , optHTMLMathMethod = mathMethod
840+ , optReferenceODT = referenceODT
841+ , optReferenceDocx = referenceDocx
842+ , optEpubStylesheet = epubStylesheet
843+ , optEpubMetadata = epubMetadata
844+ , optEpubFonts = epubFonts
845+ , optEpubChapterLevel = epubChapterLevel
846+ , optTOCDepth = epubTOCDepth
847+ , optDumpArgs = dumpArgs
848+ , optIgnoreArgs = ignoreArgs
849+ , optReferenceLinks = referenceLinks
850+ , optWrapText = wrap
851+ , optColumns = columns
852+ , optEmailObfuscation = obfuscationMethod
853+ , optIdentifierPrefix = idPrefix
854+ , optIndentedCodeClasses = codeBlockClasses
855+ , optDataDir = mbDataDir
856+ , optBibliography = reffiles
857+ , optCslFile = mbCsl
858+ , optAbbrevsFile = cslabbrevs
859+ , optCiteMethod = citeMethod
860+ , optListings = listings
861+ , optLaTeXEngine = latexEngine
862+ , optSlideLevel = slideLevel
863+ , optSetextHeaders = setextHeaders
864+ , optAscii = ascii
865+ , optTeXLigatures = texLigatures
866+ , optDefaultImageExtension = defaultImageExtension
858867 } = opts
859868
860869 when dumpArgs $
@@ -996,6 +1005,7 @@ main = do
9961005 , readerCitationStyle = mbsty
9971006 , readerIndentedCodeClasses = codeBlockClasses
9981007 , readerApplyMacros = not laTeXOutput
1008+ , readerDefaultImageExtension = defaultImageExtension
9991009 }
10001010
10011011 let writerOptions = def { writerStandalone = standalone',