Removed "compatibility mode" when called as hsmarkdown.

This commit is contained in:
John MacFarlane 2015-12-13 12:17:28 -08:00
parent 678e7da709
commit c16efea983
3 changed files with 12 additions and 41 deletions

13
README
View file

@ -227,19 +227,6 @@ or [variables for ConTeXt].
[`biber`]: https://ctan.org/pkg/biber [`biber`]: https://ctan.org/pkg/biber
[TeX Live]: http://www.tug.org/texlive/ [TeX Live]: http://www.tug.org/texlive/
`hsmarkdown`
------------
A user who wants a drop-in replacement for `Markdown.pl` may create
a symbolic link to the `pandoc` executable called `hsmarkdown`. When
invoked under the name `hsmarkdown`, `pandoc` will behave as if
invoked with `-f markdown_strict --email-obfuscation=references`,
and all command-line options will be treated as regular arguments.
This approach does not work under [Cygwin], due to problems with
its simulation of symbolic links.
[Cygwin]: https://cygwin.com
Options Options
======= =======

View file

@ -15,28 +15,22 @@ Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2
Synopsis: Conversion between markup formats Synopsis: Conversion between markup formats
Description: Pandoc is a Haskell library for converting from one markup Description: Pandoc is a Haskell library for converting from one markup
format to another, and a command-line tool that uses format to another, and a command-line tool that uses
this library. It can read markdown and (subsets of) HTML, this library. It can read several dialects of Markdown and
reStructuredText, LaTeX, DocBook, MediaWiki markup, TWiki (subsets of) HTML, reStructuredText, LaTeX, DocBook,
markup, Haddock markup, OPML, Emacs Org-Mode, txt2tags, MediaWiki markup, TWiki markup, Haddock markup, OPML,
Word Docx, ODT, and Textile, and it can write Emacs Org-Mode, txt2tags, Word Docx, ODT, and Textile, and
Markdown, reStructuredText, XHTML, HTML 5, LaTeX, it can write Markdown, reStructuredText, XHTML, HTML 5,
ConTeXt, DocBook, OPML, OpenDocument, ODT, LaTeX, ConTeXt, DocBook, OPML, OpenDocument, ODT,
Word docx, RTF, MediaWiki, DokuWiki, Textile, groff man Word docx, RTF, MediaWiki, DokuWiki, Textile, groff man
pages, plain text, Emacs Org-Mode, AsciiDoc, Haddock markup, pages, plain text, Emacs Org-Mode, AsciiDoc, Haddock markup,
EPUB (v2 and v3), FictionBook2, InDesign ICML, and several EPUB (v2 and v3), FictionBook2, InDesign ICML, and several
kinds of HTML/javascript slide shows (S5, Slidy, Slideous, kinds of HTML/javascript slide shows (S5, Slidy, Slideous,
DZSlides, reveal.js). DZSlides, reveal.js).
. .
Pandoc extends standard markdown syntax with footnotes, In contrast to most existing tools for converting Markdown
embedded LaTeX, definition lists, tables, and other to HTML, pandoc has a modular design: it consists of a set of
features. A compatibility mode is provided for those readers, which parse text in a given format and produce a
who need a drop-in replacement for Markdown.pl. native representation of the document, and a set of writers,
.
In contrast to existing tools for converting markdown
to HTML, which use regex substitutions, 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 which convert this native representation into a target
format. Thus, adding an input or output format requires format. Thus, adding an input or output format requires
only adding a reader or writer. only adding a reader or writer.

View file

@ -1047,25 +1047,15 @@ main = do
rawArgs <- map UTF8.decodeArg <$> getArgs rawArgs <- map UTF8.decodeArg <$> getArgs
prg <- getProgName prg <- getProgName
let compatMode = prg == "hsmarkdown"
let (actions, args, errors) = if compatMode let (actions, args, errors) = getOpt Permute options rawArgs
then ([], rawArgs, [])
else getOpt Permute options rawArgs
unless (null errors) $ unless (null errors) $
err 2 $ concat $ errors ++ err 2 $ concat $ errors ++
["Try " ++ prg ++ " --help for more information."] ["Try " ++ prg ++ " --help for more information."]
let defaultOpts' = if compatMode
then defaultOpts { optReader = "markdown_strict"
, optWriter = "html"
, optEmailObfuscation =
ReferenceObfuscation }
else defaultOpts
-- thread option data structure through all supplied option actions -- thread option data structure through all supplied option actions
opts <- foldl (>>=) (return defaultOpts') actions opts <- foldl (>>=) (return defaultOpts) actions
let Opt { optTabStop = tabStop let Opt { optTabStop = tabStop
, optPreserveTabs = preserveTabs , optPreserveTabs = preserveTabs