aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/OpenDocument.hs
AgeCommit message (Collapse)AuthorFilesLines
2016-11-26[odt] Infer table's caption from the paragraph (#3224)hubertp-lshift1-1/+1
ODT's reader always put empty captions for the parsed tables. This commit 1) checks paragraphs that follow the table definition 2) treats specially a paragraph with a style named 'Table' 3) does some postprocessing of the paragraphs that combines tables followed immediately by captions The ODT writer used 'TableCaption' style name for the caption paragraph. This commit follows the open office approach which allows for appending captions to table but uses a built-in style named 'Table' instead of 'TableCaption'. Any users of odt format (both writer and reader) are therefore required to change the style's name to 'Table', if necessary.
2016-11-08Inline code when text has a special styleHubert Plociniczak1-1/+2
When a piece of text has a text 'Source_Text' then we assume that this is a piece of the document that represents a code that needs to be inlined. Addapted an odt writer to also reflect that change; previously it was just writing a 'preformatted' text using a non-distinguishable font style. Code blocks are still not recognized by the ODT reader. That's a separate issue.
2016-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-0/+2
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.
2015-12-13ODT/OpenDocument writer: improved image attributesmb211-14/+9
- support for percentage widths/heights - use Attr instead of title to get dimensions from ODT walker to writeOpenDocument
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-22/+26
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-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-8/+8
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-14Allow more customization of opendocument styles.John MacFarlane1-2/+1
Automatic styles can now be inserted in the template, since the template, not the writer, now provides the enclosing `<office:automatic-styles>` tags. Closes #2520.
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-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-1/+0
- 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-08-07Updated readers, writers and README for link attributemb211-1/+1
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-7/+7
(mb21)
2015-07-01Do not add a carriage return after a hard line break in OpenDocument writer ↵Michael Chladek1-1/+1
and reflect change in tests.
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-12ODT Writer: Figure captionsNikolay Yakimov1-2/+9
Works pretty much the same as Word writer. Following styles are used for figures: Figure -- for figure with empty caption FigureWithCaption (based on Figure) -- for figure with caption FigureCaption (based on Caption) -- for figure captions Also, TableCaption (based on Caption) is used for table captions. We need FigureWithCaption to set keepWithNext, in order to keep caption with figure.
2015-02-04Append newline to the LineBreak of various writersTim Lin1-1/+1
This change improves output formatting of content with a large amount of force line breaks, such as line-blocks. The following writers are affected: * Dokuwiki * HTML * EPUB (via HTML) * LaTeX * MediaWiki * OpenDocument * Texinfo This commit resolves #1924
2015-01-05ghc 7.10.1 RC1 requires FlexibleContexts ↵Mark Wright1-1/+1
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#Inferredtype-signaturesnowmayrequiretoenableFlexibleContextsGADTsorTypeFamilies
2014-07-19Renamed readTeXMath' to avoid name conflict with texmath 0.6.7Matthew Pickering1-1/+1
Also removed deprecated readTeXMath.
2014-07-12Removed space at ends of lines in source.John MacFarlane1-2/+2
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-3/+3
2014-01-02OpenDocument writer: Fixed RawInline, RawBlock so they don't escape.John MacFarlane1-6/+10
2013-11-30ODT writer: Add `draw:name` attribute to `draw:frame` elements.John MacFarlane1-2/+8
This is reported to be necessary to avoid an error from recent versions of Libre Office when files contain more than one image. Closes #1069. Thanks to wmanley for reporting and diagnosing the problem.
2013-11-16OpenDocument: Skip raw HTML.John MacFarlane1-2/+2
Previously it was erroneously included as verbatim text. Closes #1035.
2013-11-01TexMath: Export readTeXMath', which attends to display/inline.John MacFarlane1-1/+1
Deprecate readTeXMath, and use readTeXMath' in all the writers. Require texmath >= 0.6.5.
2013-09-24OpenDocument writer: don't use font-face-decls variable.John MacFarlane1-7/+0
2013-09-25src/Text/Pandoc/Writers/OpenDocument.hs: Fix formatting of strikeout code.Václav Zeman1-4/+15
2013-08-11ODT/OpenDocument writer: Minor changes for ODF 1.2 conformance.John MacFarlane1-1/+2
See #939. We leave the nonconforming contextual-spacing attribute, which is provided by LibreOffice itself and seems to be supported.
2013-08-10Adjustments for new Format newtype.John MacFarlane1-5/+7
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+2
Currently these are "transparent" containers, except in HTML, where they produce div and span elements with attributes.
2013-07-14Fixing wrong numbered-list indentation in open document formatAlexander Kondratskiy1-5/+7
2013-07-01Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane1-3/+2
* Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified.
2013-06-29Metadata changes: Variables now completely shadow metadata.John MacFarlane1-3/+3
Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list.
2013-06-27Writers: Use defField for defaults.John MacFarlane1-3/+3
This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.
2013-06-24Use new flexible metadata type.John MacFarlane1-19/+18
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-01-09Added Attr field to Header.John MacFarlane1-1/+1
Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers.
2012-07-26Moved WriterOptions and associated types Shared -> Options.John MacFarlane1-1/+1
2012-01-14ODT writer now sizes images appropriately.John MacFarlane1-2/+2
OpenDocument writer: a title like "123x467" is interpreted as size in *points*. ODT writer: while adding images to the archive, computes their sizes and inserts a title attribute with the size before calling opendocument writer. Size is computed as follows: size in points = size in pixels * 96 / 72
2012-01-14OpenDocument writer: treat image title of form "dddxddd" as size in px.John MacFarlane1-3/+14
Later we'll modify the ODT writer to insert such titles, so image sizes will be correct in the ODT.
2011-12-27Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.John MacFarlane1-6/+2
2011-07-16Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.John MacFarlane1-1/+1
Also do this when copying image files into EPUBs and ODTs. Closes #263.
2011-03-16OpenDocument writer: Use "First paragraph" style after most non-para blocks.John MacFarlane1-10/+14
(Not just headers, as in the last patch.) Patch from Andrea Rossato, slightly modified by JM.
2011-03-12OpenDocument: Use special style for 1st para after heading.John MacFarlane1-12/+21
"First paragraph" as opposed to "Text body." This allows users to specify e.g. that only paragraphs after the first paragraph of a section are to be indented. Thanks to Andrea Rossato for the patch. Closes github Issue #20.
2011-01-26Add support for attributes in inline Code.John MacFarlane1-1/+1
Additional related changes: * URLs in Code in autolinks now use class "url". * Require highlighting-kate 0.2.8.2, which omits the final <br/> tag, essential for inline code.
2011-01-26Bumped version to 1.8; depend on pandoc-types 1.8.John MacFarlane1-3/+4
The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.
2010-12-21OpenDocument writer: Updated to use Pretty.John MacFarlane1-8/+12
2010-11-27OpenDocument writer: don't print raw TeX.John MacFarlane1-2/+4
2010-03-23Updated copyright notices.John MacFarlane1-2/+3
2010-03-22OpenDocument writer: Use a Map for stTextStyleAttr.John MacFarlane1-10/+10
This avoids duplicates (and invalid xml).
2010-03-13Use template variables for include-before/after.fiddlosopher1-6/+1
* These options now imply -s; previously they worked also in fragment mode. * Users can now adjust position of include-before and include-after text in the templates. * Default position of include-before moved back (as it originally was) before table of contents. * Resolves Issue #217. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1883 788f1e2b-df1e-0410-8736-df70ead52e1b
2010-03-13OpenDocument writer: handle tables with no headers.fiddlosopher1-1/+3
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1882 788f1e2b-df1e-0410-8736-df70ead52e1b