aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Docx.hs
AgeCommit message (Collapse)AuthorFilesLines
2016-10-03Filter text/para props correctly.Jesse Rosenthal1-2/+2
We only filter on the name, not the prefix.
2016-10-03Add a boolean flag to the setRTL function.Jesse Rosenthal1-5/+5
At the toplevel we don't check to see if RTL is already set.
2016-10-03Test for "dir" metadata.Jesse Rosenthal1-2/+7
2016-10-03Add setRTL and setLTR functions.Jesse Rosenthal1-8/+41
2016-10-03Move more enviroment vars to Reader Monad.Jesse Rosenthal1-62/+52
Things that get pushed and then reset are better in ReaderT, because they can be run with `local`.
2016-10-03Add ReaderT env to the docx writer:Jesse Rosenthal1-8/+17
This will allow us to add text and paragraph properties depending on if rtl is already set or not. (It would probably be cleaner and safer to move the paraprops and textprops to this part of the stack in the future.)
2016-09-02Remove Compat.MonoidJesse Rosenthal1-1/+1
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-08-15Docx Writer: change dynamic style keyJesse Rosenthal1-1/+1
Use "custom-style" instead of "docx-style." This allows it to be used in other formats like ODT in the future.
2016-08-15Docx writer: Inject text properties as well.Jesse Rosenthal1-3/+20
2016-08-15Docx Writer: Keep track of dynamic text props too.Jesse Rosenthal1-0/+3
2016-08-15Docx writer: Allow dynamic styles on spans.Jesse Rosenthal1-1/+5
This enables dynamic styling on spans. It uses the same prefix as we used on divs ("docx-style" for the moment). It does not yet inject the style into styles.xml.
2016-08-15Docx writer: Inject new paragraph propertiesJesse Rosenthal1-4/+23
This injects new dynamic paragraph properties to be into the style file. Nothing occurs if the prop already exists in the style file.
2016-08-15Docx Writer: Have state keep track of dynamic styles.Jesse Rosenthal1-2/+6
We want to be able to inject these into our styles.xml.
2016-08-13Docx Writer: Implement user-defined styles.Jesse Rosenthal1-0/+6
Divs with a "docx-style" key in the attributes will apply the corresponding key to the contained blocks.
2016-07-14Fixed compiler warnings.John MacFarlane1-1/+0
2016-07-14Docx Writer: Use actual creation time as doc propJesse Rosenthal1-4/+3
Previously, we had used the user-supplied date, if available, for Word's document creation metadata. This could lead to weird results, as in cases where the user post-dates a document (so the modification might be prior to the creation). Here we use the actual computer time to set the document creation.
2016-07-01Docx writer: set paragraph to FirstPara after display mathJesse Rosenthal1-0/+1
We treat display math like block quotes, and apply FirstParagraph style to paragraphs that follow them. These can be styled as the user wishes. (But, when the user is using indentation, this allows for paragraphs to continue after display math without indentation.)
2016-03-10 Docx Writer: handle image alt textmb211-2/+2
closes #2754
2016-01-22Changed type of Shared.uniqueIdent argument from [String] to Set String.John MacFarlane1-3/+4
This avoids performance problems in documents with many identically named headers. Closes #2671.
2015-12-12Restore no wrapping of XML in Docx, ODT.John MacFarlane1-1/+1
It's possible that wrapping causes problems; safer to turn it off.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-1/+2
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.
2015-12-01Docx writer: better handling of PDF images.John MacFarlane1-8/+2
Previously we tried to get the image size from the image even if an explicit size was specified. Since we still can't get image size for PDFs, this made it impossible to use PDF images in docx. Now we don't try to get the image size when a size is already explicitly specified.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-13/+11
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.
2015-11-15Docx writer: insert space between footnote ref and footnote.John MacFarlane1-2/+2
This matches Word's default behavior. Closes #2527.
2015-11-09Restored Text.Pandoc.Compat.Monoid.John MacFarlane1-0/+1
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.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-14More changes to avoid compiler warnings on ghc 7.10.John MacFarlane1-2/+1
* CPP around deprecated `parseTime`. * Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time, now exports Data.Time.
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-2/+1
- 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.
2015-09-09Use user data directory for reference docx archive.John MacFarlane1-1/+1
This allows the test suite to work without installing pandoc first. It also brings the docx writer in line with the odt writer.
2015-08-10Docx writer: Moved invalid character stripping to `formattedString`.John MacFarlane1-4/+4
This avoids an inefficient generic traversal. Updates f3aa03e. Closes #2356.
2015-08-07Updated readers, writers and README for link attributemb211-2/+2
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-11/+9
(mb21)
2015-06-28Make sure we use dist version of reference.docx for some things.John MacFarlane1-2/+2
Taking some values from a user-supplied reference.docx tends to lead to corruption. This fixes a regression from the last release. Closes #2249.
2015-06-28Let reference.docx/odt behave as if they are virtual data files.John MacFarlane1-24/+0
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.
2015-05-28Better fix for #2187.John MacFarlane1-11/+36
* Reverted kludgy change to make-windows-installer.bat. * Removed make-reference-fiels.hs. * Moved the individual ingredients of reference.docx and reference.odt to the data directory. * Removed reference.docx and reference.odt from data directory. * We now build the reference archives from their ingredient pieces in the docx and odt writers, instead of having a reference.docx or reference.odt intermediary. This should fix #2187. It also simplifies the bulid procedure. The one thing users may notice is different is that you can no longer get the reference.docx or reference.odt using `--print-default-data-file`. Instead, simply generate a docx or odt using pandoc with a blank or minimal input, and use that (or a customized version) with `--reference-docx` or `--reference-odt`.
2015-05-09Improved warnings when image size can't be determined.John MacFarlane1-2/+5
Closes #1834.
2015-05-09ImageSize: make imageSize return an Either, not a Maybe.John MacFarlane1-2/+4
This will give us better error reporting options. This is part of a fix for #1834.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-14Docx Writer: Take TOC title from toc-title metadata fieldNikolay Yakimov1-1/+15
2015-04-01Added "noProof" to docx syntax highlighting SourceCode style.John MacFarlane1-0/+1
2015-03-30Merge pull request #2035 from lierdakil/issue2031John MacFarlane1-0/+5
Docx Writer/Reference: Add keepNext to objects w/ captions
2015-03-29Merge pull request #2038 from lierdakil/docx-hyphen-settingsJohn MacFarlane1-3/+26
Docx Writer: Copy hyphenation settings from reference.docx
2015-03-29Merge pull request #2037 from lierdakil/issue458John MacFarlane1-1/+29
Docx Writer: support for --toc option
2015-03-29Docx Writer: Filter out illegal XML charactersMatthew Pickering1-2/+19
Fixes #1992
2015-03-29Docx Writer: Place toc after abstract, rather than beforeNikolay Yakimov1-1/+1
2015-03-29Docx Writer: Copy hyphenation settings from reference.docxNikolay Yakimov1-3/+26
2015-03-29Docx Writer: Initial support for --toc option (issue #458)Nikolay Yakimov1-1/+29
Creates a "dirty" TOC at the beginning of document, before abstract
2015-03-29Docx Writer: Add a style to figure imagesNikolay Yakimov1-0/+5
Figures with empty captions use style "Figure" Figures with nonempty captions use style "Figure with Caption", which is based on "Figure", and additionally has keepNext set.
2015-03-08Docx Writer: set firstRow information in tablesNikolay Yakimov1-2/+7