summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Powerpoint writer: Move Presentation.hs out of PandocMonadJesse Rosenthal2018-01-15
| | | | | | We don't need it for anything but the log messages, and we can just keep track of that in state and pass it along to the `writePowerpoint` function. This will simplify the code.
* Powerpoint writer: Ignore anchor links to nowehere.Jesse Rosenthal2018-01-15
| | | | | | We don't convert a '#target' ExternalTarget to an InternalTarget if `target` is not in the AnchorMap. We just remove the link. This prevents broken links in the Powerpoint output.
* Powerpoint writer: Fix anchor links.Jesse Rosenthal2018-01-14
| | | | | | | | | They were broken when I refactored (the Output module wanted to use state left over from the construction of the Presentation type). This change introduces a new type `LinkTarget = InternalTarget | ExternalTarget`. Internal target points to a slide number, and these will all be resolved before the Presentation is passed along to the Output module.
* RST reader: add aligned environment when needed in math.John MacFarlane2018-01-14
| | | | | | | | | rst2latex.py uses an align* environment for math in `.. math::` blocks, so this math may contain line breaks. If it does, we put the math in an `aligned` environment to simulate rst2latex.py's behavior. Closes #4254.
* Markdown reader: Improved inlinesInBalancedBrackets.John MacFarlane2018-01-14
| | | | | | | | The change both improves performance and fixes a regression whereby normal citations inside inline notes were not parsed correctly. Closes jgm/pandoc-citeproc#315.
* LaTeX reader: Advance source position at end of stream.John MacFarlane2018-01-14
|
* Powerpoint writer: Refactor into separate modules.Jesse Rosenthal2018-01-14
| | | | | | | | | | | | There are two steps in the conversion: a conversion from pandoc to a Presentation datatype modeling pptx, and a conversion from Presentation to a pptx archive. The two steps were sharing the same state and environment, and the code was getting a bit spaghetti-ish. This separates the conversion into separate modules (T.P.W.Powerpoint.Presentation, which defineds the Presentation datatype and goes Pandoc->Presentation) and (T.P.W.Pandoc.Output, which goes Presentation->Archive). Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.
* Powerpoint writer: Avoid overlapping blocks in column output.Jesse Rosenthal2018-01-14
| | | | | | Just as a slide can't have an image and text on the same slide because of overlapping, we can't have both in a single column. We run splitBlocks on the text in the column and discard the rest.
* Powerpoint writer: Position images correctly in two-column layout.Jesse Rosenthal2018-01-14
| | | | | You can have two images side-by-side, or text alongside an image. The image will be fit correctly within the column.
* Powerpoint writer: Make content shape retrieval environment-awareJesse Rosenthal2018-01-14
| | | | | | | | We put `getContentShape` and `getContentShapeSize` inside the P monad, so that we can (in the future) make use of knowledge of what slide environment we're in to get the correct shape. This will allow us, for example, to get individual columns for a two-column layout, and place images in them appropriately.
* LaTeX reader: pass through macro defs in rawLaTeXBlock...John MacFarlane2018-01-13
| | | | | | | | | | even if the `latex_macros` extension is set. This reverts to earlier behavior and is probably safer on the whole, since some macros only modify things in included packages, which pandoc's macro expansion can't modify. Closes #4246.
* LaTeX reader: fixed pos calculation in tokenizing escaped space.John MacFarlane2018-01-13
|
* Powerpoint writer: Improve image handling.Jesse Rosenthal2018-01-13
| | | | | | | | | | | We now determine image and caption placement by getting the dimensions of the content box in a given layout. This allows for images to be correctly sized and positioned in a different template. Note that iamges without captions and headers are no longer full-screened. We can't do this dependably in different layouts, because we don't know where the header is (it could be to the side of the content, for example).
* LaTeX reader: allow macro definitions inside macros.John MacFarlane2018-01-13
| | | | | | | | | | | | Previously we went into an infinite loop with ``` \newcommand{\noop}[1]{#1} \noop{\newcommand{\foo}[1]{#1}} \foo{hi} ``` See #4253.
* Powerpoint writer: read presentation size from reference file.Jesse Rosenthal2018-01-13
| | | | | | | | | Our presentation size is now dependent on the reference/template file we use. This will make it easier to set different output sizes by supplying different reference files. The alternative (allowing a user to explicitly set output size regardless of the template) will lead to too many thorny issues, as explicitly set sizes at the various level of powerpoint layout would have to be reset.
* Powerpoint writer: code cleanupJesse Rosenthal2018-01-13
| | | | Last commit accidentally left commented-out code in.
* Powerpoint writer: Handle (sub)headers above slidelevel correctly.Jesse Rosenthal2018-01-13
| | | | | | | | | | | | Above the slidelevel, subheaders will be printed in bold and given a bit of extra space before them. Note that at the moment, no distinction is made between levels of headers above the slide header, though that can be changed. (It has to be changed in pandoc, since PowerPoint has no concept of paragraph or character classes.) This allows us to clean up the code as well: the code in `blockToParagraphs` since it will only touch content blocks, and therefore will not deal with headers at or below the slidelevel.
* Powerpoint writer: Check for required filesJesse Rosenthal2018-01-13
| | | | | | | | | Since we now import from reference/dist file by glob, we need to make sure that we're getting the files we need to make a non-corrupt Powerpoint. This performs that check. (In the process, this change also cleaned up a lot of commented-out code left from the switch to the new reference-doc method.)
* Powerpoint writer: Improve templating using `--reference-doc`Jesse Rosenthal2018-01-12
| | | | | | Templating should work much more reliably now. There is still some problem with image placement when we change sizes. A further commit will address this.
* Lua filters: improve error messagesAlbert Krewinkel2018-01-12
| | | | Provide more context about the task which caused an error.
* Powerpoint writer: Include Notes slide in TOCJesse Rosenthal2018-01-12
|
* Lua filters: make PANDOC_READER_OPTIONS availableAlbert Krewinkel2018-01-12
| | | | | The options which were used to read the document are made available to Lua filters via the `PANDOC_READER_OPTIONS` global.
* Powerpoint writer: allow setting toc-title in metadata.Jesse Rosenthal2018-01-12
| | | | Accompanying change in MANUAL.txt
* Move `metaValueToInlines` to T.P.W.SharedJesse Rosenthal2018-01-12
| | | | This will allow the Powerpoint writer to use it as well.
* Powerpoint writer: Set notes slide header with slide-levelJesse Rosenthal2018-01-12
| | | | | It used to be hardcoded to 2. This will set it to the appropriate slide-level.
* Powerpoint writer: Add table of contentsJesse Rosenthal2018-01-12
| | | | | | This is triggered by the `--toc` flag. Note that in a long slide deck this risks overrunning the text box. The user can address this by setting `--toc-depth=1`.
* Powerpoint writer: Set notes slide number correctlyJesse Rosenthal2018-01-12
| | | | | | Previously, this hadn't been aware of a metadata slide. We also clarify the logic for setting the startnumber of different slide sections correctly.
* Powerpoint writer: Ignore internal links without targets.Jesse Rosenthal2018-01-12
| | | | | | If the user entered an internal link without a corresponding anchor, it would produce a corrupted file. Now we check the anchor map, and make sure the target is in the file. If it isn't, we ignore it.
* Powerpoint writer: Clean up adding metadata slideJesse Rosenthal2018-01-12
| | | | We want to count the slide numbers correctly if it's in there.
* Powerpoint writer: Add anchor linksJesse Rosenthal2018-01-12
| | | | | | For anchor-type links (`[foo](#bar)`) we produce an anchor link. In powerpoint these are links to slides, so we keep track of a map relating anchors to the slides they occur on.
* Powerpoint writer: Make the slide number available to the blocks.Jesse Rosenthal2018-01-12
| | | | | For anchors, block-processing functions need to know what slide number they're in. We make the envCurSlideId available to blocks.
* Powerpoint writer: move curSlideId to environment.Jesse Rosenthal2018-01-12
| | | | It really isn't a moving state, and that can be misleading.
* LaTeX reader: fix inconsistent column widths.John MacFarlane2018-01-10
| | | | | | | This fixes a bug whereby column widths for the body were different from widths for the header in some tables. Closes #4238.
* RST reader: better handling for headers with an anchor.John MacFarlane2018-01-10
| | | | | | Instead of creating a div containing the header, we put the id directly on the header. This way header promotion will work properly. Closes #4240.
* HTML writer: Fixed footnote backlinks with --id-prefix.John MacFarlane2018-01-09
| | | | Closes #4235.
* Use latest skylighting and omit the 'missingincludes' check.John MacFarlane2018-01-07
| | | | | | | | | | If you use a custom syntax definition that refers to a syntax you haven't loaded, pandoc will now complain when it is highlighting the text, rather than at the start. This saves a huge performance hit from the `missingIncludes` check. Closes #4226.
* Lua: make pandoc-types version available as PANDOC_API_VERSIONAlbert Krewinkel2018-01-07
| | | | | | The current pandoc-types version is made available to Lua programs in the global PANDOC_API_VERSION. It contains the version as a list of numbers.
* Lua: make pandoc version available as PANDOC_VERSIONAlbert Krewinkel2018-01-07
| | | | | The current pandoc version is made available to Lua programs in the global PANDOC_VERSION. It contains the version as a list of numbers.
* Don't use `missingIncludes` unless custom syntax defs have been given.John MacFarlane2018-01-06
| | | | | | | | | This avoids a huge performance sink that comes from evaluating all the elements of the default syntax map. Better just to have run-time errors for missing includes? See #4226.
* Update copyright notices to include 2018Albert Krewinkel2018-01-05
|
* data/pandoc.lua: fix attribute names of CitationAlbert Krewinkel2018-01-05
| | | | | | | | The fields were named like the Haskell fields, not like the documented, shorter version. The names are changed to match the documentation and Citations are given a shared metatable to enable simple extensibility. Fixes: #4222
* Use hslua utils where possibleAlbert Krewinkel2018-01-04
| | | | | | Some helper functions and types have been moved to hslua. Change: minor
* Powerpoint writer: remove some code duplication.Jesse Rosenthal2018-01-04
|
* Powerpoint writer: Ignore Notes divJesse Rosenthal2018-01-03
| | | | For now, ignore notes div for parity with other slide outputs.
* Powerpoint writer: Set default slidelevel correctly.Jesse Rosenthal2018-01-03
| | | | | | We had previously defaulted to slideLevel 2. Now we use the correct behavior of defaulting to the highest level header followed by content. We change an expected test result to match this behavior.
* Powerpoint writer: Split blocks correctly for linked imagesJesse Rosenthal2018-01-03
| | | | | | We treat links with an image as the first inline as an image with a link picProp -- so we have to split on it the same as if it were an image.
* Powerpoint writer: combine adjacent runs.Jesse Rosenthal2018-01-03
| | | | | This will make the xml easier to read for debugging purposes. It should also make links behave more consistently across numerous words.
* Powerpoint writer: Fix new replaceNamedChildrenJesse Rosenthal2018-01-03
| | | | | | Previous version replaced *each* element from the template with the new elements -- leading to multiple overlapping frames. This only replaces the first instance, and throws out the rest.
* PowerPoint writer: make inline code inherit code size.Jesse Rosenthal2018-01-03
| | | | | | Previously (a) the code size wasn't set when we force size, and (b) the properties was set from the default, instead of inheriting. Both of those problems were fixed.
* Powerpoint writer: simplify replaceNamedChildren functionJesse Rosenthal2018-01-03
| | | | | | | A lot of work in the powerpoint writer is replacing XML from within slidelayouts from templates. This function does a good deal of that work, and this makes it preserve element order, as well as making it a bit easier to understand.