summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
Commit message (Collapse)AuthorAge
* Moved extractSpaces to Shared.hsmpickering2014-06-16
| | | | | Generalised and move the extractSpaces function from `HTML.hs` to `Shared.hs` so that the docx reader can also use it.
* Shared: Added ordNub.John MacFarlane2014-06-03
| | | | API change (adds export).
* Removed dependency on conduit.John MacFarlane2014-05-18
| | | | | * http-conduit flag is now https. * Instead of http-conduit, we depend on http-client and http-client-tls.
* Shared addMetaField: if old and new values both lists, concatenate.John MacFarlane2014-05-12
|
* Update copyright notices for 2014, add missing noticesAlbert Krewinkel2014-05-09
|
* Merge pull request #1256 from tarleb/org-reader-improvementsJohn MacFarlane2014-04-19
|\ | | | | Org reader improvements
| * Move `compactify'DL` from Markdown reader into SharedAlbert Krewinkel2014-04-19
| | | | | | | | | | | | The function `compactify'DL`, used to change the final definition item of a definition list into a `Plain` iff all other items are `Plain`s as well, is useful in many parsers and hence moved into Text.Pandoc.Shared.
* | Shared: Fixed bug in toRomanNumeral.John MacFarlane2014-04-15
|/ | | | | 9 and numbers ending in 9 would end with "IXIV." Thanks to Jesse Rosenthal. Closes #1249.
* Shared.openURL: Set proxy with value of http_proxy env variable.John MacFarlane2014-04-05
| | | | | | | Note: proxies with non-root paths are not supported, because of limitations in http-conduit. Closes #1211.
* fetchItem: Handle image URLs beginning with '//'.John MacFarlane2014-01-08
|
* HLint: use `elem` and `notElem`Henry de Valence2013-12-19
| | | | Replaces long conditional chains with calls to `elem` and `notElem`.
* HLint: Use allHenry de Valence2013-12-19
| | | | Replace `and . map` with `all`.
* Added `withSocketsDo` around http conduit code in `openURL`.John MacFarlane2013-12-09
| | | | | This should address #1080, but further testing on Windows is needed before we can close the bug.
* normalizeDate: Allow dates with year only (%Y)Shaun Attfield2013-12-01
|
* Shared: Fixed bug in openURL with data: URIs.John MacFarlane2013-11-19
| | | | | | | Previously the base-64 encoded bytestring was returned. We now decode it so it's a proper image! This should fix parsing of data: URLs.
* Use isURI instead of isAbsoluteURI.John MacFarlane2013-10-16
| | | | It allows fragments identifiers.
* Generalized type of stringify.John MacFarlane2013-08-28
|
* Shared: Changed stringify so it ignores notes.John MacFarlane2013-08-16
| | | | Also documented this in README.
* Revert "Shared: stringify now skips over footnotes."John MacFarlane2013-08-16
| | | | | | | This reverts commit 19591df739a6c50a3d0a9af55ba90b883264b21d. This change didn't work; query has already written the contents of the note by the time it gets to Note.
* Shared: stringify now skips over footnotes.John MacFarlane2013-08-16
| | | | That is usually the right thing to do for section labels, etc.
* Shared: Better error message when default data file not found.John MacFarlane2013-08-15
| | | | | | Listing the full path can confuse people who are using `--self-contained`: they might have intended the file to be found locally. So now we just list the data file name.
* Options: Changed `writerSourceDir` to `writerSourceURL` (now a Maybe).John MacFarlane2013-08-11
| | | | | | | | | | | | | | | | | | | | | | | Previously we used to store the directory of the first input file, even if it was local, and used this as a base directory for finding images in ODT, EPUB, Docx, and PDF. This has been confusing to many users. It seems better to look for images relative to the current working directory, even if the first file argument is in another directory. writerSourceURL is set to 'Just url' when the first command-line argument is an absolute URL. (So, relative links will be resolved in relation to the first page.) Otherwise, 'Nothing'. The ODT, EPUB, Docx, and PDF writers have been modified accordingly. Note that this change may break some existing workflows. If you have been assuming that relative links will be interpreted relative to the directory of the first file argument, you'll need to make that the current directory before running pandoc. Closes #942.
* Use walk, walkM in place of bottomUp, bottomUpM when possible.John MacFarlane2013-08-10
| | | | They are significantly faster.
* Use query instead of queryWith.John MacFarlane2013-08-10
|
* Fixed compilation with http-conduit flag False.John MacFarlane2013-07-30
|
* Improved fetching of external resources.John MacFarlane2013-07-18
| | | | | | | | | * In Shared, openURL and fetchItem now return an Either, for better error handling. (API change.) * Better error message when fetching a URL fails with `--self-contained`. * EPUB writer: If resource not found, skip it, as in Docx writer. * Closes #916.
* cabal: Added http-conduit flag, which allows fetching https resources.John MacFarlane2013-07-04
| | | | | | | It also brings in a large number of dependencies (http-conduit and its dependencies), which is why for now it is an optional flag. Closes #820.
* Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane2013-07-01
| | | | | | | * Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified.
* Shared: Export getField.John MacFarlane2013-07-01
|
* Metadata changes: Variables now completely shadow metadata.John MacFarlane2013-06-29
| | | | | | | | | Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list.
* Shared: Added `defField`.John MacFarlane2013-06-27
| | | | | `defField` is like `setField`, but does nothing if the field already has a value.
* Fixed merge bugs in Shared.John MacFarlane2013-06-25
|
* Removed 'Functor' constraint.John MacFarlane2013-06-25
|
* Use new flexible metadata type.John MacFarlane2013-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | * Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
* Shared.openURL: Properly handle data: URIs.John MacFarlane2013-05-28
|
* Less verbose output from --self-contained.John MacFarlane2013-05-04
| | | | | Now one gets "Fetching [URL]..." for each URL fetched, but not the full header.
* Shared.openURL: Print diagnostic output to stderr, not stdout.John MacFarlane2013-05-01
|
* Shared.openURL: URL-escape pipe characters.John MacFarlane2013-04-28
| | | | | | | Even though these are legal, Network.URI doesn't regard them as legal in URLs. So we escape them first. Closes #535.
* Shared: Fixed readDefaultDataFile so it works on Windows.John MacFarlane2013-04-20
|
* Revert "Improved previous patch so it really solves the Windows issue."John MacFarlane2013-04-20
| | | | This reverts commit e80116c813ecfc8cde094cddd36a3b083c108fd8.
* Improved previous patch so it really solves the Windows issue.John MacFarlane2013-04-19
|
* Shared: readDefaultDataFile: normalize the paths.John MacFarlane2013-04-19
| | | | | | | | This fixes bugs in `--self-contained` on pandoc compiled with `embed_data_files`. The bugs affect (a) paths containing `..`, (b) Windows, where `\` is path separator. Closes #833.
* Shared: openURL now follows redirects.John MacFarlane2013-03-26
| | | | Closes #701.
* hierarchicalize: Do not number section with class "unnumbered".John MacFarlane2013-02-13
| | | | | | | | | | | Unnumbered sections get [] for their section number. So far only the HTML writer has been adjusted to be sensitive to this. If we keep this change, all the writers will need to be changed either (a) to directly check for the "unnumbered" class, if they do section numbering themselves, or (b) to check for a null section number, if they use hierarchicalize.
* Shared: Changed type of Element.John MacFarlane2013-02-12
| | | | | | | Sec now includes a field for Attr rather than just String (the identifier). Note, this is an API change.
* Added Text.Pandoc.Data (non-exported) if embed_data_files selected.John MacFarlane2013-01-23
| | | | | This module just exports the association list of embedded data files, which is used by Shared.
* Refactoring:John MacFarlane2013-01-11
| | | | | | | * Shared now exports fetchItem (instead of getItem) and openURL * fetchItem has different parameters than getItem and includes some logic formerly in the ODT and Docx writers * getItem still used in SelfContained
* Move getItem from SelfContained to Share; export getItem.John MacFarlane2013-01-11
|
* Added Attr field to Header.John MacFarlane2013-01-09
| | | | | | | | | | Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers.
* Shared: export isTightList.John MacFarlane2013-01-07
|