aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Ipynb.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-21/+21
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-10-29Changes to build with new doctemplates/doclayout.John MacFarlane1-2/+3
The new version of doctemplates adds many features to pandoc's templating system, while remaining backwards-compatible. New features include partials and filters. Using template filters, one can lay out data in enumerated lists and tables. Templates are now layout-sensitive: so, for example, if a text with soft line breaks is interpolated near the end of a line, the text will break and wrap naturally. This makes the templating system much more suitable for programatically generating markdown or other plain-text files from metadata.
2019-08-25Use new doctemplates, doclayout.John MacFarlane1-5/+6
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change] + Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON' [API change]. + Text.Pandoc.Writers.Shared: modify `addVariablesToContext`, `defField`, `setField`, `getField`, `resetField` to work with Context rather than JSON values. [API change] + Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API change]. + Use new templates and doclayout in writers. + Use Doc-based templates in all writers. + Adjust three tests for minor template rendering differences. + Added indentation to body in docbook4, docbook5 templates. The main impact of this change is better reflowing of content interpolated into templates. Previously, interpolated variables were rendered independently and intepolated as strings, which could lead to overly long lines. Now the templates interpolated as Doc values which may include breaking spaces, and reflowing occurs after template interpolation rather than before.
2019-03-30ipynb reader/writer: use format 'ipynb' for raw cell where no format given.John MacFarlane1-3/+6
According to nbformat docs, this is supposed to render in every format. We don't do that, but we at least preserve it as a raw block in markdown, so you can round-trip.
2019-03-29ipynb writer - consolidate adjacent raw blocks.John MacFarlane1-2/+10
Sometimes pandoc creates two HTML blocks, e.g. one for the open tag and one for a close tag. If these aren't consolidated, only one will show up in output cell.
2019-03-28Ipynb writer: fixed carry-over of nbformat from metadata.John MacFarlane1-1/+1
Previously we wrongly assumed it would be in a MetaString. It's an a MetaInlines.
2019-03-27ipynb writer: preserve nbformat_minor if it's given.John MacFarlane1-2/+10
This helps with round-tripping.
2019-03-09Ipynb reader/writer: better handling of cell metadata.John MacFarlane1-7/+6
We now handle even complex cell metadata in the Div's attributes. Simple metadata fields are rendered as a plain string, and complex ones as JSON.
2019-03-06ipynb writer: recurse into native divs for output cell data.John MacFarlane1-0/+1
See #5354.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-28ipynb writer: only include metadata under 'jupyter' field.John MacFarlane1-1/+1
2019-02-15ipynb writer: don't create attachments for images with absolute URIs.John MacFarlane1-2/+3
...including data: URIs. Closes #5303.
2019-02-09ipynb writer - ensure final newline.John MacFarlane1-0/+1
2019-01-24Ipynb: Put all jupyter metadata under 'jupyter' key.John MacFarlane1-1/+6
2019-01-24Revert "Prepend `jupyter_` to jupyter metadata keys."John MacFarlane1-6/+0
This reverts commit 5eaff399d5d6dc30b0d453eff42c4101674d75ab.
2019-01-24Prepend `jupyter_` to jupyter metadata keys.John MacFarlane1-0/+6
This avoids conflics with things like 'toc'.
2019-01-23Removed superfluous import.John MacFarlane1-1/+0
2019-01-22Support ipynb (Jupyter notebook) as input and output format.John MacFarlane1-0/+233
[API change] * Depend on ipynb library. * Add `ipynb` as input and output format. * Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4). * Added Text.Pandoc.Writers.Ipynb (supports nbformat v4). * Added ipynb readers and writers to T.P.Readers, T.P.Writers, and T.P.Extensions. Register the file extension .ipynb for this format. * Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error. * Note: there is no template for ipynb.