aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Docx.hs
AgeCommit message (Collapse)AuthorFilesLines
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
2015-03-03Code cleanupNikolay Yakimov1-14/+10
2015-03-01Started moving StyleMap out of writer codeNikolay Yakimov1-46/+25
2015-03-01Update Docx writer for 1cb601d reference.docxNikolay Yakimov1-13/+14
2015-02-24Comment out unused functions to make CI happyNikolay Yakimov1-8/+8
2015-02-24Treat some ambiguous styles as custom for nowNikolay Yakimov1-11/+10
* Author * Abstract * Compact * ImageCaption * TableCaption * DefinitionTerm * Definition * FirstParagraph
2015-02-23Do not lookup custom stylesNikolay Yakimov1-9/+13
2015-02-23Also skip SourceCode style if existsNikolay Yakimov1-9/+12
2015-02-22If --no-highlight is set, remove *Tok styles.Nikolay Yakimov1-2/+10
2015-02-22Prototype fix for #1872Nikolay Yakimov1-4/+7
2015-02-21Initial stab at more involved fix for #1607Nikolay Yakimov1-64/+86
This patch attempts to build a style name -> style id mapping based on styles.xml from reference doc, and changes pStyle and rStyle to accept style name as a parameter instead of styleId. There is a fallback mechanic that removes spaces from style name and returns it as style id, but it likely won't help much. Style names are matched lower-case, since headings and `footnote text` have lowercase names.
2015-02-12Docx writer: Add footnotes id -1 and 0.Jesse Rosenthal1-1/+17
Word uses, by default, footnotes with id -1 and 0 for separators. If a user modifies reference.docx, they will end up with a settings.xml file that references these footnotes, but no such footnotes in the document. This will produce a corruption error. Here we add these to the document and settings.xml file, so future modifications won't break the file.
2015-02-11Docx Writer: Add "BodyText" StyleJesse Rosenthal1-9/+11
We apply a "BodyText" style to all unstyled paragraphs. This is, essentially, the same as "Normal" up until now -- except that since not everything inherits from "BodyText" (the metadata won't, for example, or the headers or footnote numbers) we can change the text in the body without having to make exceptions for everything. This will still inherit from Normal, so if we want to change *everything*, we can do it through "Normal".
2015-02-10Docx Writer: Use FirstParagraph style at beginning.Jesse Rosenthal1-1/+1
Before we had used `FirstParagraph` style after Headings, BlockQuotes, and other blocks a user might not want an indentation after. We hadn't actually used it for the first paragraph -- i.e. the opening of the body. This makes sure the first body paragraph gets that style.
2015-02-09Docx Writer: Implement FirstParagraph StyleJesse Rosenthal1-15/+39
Following the odt writer, we make the first text paragraph following an image, blockquote, table, or heading into a "FirstParagraph" style. This allows it to be styled differently, if the user wishes. The default is for it to be the same as "Normal"
2014-12-19Added Text.Pandoc.Compat.Locale to assist with transition to time 1.5.John MacFarlane1-3/+3
2014-12-08Fix for #1641 (docx table captions above tables)Nikolay Yakimov1-2/+3
Word doesn't really treat table captions as something special. It's just a paragraph with special style, nothing more, so simple reversal of output order in writer works fine.
2014-10-24Docx Writer: Partial fix for #1607Nikolay Yakimov1-7/+35
International heading styles are inferred based on `<w:name val="heading #">` fallback, if there are no en-US "Heading#" styles