Age | Commit message (Collapse) | Author | Files | Lines |
|
Adds more formats that Jupyter's "Raw NBConvert Format" uses
natively (asciidoc),
and maps more formats to text/html whenever it makes sense.
|
|
While the spec defined format, in practice raw_mimetype is used.
See jupyter/nbformat#229
|
|
This adds most of the available formats selectable from
Jupyter's interface "Raw NBConvert Format".
|
|
BREAKING CHANGE:
fix rst mime type according to
https://docutils.sourceforge.io/FAQ.html
|
|
We already copy the relationships and elements in presentation.xml for
embedded fonts, so at the moment using a reference doc with embedded
fonts is broken, producing a pptx that PowerPoint says needs repairing.
This commit copies the fonts over, which I believe is all that’s needed
to work correctly with reference docs with embedded fonts.
|
|
Before now, the numbering of rIds was inconsistent when making the
presentation XML and when making the presentation relationships XML.
For the relationships, the slides were inserted into the rId order after
the first master, and everything else was moved up out of the way.
However, this change was then missed in the presentation XML, I think
because `envSlideOffset` was never set. The result was that any slide
masters after the first would have the wrong rIds in the presentation
XML, clashing with the slides, which would lead PowerPoint to view
produced files as corrupt. As well, other relationships (like embedded
fonts) would have their rId changed in the relationships XML but not in
the presentation XML.
This commit:
- Removes `envSlideOffset` in favour of directly passed function
arguments
- Inserts the slides into the rId order after all masters rather than
after the first
- Updates any other rIds in presentation.xml that need to be changed
|
|
- Accept test changes: they’re adding the second theme (for all tests
not containing speaker notes), or changing its position in the
XML (for the ones containing speaker notes).
|
|
Before now, for any layouts added to the output from the default
reference doc, the relationships were unconditionally added to the
output. However, if there was already a layout in slideMaster1 at the
same index then that results in duplicate relationships.
This commit checks first, and only adds the relationship if it doesn’t
already exist.
|
|
I don’t think this has caused any problems, but before now it’s been
"NotesMasterId", which is incorrect according to [ECMA-376].
[ECMA-376]: https://www.ecma-international.org/publications-and-standards/standards/ecma-376/
|
|
|
|
Closes #7557.
|
|
The HTML writer now supports `EndOfBlock`, `EndOfSection`, and
`EndOfDocument` for reference locations. EPUB and HTML slide
show formats are also affected by this change.
This works similarly to the markdown writer, but with special care
taken to skipping section divs with what regards to the block level.
The change also takes care to not modify the output if `EndOfDocument`
is used.
|
|
`text/markdown` is now a supported mime type for raw output.
|
|
|
|
|
|
[API change]
|
|
We now ensure that groups starting with `\*` never cause
text to be added to the document.
In addition, bookmarks now create a span between the start
and end of the bookmark, rather than an empty span.
|
|
|
|
|
|
Some documents seem to have non-RTF (e.g. XML) material after the
`{\rtf1 ... }` group.
|
|
Otherwise we get style names treated as test.
|
|
Until now, the pptx writer only supported four slide layouts: “Title
Slide” (used for the automatically generated metadata slide), “Section
Header” (used for headings above the slide level), “Two Column” (used
when there’s a columns div containing at least two column divs), and
“Title and Content” (used for all other slides).
This commit adds support for three more layouts: Comparison, Content
with Caption, and Blank.
- Support “Comparison” slide layout
This layout is used when a slide contains at least two columns, at
least one of which contains some text followed by some non-text (e.g.
an image or table). The text in each column is inserted into the
“body” placeholder for that column, and the non-text is inserted into
the ObjType placeholder. Any extra content after the non-text is
overlaid on top of the preceding content, rather than dropping it
completely (as currently happens for the two-column layout).
+ Accept straightforward test changes
Adding the new layout means the “-deleted-layouts” tests have an
additional layout added to the master and master rels.
+ Add new tests for the comparison layout
+ Add new tests to pandoc.cabal
- Support “Content with Caption” slide layout
This layout is used when a slide’s body contains some text, followed by
non-text (e.g. and image or a table). Before now, in this case the image
or table would break onto a new slide: to get that output again, users
can add a horizontal rule before the image or table.
+ Accept straightforward tests
The “-deleted-layouts” tests all have an extra layout and relationship
in the master for the Content with Caption layout.
+ Accept remove-empty-slides test
Empty slides are still removed, but the Content with Caption layout is
now used.
+ Change slide-level-0/h1-h2-with-text description
This test now triggers the content with caption layout, giving a
different (but still correct) result.
+ Add new tests for the new layout
+ Add new tests to the cabal file
- Support “Blank” slide layout
This layout is used when a slide contains only blank content (e.g.
non-breaking spaces). No content is inserted into any placeholders in
the layout.
Fixes #5097.
+ Accept straightforward test changes
Blank layout now copied over from reference doc as well, when
layouts have been deleted.
+ Add some new tests
A slide should use the blank layout if:
- It contains only speaker notes
- It contains only an empty heading with a body of nbsps
- It contains only a heading containing only nbsps
- Change ContentType -> Placeholder
This type was starting to have a constructor for each placeholder on
each slide (e.g. `ComparisonUpperLeftContent`). I’ve changed it
instead to identify a placeholder by type and index, as I think that’s
clearer and less redundant.
- Describe layout-choosing logic in manual
|
|
|
|
+ Add sandbox feature for readers. When this option is used,
readers and writers only have access to input files (and
other files specified directly on command line). This restriction
is enforced in the type system.
+ Filters, PDF production, custom writers are unaffected. This
feature only insulates the actual readers and writers, not
the pipeline around them in Text.Pandoc.App.
+ Note that when `--sandboxed` is specified, readers won't have
access to the resource path, nor will anything have access to
the user data directory.
+ Add module Text.Pandoc.Class.Sandbox, defining
`sandbox`. Exported via Text.Pandoc.Class. [API change]
Closes #5045.
|
|
|
|
This change has several parts:
- In Text.Pandoc.App, if the writer is docx, we fill the media
bag and attempt to convert any SVG images to PNG, adding these
to the media bag. The PNG backups have the same filenames as
the SVG images, but with an added .png extension. If the conversion
cannot be done (e.g. because rsvg-convert is not present),
a warning is omitted.
- In Text.Pandoc.Writers.Docx, we now use Word 2016's syntax for
including SVG images. If a PNG fallback is present in the media bag,
we include a link to that too.
It would be helpful if someone with an old Word version could test
to see that the documents we produce can be opened and viewed with
the PNG fallbacks. If not, then perhaps we can eliminate the
slightly complex code for producing these fallbacks.
Closes #4058.
|
|
|
|
|
|
The information we need is just a DPI, so why require more?
|
|
Before this commit, the pptx writer adds a slide break before any table,
“columns” div, or paragraph starting with an image, unless the only
thing before it on the same slide is a heading at the slide level. In
that case, the item and heading are kept on the same slide, and the
heading is used as the slide title (inserted into the layout’s “title”
placeholder).
However, if the slide level is set to 0 (as was recently enabled) this
makes it impossible to have a slide with a title which contains any of
those items in its body.
This commit changes this behaviour: now if the slide level is 0, then
items will be kept with a heading of any level, if the heading’s the
only thing before the item on the same slide.
|
|
This will, I hope, fix #7527 and #7503.
|
|
|
|
Previously we used liftIO fairly liberally. The code has
been restructured to avoid this.
A small behavior change is that pandoc will now fall back
to latin1 encoding for inputs that can't be read as UTF-8.
This is what it did previously for content fetched from
the web and not marked as to content type. It makes sense
to do the same for local files.
|
|
[API change]
|
|
It was uselessly restricted to PandocIO, instead of any
instance of PandocMonad and MonadIO.
[API change]
|
|
so we can run this with any instance of PandocMonad and MonadIO,
not just PandocIO.
|
|
from PandocIO to any instance of MonadIO and PandocMonad.
[API change]
|
|
instead of PandocIO, it can be used in any instance of
PandocMonad, MonadIO, and MonadMask.
[API change]
|
|
to any instance of PandocMonad and MonadIO.
This involves an API change, since the type of
runLua is now
(PandocMonad m, MonadIO m) => Lua a -> m (Either PandocError a)
|
|
parsing. Use of `--strip-comments` was causing tight lists
to be rendered as loose (as if the comment were a blank line).
Closes #7521.
|
|
Previously we had to run runIOorExplode inside withTempDir.
Now that PandocIO is an instance of MonadMask, this is no
longer necessary.
|
|
This will allow us to use withTempDir.
|
|
|
|
|
|
These should create code blocks, not insert raw RST.
Closes #7513.
|
|
The docx reader made a couple assumptions about how docx
containers were laid out that were not always true, with
the result that some images in documents did not get
found/extracted.
Closes #7511.
|
|
The image title (i.e. `![alt text](link "title")`) was previously
ignored when writing to pptx. This commit includes it in PowerPoint's
description of the image, along with the link (which was already
included).
Fixes 7352.
|
|
Linkification of URLs in the bibliography is now done in
the citeproc library, depending on the setting of an option.
We set that option depending on the value of the metadata
field `link-bibliography` (defaulting to true, for consistency
with earlier behavior, though the new behavior includes the
CSL draft recommendation of hyperlinking the title or the whole
entry if a DOI, PMID, PMCID, or URL field is present but not
explicitly rendered).
These changes implement the following recommendations from the
draft CSL v1.0.2 spec (Appendix VI):
> The CSL syntax does not have support for configuration of links.
> However, processors should include links on bibliographic references,
> using the following rules:
> If the bibliography entry for an item renders any of the following
> identifiers, the identifier should be anchored as a link, with the
> target of the link as follows:
> - url: output as is
> - doi: prepend with "`https://doi.org/`"
> - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`"
> - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`"
> If the identifier is rendered as a URI, include rendered URI components
> (e.g. "`https://doi.org/`") in the link anchor. Do not include any other
> affix text in the link anchor (e.g. "Available from: ", "doi: ", "PMID: ").
> If the bibliography entry for an item does not render any of
> the above identifiers, then set the anchor of the link as the item
> title. If title is not rendered, then set the anchor of the link as the
> full bibliography entry for the item. Set the target of the link as one
> of the following, in order of priority:
>
> - doi: prepend with "`https://doi.org/`"
> - pmcid: prepend with "`https://www.ncbi.nlm.nih.gov/pmc/articles/`"
> - pmid: prepend with "`https://www.ncbi.nlm.nih.gov/pubmed/`"
> - url: output as is
>
> If the item data does not include any of the above identifiers, do not
> include a link.
>
> Citation processors should include an option flag for calling
> applications to disable bibliography linking behavior.
Thanks to Benjamin Bray for getting this all working.
|
|
@undergroundquizscene - I think TemplateWarning
is apt to be confusing, since this actually doesn't have
anything to do with what we call 'templates' in pandoc.
Hence the change to a powerpoint-specific name.
|
|
Until now, users had to make sure that their reference doc contains
layouts in a specific order: the first four layouts in the file had to
have a specific structure, or else pandoc would error (or sometimes
successfully produce a pptx file, which PowerPoint would then fail to
open).
This commit changes the layout selection to use the layout names rather
than order: users must make sure their reference doc contains four
layouts with specific names, and if a layout with the right name isn’t
found pandoc will output a warning and use the corresponding layout from
the default reference doc as a fallback.
I believe the use of names rather than order will be clearer to users,
and the clearer errors will help them troubleshoot when things go wrong.
- Add tests for moved layouts
- Add tests for deleted layouts
- Add newly included layouts to slideMaster1.xml to fix tests
|