Commit graph

12601 commits

Author SHA1 Message Date
John MacFarlane
9a07667ab3 GitHuB CI tweak. cabal v2-install doesn't respect --bindir? 2019-09-15 21:46:01 -07:00
John MacFarlane
2e50e7bf25 Fix syntax of cabal v2-install. 2019-09-15 19:40:39 -07:00
John MacFarlane
e367656de8 More GH CI tweaks. 2019-09-15 18:32:12 -07:00
John MacFarlane
4140ad1ac9 GitHub CI: attempt to enable artifact. 2019-09-15 18:20:26 -07:00
John MacFarlane
b023bfccf4 GitHuB CI: remove --disable-optimization and --fast. 2019-09-15 18:12:12 -07:00
John MacFarlane
172c7e3b38 Tweak GitHub CI config. 2019-09-15 18:09:26 -07:00
Albert Krewinkel
d0261d7387 Lua filters: allow passing of HTML-like tables instead of Attr ()
Attr values can now be given as normal Lua tables; this can be used as a
convenient alternative to define Attr values, instead of constructing
values with `pandoc.Attr`. Identifiers are taken from the *id* field,
classes must be given as space separated words in the *class* field. All
remaining fields are included as misc attributes.

With this change, the following lines now create equal elements:

    pandoc.Span('test', {id = 'test', class = 'a b', check = 1})
    pandoc.Span('test', pandoc.Attr('test', {'a','b'}, {check = 1}))

This also works when using the *attr* setter:

    local span = pandoc.Span 'text'
    span.attr = {id = 'test', class = 'a b', check = 1}

Furthermore, the *attributes* field of AST elements can now be a plain
key-value table even when using the `attributes` accessor:

    local span = pandoc.Span 'test'
    span.attributes = {check = 1}   -- works as expected now

Closes: 
2019-09-15 12:11:58 -07:00
John MacFarlane
f580da2033 GitHuB CI: turn off optimizations. 2019-09-15 12:10:48 -07:00
John MacFarlane
51728ce36f Added .gitattributes.
This ensures that the golden files in `test/fb2/reader/` don't
have newlines converted. This should fix a test failure on
GitHub CI with Windows.

Closes .
2019-09-15 10:40:59 -07:00
John MacFarlane
45b7636307 Revert "FB2 reader test: better diagnostics on failure."
This reverts commit c65af7d1a2.
2019-09-15 10:27:19 -07:00
John MacFarlane
c65af7d1a2 FB2 reader test: better diagnostics on failure. 2019-09-15 09:06:38 -07:00
John MacFarlane
5d1a58b3d8 Add chapter-title class to EPUB chapter title h1 elements.
See .
2019-09-14 11:44:11 -07:00
John MacFarlane
47358831a4 EPUB toChapters: don't treat "refs" Div specially.
This should make toChapters work better if there are
Divs around sections.
2019-09-14 11:36:21 -07:00
John MacFarlane
3f455aedfa Github CI/windows: separate dependencies step. 2019-09-14 10:47:29 -07:00
John MacFarlane
88a0327579 FB2 reader test: Another attempt to fix test failure on GitHub CI. 2019-09-14 10:37:19 -07:00
John MacFarlane
7ecae69e27 Revert "FB2 reader test: filter CRs."
This reverts commit e35147d715.
2019-09-13 22:08:42 -07:00
John MacFarlane
e35147d715 FB2 reader test: filter CRs.
This may help with the test failure on GitHub CI.

b59e6d0376/checks
2019-09-13 16:50:00 -07:00
John MacFarlane
b59e6d0376 GitHuB CI: Try adding windows build. 2019-09-13 10:54:55 -07:00
John MacFarlane
8984eb7460 Fix setting path. 2019-09-13 09:26:47 -07:00
John MacFarlane
edd7bfa434 GitHub CI - set path. 2019-09-13 09:24:14 -07:00
John MacFarlane
afbc1ca3d8 GitHub CI - try sudo 2019-09-12 23:30:05 -07:00
John MacFarlane
27968fc09d Revert "GitHub CI - try with stack."
This reverts commit 4411af8062.
2019-09-12 23:29:35 -07:00
John MacFarlane
4411af8062 GitHub CI - try with stack. 2019-09-12 23:27:56 -07:00
John MacFarlane
f2612fa1ae GitHUB CI: Try installing recent cabal. 2019-09-12 23:19:32 -07:00
John MacFarlane
ab792faa3a GitHub CI - use plain v1-cabal. 2019-09-12 23:10:20 -07:00
John MacFarlane
8a0ffba296 GitHub CI: try 'cabal new-' instead of 'v2-' 2019-09-12 23:08:05 -07:00
John MacFarlane
69b42255f2
Add haskell.yml
Add GitHub CI file
2019-09-12 23:04:58 -07:00
John MacFarlane
65f73de28a Better message for PandocShouldNeverHappenError. 2019-09-12 08:50:12 -07:00
John MacFarlane
4f909c626c Change exit codes.
It's good practice not to use codes 1-2 for user errors.
Also, we used 65 for two different errors.

- PandocAppError was 1, is now 4
- PandocOptionError was 2, is now 6
- PandocMakePDFError was 65, is now 66
2019-09-12 08:46:38 -07:00
John MacFarlane
5aef7d04f0 MANUAL: add section for exit codes. 2019-09-12 08:36:49 -07:00
John MacFarlane
88dc6fac5d Add --shift-heading-level-by option.
Deprecate --base-heading-level.

