summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx
Commit message (Collapse)AuthorAge
* Docx Reader: parse `moveTo` and `moveFrom`Jesse Rosenthal2016-04-15
| | | | | | | | `moveTo` and `moveFrom` are track-changes tags that are used when a block of text is moved in the document. We now recognize these tags and treat them the same as `insert` and `delete`, respectively. So, `--track-changes=accept` will show the moved version, while `--track-changes=reject` will show the original version.
* Docx reader: Handle alternate contentJesse Rosenthal2016-03-18
| | | | | | | | | | | | Some word functions -- especially graphics -- give various choices for content so there can be backwards compatibility. This follows the largely undocumented feature by working through the choices until we find one that works. Note that we had to split out the processing of child elems of runs into a separate function so we can recurse properly. Any processing of an element *within* a run (other than a plain run) should go into `childElemToRun`.
* Docx reader: Don't make numbered heads into lists.Jesse Rosenthal2016-03-16
| | | | | Word uses list numbering styles to number its headings. We only call something a numbered list if it does not also heave a heading style.
* Docx Reader: Add state to the parser, for warningsJesse Rosenthal2016-03-12
| | | | | | | | In order to be able to collect warnings during parsing, we add a state monad transformer to the D monad. At the moment, this only includes a list of warning strings (nothing currently triggers them, however). We use StateT instead of WriterT to correspond more closely with the warnings behavior in T.P.Parsing.
* Docx Reader: Get rid of Modifiable typeclass.Jesse Rosenthal2016-02-26
| | | | | | | | The docx reader used to use a Modifiable typeclass to combine both Blocks and Inlines. But all the work was in the inlines. So most of the generality was wasted, at the expense of making the code harder to understand. This gets rid of the generality, and adds functions for Blocks and Inlines. It should be a bit easier to work with going forward.
* Docx reader: Add a "Link" modifier to ReducibleJesse Rosenthal2016-02-02
| | | | | | | We want to make sure that links have their spaces removed, and are appropriately smushed together. This closes #2689
* Docx reader: image attributesmb212015-12-13
|
* Docx Reader: Remove DummyListItem typeJesse Rosenthal2015-11-23
| | | | | | | | | | | | | Change 5527465c introduced a `DummyListItem` type in Docx/Parse.hs. In retrospect, this seems like it mixes parsing and iterpretation excessively. What's *really* going on is that we have a list item without and associate level or numeric info. We can decide what to do what that in Docx.hs (treat it like a list paragraph), but the parser shouldn't make that decision. This commit makes what is going on a bit more explicit. `LevelInfo` is now a Maybe value in the `ListItem` type. If it's a Nothing, we treat it as a ListParagraph. If it's a Just, it's a normal list item.
* Docx reader: Clean up commented-out functionJesse Rosenthal2015-11-18
| | | | | A residue of a recent change was left around in the form of a commented-out function. Let's clean that up.
* Docx reader: Handle dummy list items.Jesse Rosenthal2015-11-18
| | | | | | | | | | | | These come up when people create a list item and then delete the bullet. It doesn't refer to any real list item, and we used to ignore it. We handle it with a DummyListItem type, which, in Docx.hs, is turned into a normal paragraph with a "ListParagraph" class. If it follow another list item, it is folded as another paragraph into that item. If it doesn't, it's just its own (usually indented, and therefore block-quoted) paragraph.
* Follow relationships correctly in foot/endnotes.Jesse Rosenthal2015-11-14
| | | | | | There are separate relationship (link) files for foot and endnotes. These had previously been grouped together which led to links not working correctly in notes. This should finally fix that.
* 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.
* 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.
* Docx Reader: Parse soft, no-break hyphen elementsOphir Lifshitz2015-10-04
|
* Docx Writer: Fix StyleMapNikolay Yakimov2015-03-24
| | | | | I've messed up badly with it, so it didn't work properly most of the time. At the plus side, fallback mechanic is working wonderfully.
* Code cleanupNikolay Yakimov2015-03-03
|
* Started moving StyleMap out of writer codeNikolay Yakimov2015-03-01
|
* Docx reader: Allow numbering in the style file.Jesse Rosenthal2015-02-19
| | | | | | | | | | | | | | This allows inherited styles with numbering (lists). It works like this: 1. check to see if the style has numbering info. 2. if the paragraph has explicit numbering info in the doc that takes precedence. 3. if not we use the numbering info in the style, if it's there. 4. otherwise normal paragraph. We no longer assume it's not a numbering element if it doesn't have an explicit level---we just set that level to 1. (In the style files, the examples I've seen don't have that explicit level.)
* Docx: Parse images in deprecated vml format.Jesse Rosenthal2015-01-21
| | | | | | | | | | Some older versions of word use vml (vector markup language) and put their images in a "v:imagedata" tag inside a "w:pict". We read those as we read the more modern "blip" inside a "w:drawing". Note that this does not mean the reader knows anything about vml. It just looks for a `v:imagdata`. It's possible that, with more complicated uses of images in vml, it won't do the right thing.
* Account for external link URLs with anchorsCaleb McDaniel2014-11-13
| | | | | | | | | Previously, if a URL had an anchor, such as http://johnmacfarlane.net/pandoc/README.html#synopsis the reader would incorrectly identify it as an internal link and return "#synopsis" for the link in output.
* Docx reader: fix for Issue #1692 (i18n styles)Nikolay Yakimov2014-10-25
| | | | | | | | This patch builds paragraph styles tree, then checks if paragraph has style.styleId or style/name.val matching predetermined patterns. Works with "Heading#" (name.val="heading #") for headings and "Quote"|"BlockQuote"|"BlockQuotation" (name.val="Quote"|"Block Text") for block quotes.
* Merge pull request #1601 from jkr/windowsfixJohn MacFarlane2014-09-27
|\ | | | | Fix path-slashes inside archive for windows
| * Docx reader: Fix window path for image lookup.Jesse Rosenthal2014-09-02
| | | | | | | | | | Don't use os-sensitive "combine", since we always want the paths in our zip-archive to use forward-slashes.
* | Docx reader: Single-item headers in ordered lists are headers.Jesse Rosenthal2014-09-04
|/ | | | | When users number their headers, Word understands that as a single item enumerated list. We make the assumption that such a list is, in fact, a header.
* Docx Parse: build a bottom-up style tree.Jesse Rosenthal2014-08-17
| | | | | | | | Two points here: (1) We're going bottom-up, from styles not based on anything, to avoid circular dependencies or any other sort of maliciousness/incompetence. And (2) each style points to its parent. That way, we don't need the whole tree to pass a style over to Docx.hs
* Alias string and runStyle to CharStyle type.Jesse Rosenthal2014-08-17
|
* Docx Style parser: Basic one now just takes a parent style.Jesse Rosenthal2014-08-17
| | | | | This will make it easier to build the style map from the bottom up (to avoid any infinite references).
* Parser: Framework for parsing styles.Jesse Rosenthal2014-08-17
| | | | | | We want to be able to read user-defined styles. Eventually we'll be able to figure out styles in terms of inheritance as well. The actual cascading will happen in the docx reader.
* Docx reader: Change behavior of Super/SubscriptJesse Rosenthal2014-08-17
| | | | | | | | | | | In docx, super- and subscript are attributes of Vertalign. It makes more sense to follow this, and have different possible values of Vertalign in runStyle. This is mainly a preparatory step for real style parsing, since it can distinguish between vertical align being explicitly turned off and it not being set. In addition, it makes parsing a bit clearer, and makes sure we don't do docx-impossible things like being simultaneously super and sub.
* Rewrite Docx.hs and Reducible to use Builder.Jesse Rosenthal2014-08-16
| | | | | | | | | | The big news here is a rewrite of Docx to use the builder functions. As opposed to previous attempts, we now see a significant speedup -- times are cut in half (or more) in a few informal tests. Reducible has also been rewritten. It can doubtless be simplified and clarified further. We can consider this, at the moment, a reference for correct behavior.
* Docx: Reducible forgot about smallcapsJesse Rosenthal2014-08-13
|
* Docx reader: accept explicit "Italic" and "Bold" rStyles.Jesse Rosenthal2014-08-12
| | | | | | | | Note that "Italic" can be on, and, from the last commit, `<w:i>` can be present, but be turned off. In that case, the turned-off tag takes precedence. So, we have to distinguish between something being off and something not being there. Hence, isItalic, isBold, isStrike, and isSmallCaps have become Maybes.
* Docx Reader: Fix font style parsing.Jesse Rosenthal2014-08-12
| | | | | Before we just checked for the existence of a tag. Now, we make sure to check for its on/off value.
* Docx reader: move combining logic to ReducibleJesse Rosenthal2014-08-12
| | | | | | | | | | | | Introduces a new function in Reducibles, concatR. The idea is that if we have two list of Reducibles (blocks or inlines), we can combine them and just perform the reduction on the joining parts (the last element of the first list, the first element of the second list). This is useful in cases where the two lists are already reduced, and we're only worried about the joining elements. This actually improves the efficiency a bit further, because concatR can be smart about empty lists.
* Add dropCap to paragraph style.Jesse Rosenthal2014-08-11
|
* Docx reader: handle empty reducibles.Jesse Rosenthal2014-08-11
|
* Docx Parse: Improved font recognition when specified in rFonts elementMatthew Pickering2014-08-11
|
* Docx Fonts: Derives Show and EqMatthew Pickering2014-08-11
|
* Merge pull request #1510 from jkr/spacefixJohn MacFarlane2014-08-10
|\ | | | | Docx reader: Fix spacing issue.
| * Change head/tail to pattern guards.Jesse Rosenthal2014-08-10
| |
| * Docx reader: Fix spacing issue.Jesse Rosenthal2014-08-09
| | | | | | | | | | Previously spaces at the beginning of Emph/Strong/etc were kept inside. This makes sure they are moved out.
* | Removed OMath module, depend on texmath >= 0.8.John MacFarlane2014-08-10
| |
* | Docx Parse: Recognises code points in sym elements which are in the private ↵Matthew Pickering2014-08-09
| | | | | | | | range
* | Added Text.Pandoc.Readers.Docx.FontsMatthew Pickering2014-08-09
| |
* | Docx Reader: Added recognition of sym element in paragraphsMatthew Pickering2014-08-09
|/
* OMath parser: Change signature of exported function.Jesse Rosenthal2014-08-08
| | | | | | | | | | | | This changes the signature of the exported `readOMML` to `String -> Either String [Exp]`, so it can now, in theory, be slotted into TeXMath. It doesn't have any real error reporting yet, but that might make more sense once I put it in a branch, and understand how it works in the other readers. It also now reads strings that parse to either oMath or oMathPara elements. Note that the distinction is lost in the output. It's up to the caller to remember the display type.
* OMath: Finish initial cleanup.Jesse Rosenthal2014-08-08
| | | | | This gets rid of commented-out functions, cleans up whitespace errors, and exports and imports the correct functions.
* OMath: Remove NamespacesJesse Rosenthal2014-08-08
| | | | | | We still need to test against prefixes, but this is only going to look at oMath fragments, so we're not going to be worried about looking up the real namespace.
* OMath: Start phasing out internal OMath type.Jesse Rosenthal2014-08-08
| | | | | This is the first step in removing the intermediate OMath type, which we no longer need since we're writing straight to TeXMath Exp.