summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
Commit message (Collapse)AuthorAge
...
* 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>
* Added odt readerMarLinn2015-07-23
| | | | | | | | | | | | | | | | | | | | | Fully implemented features: * Paragraphs * Headers * Basic styling * Unordered lists * Ordered lists * External Links * Internal Links * Footnotes, Endnotes * Blockquotes Partly implemented features: * Citations Very basic, but pandoc can't do much more * Tables No headers, no sizing, limited styling
* Use newManager instead of withManager in recent http-client.John MacFarlane2015-07-21
| | | | This avoids a deprecation warning.
* Changed hierarchicalize so it treats references div as top-level header.John MacFarlane2015-07-12
| | | | | | | | | Fixes a bug with `--section-divs`, where the final references section added by pandoc-citeproc, enclosed in its own div, got put in the div for the section previous to it. This fixes #2294. Longer term, we might think about how hierarchicalize should interact with Div elements.
* Added a needed import in Shared.John MacFarlane2015-06-28
|
* Let reference.docx/odt behave as if they are virtual data files.John MacFarlane2015-06-28
| | | | | | | | | | | | | | | Now they are constructed on the fly from their components, but we now allow them to be printed with `--print-default-data-file` and to override the defaults if placed in the user data directory. Shared now exports getDefaultReferenceDocx and getDefaultReferenceODT (API change). These functions have been removed from the Docx and ODT writers. Shared.readDataFile has been modified so that requests to read a reference.odt or reference.docx will use these functions to generate the files.
* Minor fixes to previous commit.John MacFarlane2015-06-28
| | | | | | | | | * Instead of defining readmeFile in Text.Pandoc.Data (which we forgot to export anyway), we simply add a record for "README" to the `dataFiles` lookup table. This allows simplifying some of the code for `readDefaultDataFile` in SHared. * As a bonus, `pandoc --print-default-data-file README` now works.
* New method for producing man pages.John MacFarlane2015-06-28
| | | | | | | | | | | | | | | | | | | | | This change adds `--man1` and `--man5` options to pandoc, so pandoc can generate its own man pages. It removes the old overly complex method of building a separate executable (but not installing it) just to create the man pages. The man pages are no longer automatically created in the build process. The man/ directory has been removed. The man page templates have been moved to data/. New unexported module: Text.Pandoc.ManPages. Text.Pandoc.Data now exports readmeFile, and `readDataFile` knows how to find README. Closes #2190.
* Fixed svg handling in EPUB writer.John MacFarlane2015-05-27
| | | | | | This is a crude workaroud for #2183. A correct fix would require having openURL and fetchItem return a content encoding as well as a content type.
* Updated copyright notices to -2015. Closes #2111.John MacFarlane2015-04-26
|
* Move utility error functions to Text.Pandoc.SharedMatthew Pickering2015-02-18
|
* Make safeRead safe.Matthew Pickering2015-02-18
| | | | Fixes #1801
* Added Text.Pandoc.Compat.Locale to assist with transition to time 1.5.John MacFarlane2014-12-19
|
* fix inDirectory to reset to the original directory in case an exception occursFreiric Barral2014-10-08
|
* Shared: Make collapseFilePath OS-agnosticmpickering2014-09-25
|
* Shared: Moved import of toChunks outside of conditional.John MacFarlane2014-08-31
| | | | Closes #1590.
* Merge branch 'mime' of https://github.com/Aelve/John into Aelve-mimeJohn MacFarlane2014-08-30
|\ | | | | | | | | Conflicts: src/Text/Pandoc/Writers/Docx.hs
| * MIME cleanup.Artyom Kazak2014-08-17
| | | | | | | | | | | | | | * Create a type synonym for MIME type (instead of `String`). * Add `getMimeTypeDef` function. * Avoid recreating MIME type `Map`s every time. * Move “Formula-...” case handling into `getMimeType`.
* | Fixed --self-contained with Windows paths.John MacFarlane2014-08-22
|/ | | | | Previously C:\foo.js was being wrongly interpreted as a URI. Closes #1558.
* Fixed haddock comment.John MacFarlane2014-08-13
|
* Removed unneeded import.John MacFarlane2014-08-13
|
* Shared: Added collapseFilePath functionMatthew Pickering2014-08-08
| | | | This function removes intermediate "." and ".." from a path.
* Add PatternGuards pragmas.Artyom Kazak2014-08-04
|
* Use `stripPrefix` where appropriate.Artyom Kazak2014-08-04
|
* Correctly implement capitalisation.Artyom Kazak2014-08-03
| | | | | | | | Using `map toUpper` to capitalise text is wrong, as e.g. “Straße” should be converted to “STRASSE”, which is 1 character longer. This commit adds a `capitalize` function and replaces 2 identical implementations in different modules (`toCaps` and `capitalize`) with it.
* fetchItem: improved mime type guessing.John MacFarlane2014-08-02
| | | | | Strip a fragment like `?#iefix` from the extension before doing the mime lookup.
* Shared: fetchItem improvements.John MacFarlane2014-08-02
| | | | | | | | | | | | | | * More consistent logic: absolute URIs are fetched from the net; other things are treated as relative URIs if sourceURL is a Just, otherwise as file paths. * We escape characters that are not allowed in URIs before trying to parse them (e.g. '|', which often occurs in the wild). * When treating relative paths as local file paths, we drop any fragment or query. This is useful e.g. when you've downloaded web fonts locally, but your source still contains the original relative URLs. Together with the previous commit, this should close #1477.
* New module, Text.Pandoc.MediaBag.John MacFarlane2014-07-31
| | | | | | | Moved `MediaBag` definition and functions from Shared: `lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`. Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag` is a Monoid.
* Made MediaBag a newtype, and added mime type information to media.John MacFarlane2014-07-31
| | | | | | | | | | Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag`
* Shared: Added function insertMedia which is an alias for M.insertMatthew Pickering2014-07-31
|
* PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.John MacFarlane2014-07-30
| | | | | The MediaBag is thread through from the reader, with no need to extract to files.
* Shared: Added fetchItem', which searches a media bag too.John MacFarlane2014-07-30
|