The new option does everything the old one does, but also
allows negative shifts.  It also promotes the document
metadata (if not null) to a level-1 heading with a +1 shift,
and demotes an initial level-1 heading to document metadata
with a -1 shift. This supports converting documents that
use an initial level-1 heading for the document title.

Closes .
2019-09-10 23:16:13 -07:00
John MacFarlane
a64b3ab61f Pass value of --dpi to rsvg-convert...
when converting SVG to PDF in the process of creating a PDF.

Closes .
2019-09-10 21:17:51 -07:00
John MacFarlane
4778d03473 LaTeX reader: Fix parsing of optional arguments that contain braced text.
Closes .
2019-09-09 21:33:16 -07:00
John MacFarlane
4dad7c5e86 MANUAL: document some pptx limitations...
in slide show section:

- no incremental display ()
- no pause with `. . .` ()
2019-09-08 22:41:04 -07:00
John MacFarlane
8696725cd9 Add -L option as shortcut for --lua-filter. 2019-09-08 22:37:38 -07:00
Brian Leung
0558ea9836 Org reader: modify handling of example blocks. ()
* Org reader: allow the `-i` switch to ignore leading spaces.

* Org reader: handle awkwardly-aligned code blocks within lists.

Code blocks in Org lists must have their #+BEGIN_ aligned in a
reasonable way, but their other components can be positioned otherwise.
2019-09-08 22:34:10 -07:00
Vanessa McHale
8f5ab97569 Add to other-extensions field for use by cabal solver () 2019-09-08 22:28:17 -07:00
John MacFarlane
9f984ff26a Replace Element and makeHierarchical with makeSections.
Text.Pandoc.Shared:

+ Remove `Element` type [API change]
+ Remove `makeHierarchicalize` [API change]
+ Add `makeSections` [API change]
+ Export `deLink` [API change]

Now that we have Divs, we can use them to represent the structure
of sections, and we don't need a special Element type.
`makeSections` reorganizes a block list, adding Divs with
class `section` around sections, and adding numbering
if needed.

This change also fixes some longstanding issues recognizing
section structure when the document contains Divs.
Closes , see also .

All writers have been changed to use `makeSections`.
Note that in the process we have reverted the change
c1d058aeb1
made in response to , which I'm not completely
sure was a good idea.

Lua modules have also been adjusted accordingly.
Existing lua filters that use `hierarchicalize` will
need to be rewritten to use `make_sections`.
2019-09-08 22:20:19 -07:00
John MacFarlane
1ccff3339d Revert changes to hierarchicalizeWithIds.
Revert "hierarchicalize: ensure that sections get ids..."
This reverts commit 212406a61d.

Revert "Improve detection of headings in Divs by hierarchicalize."
This reverts commit 6e2cfd6c97.

Revert "Shared.hierarchicalize: improve handling of div and section structure."
This reverts commit 345b33762e.
2019-09-08 21:56:42 -07:00
John MacFarlane
95a19fcff0 INSTALL instructions fix for libicu. 2019-09-08 21:56:42 -07:00
Mauro Bieg
d96a5629bc Emit warning on -f latex -o out.pdf ()
add UnusualConversion to LogMessage [API change]
2019-09-08 16:03:13 -07:00
John MacFarlane
f0577fe360 Makefile: ghci target 2019-09-06 21:09:44 -07:00
John MacFarlane
212406a61d hierarchicalize: ensure that sections get ids...
even if they're in divs.  Improves .
2019-09-06 09:05:52 -07:00
John MacFarlane
6e2cfd6c97 Improve detection of headings in Divs by hierarchicalize.
The structure

```
<h1>one</h1>
<div>
<h1>two</h1>
</div>
```

should create two coordinate sections, not a section with
a subsection.  Now it does.

Extends .
2019-09-06 08:44:59 -07:00
John MacFarlane
345b33762e Shared.hierarchicalize: improve handling of div and section structure.
Previously Divs were opaque to hierarchicalize, so headings
inside divs didn't get into the table of contents, for
example ().

Now hierarchicalize treats Divs as sections when appropriate.
For example, these structures both yield a section and a
subsection:

``` html
<div>
<h1>one</h1>
<div>
<h2>two</h2>
</div>
</div>
```
``` html
<div>
<h1>one</h1>
<div>
<h1>two</h1>
</div>
</div>
```

Note that

``` html
<h1>one</h1>
<div>
<h2>two</h2>
</div>
<h1>three</h1>
```

gets parsed as the structure

    one
      two
    three

which may not always be desirable.

Closes .
2019-09-05 22:37:13 -07:00
John MacFarlane
0534258780 Roff reader: Better support for 'while'. 2019-09-05 21:13:50 -07:00
John MacFarlane
e26ef34c04 Add dependency on skylighting-core in cabal file.
Closes .
2019-09-05 17:36:37 -07:00
John MacFarlane
1c35167c3a Small cleanups in Makefile. 2019-09-05 17:34:47 -07:00
John MacFarlane
4559bc257b Makefile - remove references to obsolete flag.
See .
2019-09-05 15:54:46 -07:00
John MacFarlane
5d790db5cf Add CSS for hanging-indent div to epub.css.
This is for hanging indents with pandoc-citeproc, to be
supported in a later release.
2019-09-05 12:44:29 -07:00