Age | Commit message (Collapse) | Author | Files | Lines |
|
These work with a State monad and a Reader monad to produce
deterministic results. It can probably be simplified somewhat.
|
|
Using Text.Pandoc.Free, introduce pure versions of Docx, EPUB, ICML, and
ODT writers. Each of the pure versions is exported along with the IO
version (produced by running `runIO` on the pure reader). Ideally, this
should make the writers easier to test.
|
|
Update all writers to take into account page breaks.
A straightforwad, far from complete, implementation of page
breaks in selected writers.
Readers will have to follow in the future as well.
|
|
So far this just reproduces capacity.
Later we'll be able to add features like warning
messages, dynamic loading of xml syntax definitions,
and dynamic loading of themes.
|
|
|
|
|
|
Closes #3238.
Previously the Compact style wasn't being applied properly
to empty cells.
|
|
We already handled alt text. This just puts the image "title" into the
docx "title" attr.
|
|
The following markup features are used to output the lines of the `LineBlock`
element:
- AsciiDoc: a `[verse]` block,
- ConTeXt: text surrounded by `\startlines` and `\endlines`,
- HTML: `div` with an per-element style setting to interpret the content as
pre-wrapped,
- Markdown: line blocks if the `line_blocks` extension is enabled, a simple
paragraph with hard linebreaks otherwise,
- Org: VERSE block,
- RST: a line block, and
- all other formats: a paragraph, containing hard linebreaks between lines.
Custom lua writers should be updated to use the `LineBlock` element.
|
|
PrintWidth is set at the beginning and stays the same throughout the
document writing, so we just set it as an env variable in the Reader
monad.
|
|
More meaningful variable name, and explanatory comment.
|
|
Now RTL is turned and off by a general function, `withDirection`
wrapping `inlineToOpenXML` and `blockToOpenXML`. This acts according to
the `envRTL` variable. This means we can just set the environment at the
outset, and change the environment with `local` as need be.
Note that this requires making the `inlineToOpenXML` and
`blockToOpenXML` functions into wrappers around
primed-versions (`{inline,block}ToOpenXML`) where the real work takes
place.
|
|
In general, we want things that are either:
1. unchanging environment variables, or
2. environment variables that will change for a the scope of
a function and then pop back
to be in the reader monad. This is safer for (1), since we won't
accidentally change it, and easier for (2), since we can use `local`
instad of setting the old value and then resetting.
We keep the StateT monad for values that we will want to accumulate or
change and then use later.
|
|
A few commented out functions were left in the code during the
conversion from StateT to ReaderT. This removes them.
|
|
We had to use this because we set the env, which means that setRTL
wouldn't do anything at the top level. We now don't set the env (it will
always be false at the outset), which means the toplevel setRTL will
work if necessary.
|
|
We only filter on the name, not the prefix.
|
|
At the toplevel we don't check to see if RTL is already set.
|
|
|
|
|
|
Things that get pushed and then reset are better in ReaderT, because
they can be run with `local`.
|
|
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.)
|
|
This was only necessary for GHC versions with base below 4.5
(i.e., ghc < 7.4).
|
|
Use "custom-style" instead of "docx-style." This allows it to be used in
other formats like ODT in the future.
|
|
|
|
|
|
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.
|
|
This injects new dynamic paragraph properties to be into the style
file. Nothing occurs if the prop already exists in the style file.
|
|
We want to be able to inject these into our styles.xml.
|
|
Divs with a "docx-style" key in the attributes will apply the
corresponding key to the contained blocks.
|
|
|
|
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.
|
|
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.)
|
|
closes #2754
|
|
This avoids performance problems in documents with many identically
named headers.
Closes #2671.
|
|
It's possible that wrapping causes problems; safer to
turn it off.
|
|
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.
|
|
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.
|
|
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.
|
|
This matches Word's default behavior. Closes #2527.
|
|
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.
|
|
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
|
|
This is needed for ghci to work with pandoc, given that we
now use a custom prelude.
Closes #2503.
|
|
* CPP around deprecated `parseTime`.
* Text.Pandoc.Compat.Locale -> Text.Pandoc.Compat.Time,
now exports Data.Time.
|
|
- 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.
|
|
This allows the test suite to work without installing pandoc first.
It also brings the docx writer in line with the odt writer.
|
|
This avoids an inefficient generic traversal.
Updates f3aa03e.
Closes #2356.
|
|
|
|
(mb21)
|
|
Taking some values from a user-supplied reference.docx
tends to lead to corruption.
This fixes a regression from the last release. Closes #2249.
|
|
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.
|