aboutsummaryrefslogtreecommitdiff
path: root/pandoc.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-01-25Have to do some work to get the mediabag out.Jesse Rosenthal1-13/+20
2017-01-25Deleted whitespace at end of source lines.John MacFarlane1-1/+1
2017-01-25Clean up Text.PandocJesse Rosenthal1-5/+5
We had primed versions of all the Writer types and getWriter functions, as we transitioned. Now that we're using the new ones exclusively, we'll get rid of the old ones, and get rid of the primes in the names.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-18/+21
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-19Some fixes to permit breezeDark style.John MacFarlane1-2/+2
2017-01-19Add breezeDark to the list of highlighting styles.John MacFarlane1-0/+1
2016-12-23Updates to use skylighting rather than highlighting-kate.John MacFarlane1-4/+7
So far this just reproduces capacity. Later we'll be able to add features like warning messages, dynamic loading of xml syntax definitions, and dynamic loading of themes.
2016-12-09We no longer need the MathMLInHTML.js shim from 2004!John MacFarlane1-3/+0
2016-12-08Set PANDOC_VERSION environment variable for filters.John MacFarlane1-2/+4
Closes #2640.
2016-12-07Fixed bash completion for filenames with spaces.John MacFarlane1-2/+3
Closes #2749.
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-5/+4
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]
2016-11-27Refactor top-level division selection (#3261)Albert Krewinkel1-6/+9
The "default" option is no longer represented as `Nothing` but via a new type constructor, making the `Maybe` wrapper superfluous. The default behavior of using heuristics can now be enabled explicitly by setting `--top-level-division=default`. API change (`Text.Pandoc.Options`): The `Division` type was renamed to `TopLevelDivision`. The `Section`, `Chapter`, and `Part` constructors were renamed to `TopLevelSection`, `TopLevelChapter`, and `TopLevelPart`, respectively. An additional `TopLevelDefault` constructor was added, which is now also the new default value of the `writerTopLevelDivision` field in `WriterOptions`.
2016-11-26Allow to overwrite top-level division type heuristics (#3258)Albert Krewinkel1-4/+4
Pandoc uses heuristics to determine the most resonable top-level division type when emitting LaTeX or Docbook markup. It is now possible to overwrite this implicitly set top-level division via the `top-level-division` command line parameter. API change (`Text.Pandoc.Options`): the type of the `writerTopLevelDivision` field in of the `WriterOptions` data type is altered from `Division` to `Maybe Division`. The field's default value is changed from `Section` to `Nothing`. Closes: #3197
2016-11-21Cleaned up filter-finding.John MacFarlane1-40/+27
* Removed a hardcoded '/' that may have caused problems with Windows paths. * Cleaned up the logic.
2016-11-21Changed resolution of filter paths.John MacFarlane1-12/+15
- We now first treat the argument of `--filter` as a full (absolute or relative) path, looking for a program there. If it's found, we run it. - If not, and if it is a simple program name or a relative path, we try resolving it relative to `$DATADIR/filters`. - If this fails, then we treat it as a program name and look in the user's PATH. Previously if you did `--filter foo` and you had `foo` in your path and also an executable `foo` in your working directory, the one in the path would be used. Now the one in the working directory is used. In addition, when you do `--filter foo/bar.hs`, pandoc will now find a filter `$DATADIR/filters/foo/bar.hs` -- assuming there isn't a `foo/bar.hs` relative to the working directory. @jkr note the slight revision of what we had before. This was motivated by the idea that one might clone filter repositories into the filters subdirectory; it is nice to be able to run them as `reponame/filtername`.
2016-11-18In --version, trap error in getAppUserDataDirectory.John MacFarlane1-1/+4
This fixes a crash with `pandoc --version` on unusual systems with no real user (e.g. SQL Server 2016). Closes #3241.
2016-11-05Allow `file://` URIs as arguments.John MacFarlane1-0/+4
Also improved default reader format detection. Previously with a URI ending in .md or .markdown, pandoc would assume HTML input. Now it treats these as markdown. Closes #3196.
2016-11-03Improved error if they give wrong arg to --top-level-division.John MacFarlane1-1/+1
2016-10-26Print highlighting-kate version in --version.John MacFarlane1-1/+1
2016-10-24Export Text.Pandoc.Error in Text.Pandoc.John MacFarlane1-1/+0
[API change]
2016-10-24Fixed typo in deprecation warning.John MacFarlane1-1/+1
2016-10-23Allow binary formats to be written to stdout unless tty output.John MacFarlane1-5/+15
Only works on posix. On Windows, pandoc works as before and requires an output file parameter for binary formats. Closes #2677.
2016-10-23Added --list-* options.John MacFarlane1-28/+63
Added `--list-input-formats`, `--list-output-formats`, `--list-extensions`, `--list-highlight-languages`, `--list-highlight-styles`. Removed list of highlighting languages from `--version` output. Removed list of input and output formats from default `--help` output. Closes #3173.
2016-10-19Add option for top-level division typeAlbert Krewinkel1-13/+14
The `--chapters` option is replaced with `--top-level-division` which allows users to specify the type as which top-level headers should be output. Possible values are `section` (the default), `chapter`, or `part`. The formats LaTeX, ConTeXt, and Docbook allow `part` as top-level division, TEI only allows to set the `type` attribute on `div` containers. The writers are altered to respect this option in a sensible way.
2016-09-06Add --parts command line option to LaTeX writer.Oliver Matthews1-0/+9
Add --parts command line argument. This only effects LaTeX writer, and only for non-beamer output formats. It changes the output levels so the top level is 'part', the next 'chapter' and then into sections.
2016-10-11Add reference-location options to executable.Jesse Rosenthal1-0/+17
2016-10-06Replace Google Chart API by CodeCogsKolenCheung1-1/+1
2016-10-03Update KaTeX to v0.6.0KolenCheung1-2/+2
2016-09-30Execute .js filters with nodeJakob Voß1-0/+1
2016-09-27Check `$DATADIR/filters` for filtersJesse Rosenthal1-5/+20
If the `$DATADIR/filters` is present, pandoc will look in it for filters specified without a path, before looking in the $PATH. Note that unlike executables in $PATH, the `filters` dir may contain scripts that are not executable (pandoc will try to execute them using an associated interpreter, if possible). Note: the `filters` dir has priority over the user path. In order of preference, pandoc will look in: 1. a specified full or relative path (executable or non-executable) 2. `$DATADIR/filters` (executable or non-executable) 3. `$PATH` (executable only) This closes #3127.
2016-08-16synchronize spacing of footnotes in help outputWaldir Pimenta1-2/+2
- remove a space between `[` and `*` in the list of input formats, to match the list of output formats - add space after the `*`s, for improved readability
2016-06-20Changed email-obfuscation default to no obfuscation.John MacFarlane1-1/+1
- `writerEmailObfuscation` in `defaultWriterOptions` is now `NoObfuscation` - the default for the command-line `--email-obfuscation` option is now `none`. Closes #2988.
2016-05-12Revert "New method for checking for presence of tex program."John MacFarlane1-6/+2
This reverts commit 285bbf61cf2b21278792e48aee7c25fa0ee62faa.
2016-05-12Revert "Use shell instead of proc to check for latex program."John MacFarlane1-29/+7
This reverts commit ee45be5723ef6001ae333110ce45ae2f7b1b17af.
2016-05-12Revert "Require process >= 1.2.1."John MacFarlane1-1/+6
This reverts commit 07a4320ba97cdd219e5cbb18f21dbbda00bc5543.
2016-05-12Require process >= 1.2.1.John MacFarlane1-6/+1
We need `createProcess_` to be exported.
2016-05-11Added some CSS to handle older versions of process.John MacFarlane1-1/+6
`createProcess_` is in Internals until process 1.2.1.
2016-05-11Use shell instead of proc to check for latex program.John MacFarlane1-7/+24
This should get .bat files on Windows. Closes #2903, with luck.
2016-05-10Made detection of latex program more robust.John MacFarlane1-2/+5
Catch not-found error. Improves on 285bbf61cf2b21278792e48aee7c25fa0ee62faa to fix #2903.
2016-05-09New method for checking for presence of tex program.John MacFarlane1-2/+3
Now instead of using `findExecutable`, which has limitations on Windows, we just do `progname --version` and see if it returns successfully. Closes #2903.
2016-05-09Loading the full MathJax config to maximize loading speedKolenCheung1-1/+1
2016-05-09Change default mathjax setup to use TeX-AMS_CHTML configuration.John MacFarlane1-1/+1
This is designed for cases where the input is always TeX and maximal conformity with TeX is desired. It seems to be smaller and load faster than what we used before. See #2858.
2016-05-09Use new CommonHTML output for MathJax (updated default MathJax URL).John MacFarlane1-1/+1
Closes #2858.
2016-03-22Fixed copyright dates.John MacFarlane1-3/+3
2016-03-21Fix stdin handling for file-scopeJesse Rosenthal1-0/+1
Regardless of input type, we should use default handling if we are dealing with stdin. In other words, there should be no file-scope if there are no files. This was an issue with pandoc json, which could be piped on stdin, but which was read by default with `--file-scope`.
2016-03-15pandoc.hs: Also use filescope for json files.Jesse Rosenthal1-7/+9
JSON files have metadata and list structure, so they can't be simply catted, but they're useful as intermediate build files in large projects.
2016-03-15Introduce file-scope parsing (parse-before-combine)Jesse Rosenthal1-4/+23
Traditionally pandoc operates on multiple files by first concetenating them (around extra line breaks) and then processing the joined file. So it only parses a multi-file document at the document scope. This has the benefit that footnotes and links can be in different files, but it also introduces a couple of difficulties: - it is difficult to join files with footnotes without some sort of preprocessing, which makes it difficult to write academic documents in small pieces. - it makes it impossible to process multiple binary input files, which can't be catted. - it makes it impossible to process files from different input formats. This commit introduces alternative method. Instead of catting the files first, it parses the files first, and then combines the parsed output. This makes it impossible to have links across multiple files, and auto-identified headers won't work correctly if headers in multiple files have the same name. On the other hand, footnotes across multiple files will work correctly and will allow more freedom for input formats. Since ByteStringReaders can currently only read one binary file, and will ignore subsequent files, we also changes the behavior to automatically parse before combining if using the ByteStringReader. If we use one file, it will work as normal. If there is more than one file it will combine them after parsing (assuming that the format is the same). Note that this is intended to be an optional method, defaulting to off. Turn it on with `--file-scope`.
2016-01-19Add TEI Writer.csforste1-0/+2
2016-01-06Improved default template lookup for custom lua scripts.John MacFarlane1-19/+17
Previously, if you tried to do `pandoc -s -t /path/to/lua/script.lua`, pandoc would look for the template in `~/.pandoc/templates/default./path/to/lua/script.lua`. With this change it will look in the more reasonable `~/.pandoc/templates/default.script.lua`. This makes it possible to store default templates for custom writers. Closes #2625.
2016-01-06Revert "Make file globbing work on windows."John MacFarlane1-9/+0
This reverts commit 363ecfebc32c6fe15d81634422e8607847f588fb.