aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Docx.hs
AgeCommit message (Collapse)AuthorFilesLines
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
2014-10-21DOCX writer: Look in user data dir for archive reference.docx.John MacFarlane1-1/+1
2014-10-05Getting the page width from the reference fileGrégory Bataille1-17/+36
Uses it to scale images that are too large. When there is no reference files, default to a US letter portrait size to scale the images
2014-09-11Docx writer: Renumber header and footer relationships to avoid collisions.Jesse Rosenthal1-12/+56
We previously took the old relationship names of the headers and footer in secptr. That led to collisions. We now make a map of availabl names in the relationships file, and then rename in secptr.
2014-08-30Merge branch 'mime' of https://github.com/Aelve/John into Aelve-mimeJohn MacFarlane1-8/+8
Conflicts: src/Text/Pandoc/Writers/Docx.hs
2014-08-26Docx writer: Accomodate GHC 7.4 (no lookupEnv)Jesse Rosenthal1-1/+1
2014-08-25Docx writer: Default to user login and time of change if not given.Jesse Rosenthal1-6/+21
2014-08-25Docx writer: Implement track changes.Jesse Rosenthal1-9/+40
These have default authors and dates of "unknown" and timestamp-zero, respectively.
2014-08-24Hlint changes to Docx writer.John MacFarlane1-22/+19
2014-08-23Docx writer: Bibliography entries get Bibliography style.John MacFarlane1-2/+6
Closes #1559.
2014-08-17Merge pull request #1536 from considerate/masterJohn MacFarlane1-0/+3
Add row width to tables in Docx XML
2014-08-17Docx writer: Fixed regression, bungled list numbering.John MacFarlane1-3/+10
In pandoc 1.13, all lists come out as basic ordered lists. This fixes that bad regression. Closes #1544.
2014-08-17MIME cleanup.Artyom Kazak1-8/+8
* 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`.
2014-08-17Simplify row width calculation.Viktor Kronvall1-2/+2
2014-08-17Include row width in table rows.Christoffer Ackelman1-0/+3
Added a property to all table rows where the sum of column widths is specified in pct (fraction of 5000).
2014-08-11Merge pull request #1365 from gbataille/docx-marginJohn MacFarlane1-1/+9
Scale images to fit the page for DOCX
2014-08-04Use texmath 0.7 interface.John MacFarlane1-2/+2
2014-07-30PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.John MacFarlane1-1/+2
The MediaBag is thread through from the reader, with no need to extract to files.
2014-07-29Docx writer: Print subtitle from metadata if present.John MacFarlane1-3/+9
Use Subtitle style. See #1451.
2014-07-26Docx writer: Added missing case from last commit.John MacFarlane1-1/+1
2014-07-26Docx writer: include abstract with Abstract style.John MacFarlane1-1/+8
Addresses docx part of #1451.
2014-07-19Renamed readTeXMath' to avoid name conflict with texmath 0.6.7Matthew Pickering1-1/+1
Also removed deprecated readTeXMath.
2014-06-29Docx writer: insert bookmark tags inside <w:p> tag.Jesse Rosenthal1-3/+6
This makes the header anchors in pandoc-generated ooxml match those generated by word.
2014-06-23Scale images to fit the page for DOCXGrégory Bataille1-1/+9
Images that are bigger than the page were truncated. This will now scale them if they are larger than the page. The scale is currently hardcoded with Word "letter" defaults (page size and margins)
2014-06-19Docx writer: Use Compact style for empty table cells.John MacFarlane1-1/+3
Otherwise we get overly tall lines when there are empty table cells and the other cells are compact. Closes #1353.
2014-06-03Docx writer: Section numbering carries over from reference.docx.John MacFarlane1-1/+6
Closes #1305.
2014-06-03Docx writer: Combine reference.docx numbering with pandoc's.John MacFarlane1-6/+6
This should have fixed #1305, allowing the reference.docx to define section numbering, but it doesn't. Now the headings appear with proper indentation, but the numbers don't appear. Unclear why. styles.xml and numbering.xml basically match the docx which has the expected result.
2014-06-03Docx writer: pandoc uses only numIds >= 1000 for lists.John MacFarlane1-3/+8
This opens up the possiblity (with further code changes) of preserving some numbering from the reference.docx (e.g. header numbering.) See #1305.
2014-06-03Docx writer: Changed abstractNumId numbering scheme.John MacFarlane1-3/+3
Now the minimum id used by pandoc is 990. All ids start with "99". This gives some room for a reference.docx to define numbering styles. Note: this is not yet possible, since pandoc generates numbering.xml entirely on its own.
2014-06-03Docx writer: Simplified abstractNumId numbering.John MacFarlane1-19/+30
Instead of sequential numbering, we assign numbers based on the list marker styles. This simplifies some of the code and should make it easier to modify numbering in the future.
2014-06-02Docx writer: Create overrides per-image for media/ in ref docx.John MacFarlane1-13/+8
This should be somewhat more robust and cover more types of images.
2014-06-02Docx writer: Improved entryFromArchive to avoid parse.John MacFarlane1-2/+3
No need to parse the XML if we're just going to render it right away!
2014-06-02Docx writer: Make images work in reference.docx headers/footers.John MacFarlane1-8/+20
* All media from reference.docx are copied into result. * Added defaults for common image types to [Content Types]. * Avoided redundant XML parse + write for entries taken over from reference.docx, for better performance.
2014-06-01Docx writer: Improved handling of headers/footers.John MacFarlane1-52/+53
2014-06-01Docx writer: Header and footer are now carried over from reference.docx.John MacFarlane1-16/+38
2014-06-01Minor code reformat.John MacFarlane1-5/+5
2014-05-31Docx writer: Take over document formatting from reference.docx.John MacFarlane1-17/+30
This includes margins, page size, page orientation.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-05-04Docx writer: Fall back on distribution reference.docx.John MacFarlane1-14/+15
* Undid changes to parseXml in last commit. * Instead of a string fallback, we have parseXml fall back on the reference.docx that comes with pandoc if the user's reference.docx does not contain a needed file. * Closes #1185.
2014-05-04Docx writer: Added ability to give fallback in parseXml.John MacFarlane1-16/+17
2014-01-07Fixed small regression in docx writer.John MacFarlane1-3/+6