summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
Commit message (Collapse)AuthorAge
* Allow user to specify User-Agent (#3421)Thenaesh Elango2017-02-05
| | | | | | | | | This commit enables users to specify the User-Agent header used when pandoc requests a document from a URL. This is done by setting an environment variable. For instance, one can do: USER_AGENT="..." ./pandoc -f html -t markdown http://example.com Signed-off-by: Thenaesh Elango <thenaeshelango@gmail.com>
* Shared: rename compactify', compactify'DL -> compactify, compactifyDL.John MacFarlane2017-01-27
|
* Removed Shared.compactify.John MacFarlane2017-01-27
| | | | Changed signatures on Parsing.tableWith and Parsing.gridTableWith.
* Removed writerIgnoreNotes.John MacFarlane2017-01-25
| | | | | | | | | Instead, just temporarily remove notes when generating TOC lists in HTML and Markdown (as we already did in LaTeX). Also export deNote from Text.Pandoc.Shared. API change in Shared and Options.WriterOptions.
* Factored out deNote in Shared.John MacFarlane2017-01-25
|
* Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane2017-01-25
| | | | | Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
* Removed hush from Text.Pandoc.Shared.John MacFarlane2017-01-25
| | | | Not used anywhere.
* Removed `--normalize` option and normalization functions from Shared.John MacFarlane2017-01-25
| | | | | | | | | | | | | * Removed normalize, normalizeInlines, normalizeBlocks from Text.Pandoc.Shared. These shouldn't now be necessary, since normalization is handled automatically by the Builder monoid instance. * Remove `--normalize` command-line option. * Don't use normalize in tests. * A few revisions to readers so they work well without normalize.
* Shared: put err into MonadIO.John MacFarlane2017-01-25
|
* Shared: changed err and warn output.John MacFarlane2017-01-25
| | | | | Don't print program name in either case. Print [warning] for warnings.
* Shared.fetchItem: Better handling of protocol-relative URL.John MacFarlane2016-11-27
| | | | | | | | If URL starts with `//` and there is no "base URL" (as there would be if a URL were used on the command line), then default to http:. Closes #2635.
* Put 'warn' in MonadIO. Add warnings for math conversions in docx.John MacFarlane2016-11-22
|
* Merge pull request #3165 from hubertp-lshift/feature/odt-imageJohn MacFarlane2016-10-18
|\ | | | | [odt] images parser
| * Use bind function instead of pattern matchingHubert Plociniczak2016-10-17
| |
| * Basic support for images in ODT documentsHubert Plociniczak2016-10-12
| | | | | | | | | | Highly influenced by the docx support, refactored some code to avoid DRY.
* | Allow http-client 0.4.30, which is the version in stackage lts.John MacFarlane2016-10-13
| | | | | | | | | | Previously we required 0.5. Remove CPP conditionals for earlier versions.
* | Revert "Remove http-client CPP conditionals."John MacFarlane2016-10-13
| | | | | | | | | | | | | | | | This reverts commit 3f82471355286d33f2d73329c29a51c47bf76ad7. We might want to revert the requirement of http-client 0.5, as this is not yet in Stackage and that is starting to cause problems. I can't recall why it is there.
* | Shared: add function combining lines using LineBreakAlbert Krewinkel2016-10-13
|/ | | | | | | The `linesToBlock` function takes a list of lines and combines them by appending a hard `LineBreak` to each line and concatenating the result, putting the result it into a `Para`. This is most useful when dealing when converting `LineBlock` elements.
* Remove http-client CPP conditionals.Jesse Rosenthal2016-09-03
| | | | | Our lower bound on http-client is 0.5, and both of these min_version tests are less than 0.5, so they will always pass.
* Remove Compat.MonoidJesse Rosenthal2016-09-02
| | | | | This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
* Rename README to MANUAL.txtAlbert Krewinkel2016-07-20
|
* Shared: improve year sanity check in normalizeDateJesse Rosenthal2016-07-14
| | | | | | | | Previously we parsed a list of dates, took the first one, and then tested its year range. That meant that if the first one failed, we returned nothing, regardless of what the others did. Now we test for sanity before running `msum` over the list of Maybe values. Anything failing the test will be Nothing, so will not be a candidate.
* Shared: normalizeDate should reject illegal years.Jesse Rosenthal2016-07-14
| | | | | | | We only allow years between 1601 and 9999, inclusive. The ISO 8601 actually says that years are supposed to start with 1583, but MS Word only allows 1601-9999. This should stop corrupted word files if the date is out of that range, or is parsed incorrectly.
* Shared: Add further formats for `normalizeDate`Jesse Rosenthal2016-07-14
| | | | | | We want to avoid illegal dates -- in particular years with greater than four digits. We attempt to parse series of digits first as `%Y%m%d`, then `%Y%m`, and finally `%Y`.
* Fix warning for parseURl import.John MacFarlane2016-07-03
|
* CPP workaround for deprecation of parseUrl in http-client.John MacFarlane2016-07-03
|
* Shared: Add BlockQuote to blocksToInlinesJesse Rosenthal2016-06-23
|
* Shared: introduce blocksToInlines functionJesse Rosenthal2016-06-23
| | | | | | | | | | This is a lossy function for converting `[Block] -> [Inline]`. Its main use, at the moment, is for docx comments, which can contain arbitrary blocks (except for footnotes), but which will be converted to spans. This is, at the moment, pretty useless for everything but the basic `Para` and `Plain` comments. It can be improved, but the docx reader should probably emit a warning if the comment contains more than this.
* Updated copyright dates to include 2016.John MacFarlane2016-03-22
|
* Make protocol-relative URIs work again.John MacFarlane2016-02-23
| | | | Closes #2737.
* Changed type of Shared.uniqueIdent argument from [String] to Set String.John MacFarlane2016-01-22
| | | | | | | This avoids performance problems in documents with many identically named headers. Closes #2671.
* Use cmark 0.5.John MacFarlane2015-12-29
| | | | Closes #2605.
* Implemented SoftBreak and new `--wrap` option.John MacFarlane2015-12-11
| | | | | | | | | | | | | | | | Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
* Improved fetchItem so that C:/Blah/Blah.jpg isn't treated as URL.John MacFarlane2015-11-24
| | | | | | | | | The Haskell URI parsing routines will accept "C:" as a scheme, so we rule that out manually. This helps with `--self-contained` and absolute Windows paths. See http://stackoverflow.com/questions/33899126/rchart-in-markdown-doesnt-render-due-to-invalidurlexception-from-pandoc
* Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane2015-11-19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
| * Updated readers, writers and README for link attributemb212015-08-07
| |
| * Updated readers and writers for new image attribute parameter.John MacFarlane2015-08-07
| | | | | | | | (mb21)
* | Fixed shadowing error.John MacFarlane2015-11-09
| |
* | Restored Text.Pandoc.Compat.Monoid.John MacFarlane2015-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
* | Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane2015-11-09
| | | | | | | | This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
* | Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane2015-11-08
| | | | | | | | | | | | | | This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
* | Remove compiler warning with embed_data_files.John MacFarlane2015-10-17
| |
* | More changes to avoid compiler warnings on ghc 7.10.John MacFarlane2015-10-14
| | | | | | | | | | | | * CPP around deprecated `parseTime`. * Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time, now exports Data.Time.
* | Use custom Prelude to avoid compiler warnings.John MacFarlane2015-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | - The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
* | Percent-encode more special characters in URLs.John MacFarlane2015-10-11
| | | | | | | | | | | | | | HTML, LaTeX writers adjusted. The special characters are '<','>','|','"','{','}','[',']','^', '`'. Closes #1640, #2377.
* | Move the variable pandocVersion from `src/Text/Pandoc.hs` toAlex Vong2015-10-01
| | | | | | | | | | | | | | | | | | | | | | `src/Text/Pandoc/Shared.hs`, so that all Writers can access this variable without importing `src/Text/Pandoc.hs`, preventing circular import. * pandoc.hs: Import pandocVersion from `Text.Pandoc.Shared`. * src/Text/Pandoc.hs: Remove the definition of pandocVersion and relevant import. * src/Text/Pandoc/Shared.hs: Add the definition of pandocVersion and relevant import.
* | Removed unneeded imports.John MacFarlane2015-09-26
| |
* | MediaBag: ensure that / is always used as path separator.John MacFarlane2015-09-26
| |
* | EPUB TOC: replace literal "<br/>" with space.John MacFarlane2015-08-10
| | | | | | | | Closes #2105.
* | fix build failure with --flags=-httpsSergei Trofimovich2015-07-30
|/ | | | | | | | | | | | | | | | | | | The issue was originally reported by CasperVector as https://github.com/gentoo-haskell/gentoo-haskell/issues/427 Mainfests itself as a builg failure full of missing zip-archive names: src/Text/Pandoc/Shared.hs:756:49: Not in scope: type constructor or class ‘Archive’ src/Text/Pandoc/Shared.hs:777:38: Not in scope: ‘toEntry’ src/Text/Pandoc/Shared.hs:786:19: Not in scope: ‘toArchive’ Perhaps you meant ‘mbArchive’ (line 778) Included Codec.Archive.Zip unconditionally. Signed-off-by: Sergei Trofimovich <siarheit@google.com>