Jesse Rosenthal
1de8d4d087
Docx Reader: Simplify makeHeaderAnchors
...
Using pattern guard, in preparation for doing some more complicated
stuff with it (recording header anchors, so we can change them to auto
ids.)
2014-06-28 04:00:16 -04:00
Jesse Rosenthal
ab76bbebbe
Docx Reader: Clean up guards
...
Use PatternGuards to get rid of need for `isJust`, `fromJust`
altogether.
2014-06-28 04:00:16 -04:00
Jesse Rosenthal
db187348cd
Docx rdr: Avoid mapping makeHeaderAnchors globally
...
It only applies to headers, so we can just apply it when we make a
header.
2014-06-28 04:00:16 -04:00
Jesse Rosenthal
4248f25152
Move Docx reader to DocxContext monad
...
This is a ReaderT State stack, which keeps track of some environment info, such
as the options and the docx doc. The state will come in handy in the future,
for a couple of planned features (rewriting the section anchors as auto_idents,
and hopefully smart-quoting).
2014-06-28 04:00:16 -04:00
John MacFarlane
b1a8f1fa1a
Fixed --filter
so it doesn't search PATH for a filter with a path.
...
This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from
the system path, even if there was a `caps.py` in the working directory.
2014-06-27 18:30:57 -07:00
John MacFarlane
b2127311cb
Require haddock-library >= 1.1 and simplify haddock reader code.
...
See #1346 .
2014-06-26 12:35:13 -07:00
John MacFarlane
9f694619cd
Merge pull request #1374 from jkr/track-changes-options
...
Track changes with options
2014-06-25 23:51:16 -07:00
John MacFarlane
2b958a2d03
Merge pull request #1375 from jkr/cleanup
...
Docx reader: Code cleanup in parse.
2014-06-25 23:50:36 -07:00
Jesse Rosenthal
2396be6f57
Docx reader: Code cleanup in parse.
...
Remove some redundant ways of dealing with Maybe.
2014-06-25 17:12:03 -04:00
Jesse Rosenthal
74676df75f
Fix typo in README.
2014-06-25 16:19:27 -04:00
Jesse Rosenthal
afdc0af779
Track changes tests.
2014-06-25 16:13:59 -04:00
Jesse Rosenthal
58da1cd3bd
Updated README to include "--track-changes" option.
2014-06-25 16:01:52 -04:00
John MacFarlane
e3beae5845
Merge pull request #1372 from jkr/track-changes
...
Rudimentary track-changes support
2014-06-25 12:50:21 -07:00
Jesse Rosenthal
0e9bf37f64
Docx reader: Make use of track-changes option.
2014-06-25 14:17:20 -04:00
Jesse Rosenthal
aa194d387c
Add track changes option to command line.
2014-06-25 14:09:01 -04:00
Jesse Rosenthal
d824f89fb3
Add TrackChanges to Options export.
2014-06-25 14:05:21 -04:00
Jesse Rosenthal
6ff84b5e8d
Add reader option for track changes.
2014-06-25 13:57:56 -04:00
Jesse Rosenthal
3ec62d0064
Add TrackChanges type to options.
2014-06-25 13:50:08 -04:00
Jesse Rosenthal
a2b6ab847c
Docx reader: Add tests for basic track changes
...
This is what seems like the sensible default: read in insertions, and
ignore deletions. In the future, it would be good if options were
available for either taking in deletions or keeping both in some
scriptable format.
2014-06-25 11:09:28 -04:00
Jesse Rosenthal
9614ddfedc
Docx reader: Remove unnecessary filter in Parse.
...
mapMaybe does the filtering for us.
2014-06-25 11:00:15 -04:00
Jesse Rosenthal
ed44e4ca8c
Docx reader: Add rudimentary track changes support.
...
This will only read the insertions, and ignore the deletions.
2014-06-25 10:38:01 -04:00
Jesse Rosenthal
38e1d3e95b
Docx reader: Parse Insertions and Deletions.
...
This is just for the Parse module, reading it into the Docx format. It
still has to be translated into pandoc.
2014-06-25 10:32:48 -04:00
Jesse Rosenthal
c343f1a90b
Docx Reader: Add change types
...
Insertion and deletion. Dates are just strings for now.
2014-06-25 08:10:19 -04:00
John MacFarlane
5ba4760527
Merge pull request #1370 from jkr/fix-zero-indent
...
Docx reader: Ignore zero (or negative) indent
2014-06-24 13:41:19 -07:00
Jesse Rosenthal
69743cd598
Docx reader: Ignore zero (or negative) indent
...
If a block has an indentation less than or equal to zero, it should not be
treated as a block quote.
2014-06-24 15:06:25 -04:00
John MacFarlane
98ca2e512c
Merge pull request #1368 from jkr/docxCode
...
Docx verbatim code formatting
2014-06-24 11:28:51 -07:00
Jesse Rosenthal
a8866bc121
Docx reader: remove T.P.Generic import.
...
This marks the removal of the final tree-walk in the code. (Though there
is still one in the Lists module.)
2014-06-24 12:15:26 -04:00
Jesse Rosenthal
5ae6b8c6f1
Docx reader: pass definition test.
...
This commit also fixes a problem with the previous code pushes, which
wouldn't allow code blocks to share a div.
2014-06-24 12:12:02 -04:00
Jesse Rosenthal
2621482d69
Docx Reader: add failing defintion list tests.
2014-06-24 12:11:57 -04:00
Jesse Rosenthal
bebea5e936
Docx reader: pass code tests.
2014-06-24 10:34:07 -04:00
Jesse Rosenthal
21295c5ab5
Docx reader: add failing tests for inline code and code blocks.
2014-06-24 10:33:49 -04:00
John MacFarlane
fc4e6b3135
Merge pull request #1367 from jkr/reducible-copyright
...
Add copyright block to T.P.R.Docx.Reducible.
2014-06-23 17:31:12 -07:00
Jesse Rosenthal
08633fad33
Add copyright block to T.P.R.Docx.Reducible.
2014-06-23 20:26:08 -04:00
John MacFarlane
ac6756009f
Merge pull request #1366 from jkr/reducible3
...
Docx rewrite and cleanup (in terms of Reducible typeclass)
2014-06-23 14:33:38 -07:00
Jesse Rosenthal
9b954fa855
Add test for correctly trimming spaces in formatting.
...
This used to be fixed in the tree-walking. We need to make sure we're doing it
right now.
2014-06-23 17:08:26 -04:00
Jesse Rosenthal
8517a4f2e5
Add Reducible to cabal file.
2014-06-23 17:08:17 -04:00
Jesse Rosenthal
11b0778744
Use Reducible in docx reader.
...
This cleans up them implementation, and cuts down on tree-walking.
Anecdotally, I've seen about a 3-fold speedup.
2014-06-23 17:08:17 -04:00
Jesse Rosenthal
94d0fb1538
Move some of the clean-up logic into List module.
...
This will allow us to get rid of more general functions we no longer need in
the main reader.
2014-06-23 17:08:17 -04:00
Jesse Rosenthal
ef5fad2698
Add new typeclass, Reducible
...
This defines a typeclass `Reducible` which allows us to "reduce" pandoc
Inlines and Blocks, like so
Emph [Strong [Str "foo", Space]] <++> Strong [Emph [Str "bar"]], Str
"baz"] =
[Strong [Emph [Str "foo", Space, Str "bar"], Space, Str "baz"]]
So adjacent formattings and strings are appropriately grouped.
Another set of operators for `(Reducible a) => (Many a)` are also
included.
2014-06-23 17:08:05 -04:00
John MacFarlane
87ab01637e
LaTeX writer: Use \textquotesingle
for '
in inline code.
...
Otherwise we get curly quotes in the PDF output.
Closes #1364 .
2014-06-23 12:51:10 -07:00
John MacFarlane
e03ed7377c
Markdown reader: Combine consecutive latex environments.
...
This helps when you have two minipages which can't have
blank lines between them.
See #690 , #1196 .
2014-06-23 12:42:27 -07:00
John MacFarlane
cab16024fc
Merge pull request #1363 from jkr/newNormalize
...
Improve normalization
2014-06-21 23:14:03 -07:00
Jesse Rosenthal
ed43513087
Docx reader tests: add tests for normalization deep in blocks.
2014-06-22 01:58:41 -04:00
Jesse Rosenthal
b3df3a3861
Docx reader tests: Correct normalize test.
2014-06-22 01:56:33 -04:00
Jesse Rosenthal
8e5bd9d851
Docx reader: Fix spacing in formatting.
...
The normalizing tests revealed a problem with unformatted spaces, brought about
by `spanTrim`. This fixes by not trimming the spaces out of spans until they
are in their final form.
2014-06-22 01:53:30 -04:00
Jesse Rosenthal
ca4add679c
Add normalization test.
...
Add torture-test for new normalization functions.
One problem that this test demonstrates is that word has a tendency to
turn off formatting at a space, and then turn it back on after. I'm not
sure yet whether this is something we should fix.
2014-06-22 00:46:19 -04:00
Jesse Rosenthal
9c7e0dc84b
Implement new normalization.
...
There were some problems with the old str normalization. This fixes those
problems. Also, since it drills down on its own, it only needs to be
mapped over the blocks, not walked over the tree.
2014-06-22 00:45:18 -04:00
John MacFarlane
08fe16e972
Fixed compiler warnings.
2014-06-21 11:26:43 -07:00
John MacFarlane
f5c8b05a1a
Filters: don't print misleading error message.
...
Previously pandoc would say that a filter was not found,
even in a case where the filter had a syntax error.
2014-06-20 23:08:00 -07:00
John MacFarlane
793bfc81fe
Merge pull request #1361 from jkr/testNormalize
...
Docx reader tests: Introduce NoNormPandoc type.
2014-06-20 16:23:24 -07:00