Commit graph

13688 commits

Author SHA1 Message Date
Michael Hoffmann
74bd5a4f47
Docx writer: better handle list items whose contents are lists (#6522)
If the first element of a bulleted or ordered list is another list,
then that first item will disappear if the target format is docx. This
changes the docx writer so that it prepends an empty string for those
cases. With this, no items will disappear.

Closes #5948.
2020-10-02 09:30:05 -07:00
John MacFarlane
27b4c21f72 Update to lastest citeproc 2020-10-01 22:07:55 -07:00
niszet
7d97bf7a8c
Syntax highlight for inline code of OpenDocument (#6711)
To implement Syntax highlighting for OpenDocument, inlineToOpenDocument in OpenDocument Writer is updated based on Docx Writer.
This commit is only for inline Code because update of CodeBlock needs structual change of output document.
Currently, styles are not generated automatically in styles.xml. To implement it, additional commit for ODT Writer is needed.
Although styles are not included in styles.xml, output file can be shown in LibreOffice(7.0.0.3) like normal characters.
2020-10-01 09:55:16 -07:00
John MacFarlane
46dffbd8e5 Use latest citeproc. 2020-09-27 23:52:28 -07:00
John MacFarlane
5e70f774ec Fix redundant import warning. 2020-09-27 23:32:45 -07:00
John MacFarlane
eff6b8f27d Use latest citeproc. 2020-09-27 16:03:31 -07:00
Nils Carlson
ae4dcc0d4a
OpenDocument Writer: Implement table cell alignment (#6700)
Co-authored-by: Mauro Bieg <mb21@users.noreply.github.com>
2020-09-27 11:21:53 -07:00
John MacFarlane
3abfcbeef7 Use latest citeproc. 2020-09-26 17:13:55 -07:00
John MacFarlane
9061635a6a Use latest citeproc. 2020-09-26 15:05:08 -07:00
John MacFarlane
a822067903 Fix short-title.
We were getting null short-titles generated, and that
was creating wrong citations in some cases.

Close #6702.
2020-09-26 14:28:28 -07:00
John MacFarlane
5a388ab2f5 Allow gfm_auto_identifiers, ascii_identifiers extensions for docx. 2020-09-25 09:53:56 -07:00
John MacFarlane
188c444990 RST reader: apply .. class:: directly to following Header.
rather than creating a surrounding Div.

Closes #6699.
2020-09-25 09:06:15 -07:00
Albert Krewinkel
6119125a8b
Org reader: fix HLint warnings 2020-09-25 09:44:00 +02:00
Albert Krewinkel
29baaa2acb
doc/org.md: add section on tables 2020-09-25 09:44:00 +02:00
John MacFarlane
1a72581286 Use latest citeproc commit. 2020-09-24 20:33:05 -07:00
Nils Carlson
1ad7a047d5
DocBook reader: Implement table cell alignment (#6698) 2020-09-24 17:43:43 -07:00
John MacFarlane
a331c69b49 Slight improvement to last commit.
We now add a space only if there isn't already one.
(Some styles add a space at the end of the left-margin
div.)
2020-09-24 10:03:04 -07:00
John MacFarlane
810ea6fdf8 Citeproc: Insert space after csl-left-margin span contents...
if they come before csl-right-inline.  This ensures that
the citation number or label will be separated from the
rest by a space, even in formats (like plain) that don't yet have
special handling for the display spans.
2020-09-24 09:57:55 -07:00
Nils Carlson
4f13c0e25e
OpenDocument writer: New table cell support with row and column spans (#6682)
Unit tests only verify column spans at this point.

Co-authored-by: Nils Carlson <nils.carlson@ludd.ltu.se>
2020-09-24 09:31:47 -07:00
niszet
1f707da40f
Support toc-depth option for ODT writer (#6697)
To support `--toc-depth` option for ODT, writer and template are
updated.  Closes #6696.
2020-09-24 09:28:38 -07:00
John MacFarlane
09d39e0e98 ALlow bytestring 0.11.x. 2020-09-23 22:27:20 -07:00
John MacFarlane
99f8923f20 Revert stack->cabal change in nightly.yml. 2020-09-23 09:30:14 -07:00
John MacFarlane
ea7fea58a9 release-candidate build: use latest stack on the runner.
instead of installing from choco.

Remove obsolete macos and win i386 sections.
2020-09-22 09:47:44 -07:00
John MacFarlane
e2e6dbc3a6 Nightly process improvements.
- Use cabal for windows.
- Use most recent cabal/ghc.
- Udd sha1 to executable name.
2020-09-22 09:41:40 -07:00
John MacFarlane
5f33df322c CI: use checkout@v2, and use haskell-setup to install stack. 2020-09-22 09:13:48 -07:00
John MacFarlane
e0984a43a9 Add built-in citation support using new citeproc library.
This deprecates the use of the external pandoc-citeproc
filter; citation processing is now built in to pandoc.

* Add dependency on citeproc library.
* Add Text.Pandoc.Citeproc module (and some associated unexported
  modules under Text.Pandoc.Citeproc).  Exports `processCitations`.
  [API change]
* Add data files needed for Text.Pandoc.Citeproc:  default.csl
  in the data directory, and a citeproc directory that is just
  used at compile-time.  Note that we've added file-embed as a mandatory
  rather than a conditional depedency, because of the biblatex
  localization files. We might eventually want to use readDataFile
  for this, but it would take some code reorganization.
* Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it
  in `processCitations`. [API change]
* Add tests from the pandoc-citeproc package as command tests (including
  some tests pandoc-citeproc did not pass).
* Remove instructions for building pandoc-citeproc from CI and
  release binary build instructions.  We will no longer distribute
  pandoc-citeproc.
* Markdown reader: tweak abbreviation support.  Don't insert a
  nonbreaking space after a potential abbreviation if it comes right before
  a note or citation.  This messes up several things, including citeproc's
  moving of note citations.
* Add `csljson` as and input and output format. This allows pandoc
  to convert between `csljson` and other bibliography formats,
  and to generate formatted versions of CSL JSON bibliographies.
* Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API
  change]
* Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API
  change]
* Added `bibtex`, `biblatex` as input formats.  This allows pandoc
  to convert between BibLaTeX and BibTeX and other bibliography formats,
  and to generated formatted versions of BibTeX/BibLaTeX bibliographies.
* Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and
  `readBibLaTeX`. [API change]
* Make "standalone" implicit if output format is a bibliography format.
  This is needed because pandoc readers for bibliography formats put
  the bibliographic information in the `references` field of metadata;
  and unless standalone is specified, metadata gets ignored.
  (TODO: This needs improvement. We should trigger standalone for the
  reader when the input format is bibliographic, and for the writer
  when the output format is markdown.)
* Carry over `citationNoteNum` to `citationNoteNumber`.  This was just
  ignored in pandoc-citeproc.
* Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.
  [API change] This runs the processCitations transformation.
  We need to treat it like a filter so it can be placed
  in the sequence of filter runs (after some, before others).
  In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,
  so this special filter may be specified either way in a defaults file
  (or by `citeproc: true`, though this gives no control of positioning
  relative to other filters).  TODO: we need to add something to the
  manual section on defaults files for this.
* Add deprecation warning if `upandoc-citeproc` filter is used.
* Add `--citeproc/-C` option to trigger citation processing.
  This behaves like a filter and will be positioned
  relative to filters as they appear on the command line.
* Rewrote the manual on citatations, adding a dedicated Citations
  section which also includes some information formerly found in
  the pandoc-citeproc man page.
* Look for CSL styles in the `csl` subdirectory of the pandoc user data
  directory.  This changes the old pandoc-citeproc behavior, which looked
  in `~/.csl`.  Users can simply symlink `~/.csl` to the `csl`
  subdirectory of their pandoc user data directory if they want
  the old behavior.
* Add support for CSL bibliography entry formatting to LaTeX, HTML,
  Ms writers.  Added CSL-related CSS to styles.html.
2020-09-21 10:15:50 -07:00
John MacFarlane
89c577befb Bump to 2.11. 2020-09-21 10:15:49 -07:00
John MacFarlane
a59ae96062 Markdown reader: Set citationNoteNum accurately in citations.
This also changes stateLastNoteNumber -> stateNoteNumber.
2020-09-21 10:10:37 -07:00
John MacFarlane
b2f3074988 Parsing: add stateInNote and stateLastNoteNumber to ParserState.
These will be used to populate note numbers for citations.
2020-09-21 10:10:30 -07:00
John MacFarlane
39f357027a Sort YAML metadata keys in Markdown output case-insensitive.
Use caseFold.
2020-09-21 10:10:12 -07:00
John MacFarlane
045dd212a7 Remove duplicate tshow definition. 2020-09-21 10:09:59 -07:00
Albert Krewinkel
ba591ba365
pandoc.cabal: sort build depends alphabetically (#6691) 2020-09-21 09:28:25 -07:00
Albert Krewinkel
29d4753cd9
doc/org.md: add section on handling of unknown directives 2020-09-21 11:35:28 +02:00
Albert Krewinkel
acbea6b8c6
Lua filters: add SimpleTable for backwards compatibility (#6575)
A new type `SimpleTable` is made available to Lua filters. It is
similar to the `Table` type in pandoc versions before 2.10;
conversion functions from and to the new Table type are provided.

Old filters using tables now require minimal changes and can use,
e.g.,

    if PANDOC_VERSION > {2,10,1} then
      pandoc.Table = pandoc.SimpleTable
    end

and

    function Table (tbl)
      tbl = pandoc.utils.to_simple_table(tbl)
      …
      return pandoc.utils.from_simple_table(tbl)
    end

to work with the current pandoc version.
2020-09-20 15:48:31 -07:00
Albert Krewinkel
b2decdfd13
CI: bump tested GHC versions to 8.8.4 and 8.10.2
Besides being newer, GHC version 8.10.2 comes preinstalled on GitHub
Actions environments; using it slightly speeds up CI tests.
2020-09-20 22:57:51 +02:00
Albert Krewinkel
4b459b49ea
CI: remove duplicate build step on macOS 2020-09-20 22:57:39 +02:00
Albert Krewinkel
fbdc0b3ad4
cabal.project: disallow base16-bytestring-1.*
This is a temporary fix to work around a missing constraint in package
text-conversions. It should be removed once a new revision or new
version fixes the underlying issue.
2020-09-20 21:32:54 +02:00
John MacFarlane
ce33a97ad4 cabal.project - use dev version of pandoc-citeproc. 2020-09-20 09:58:58 -07:00
John MacFarlane
00eb7543bf Use dev version of pandoc-citeproc. 2020-09-20 09:57:53 -07:00
Albert Krewinkel
c9e7ccba6f
pandoc.cabal: allow hslua 1.2 again
Sporadic test failures also happen with hslua-1.1.*, so there is no need
to exclude the newer version.

This reverts commit 315b5a4836.
2020-09-20 09:20:59 +02:00
John MacFarlane
26ed7fb4f9 Command line options: use normalizePath in more places.
See #5127.  It is now used everywhere a file argument can be used.

Closes #5127.
2020-09-19 22:35:50 -07:00
argent0
ba9bedef23
Asciidoctor images (#6671)
Support `Asciidoctor`'s block figures.

Closes #6538.
2020-09-19 18:22:52 -07:00
Mauro Bieg
caa225ad82
Add CSS to default HTML template (#6601) 2020-09-19 16:13:50 -07:00
John MacFarlane
d5a7abd47f Change deprecated Builder.isNull to null. 2020-09-19 16:00:22 -07:00
John MacFarlane
277ea0df3d stack.yaml - use latest texmath, commonmark-pandoc. 2020-09-19 11:16:10 -07:00
John MacFarlane
1dd9f8b654 Use released pandoc-types 1.22. 2020-09-19 09:58:16 -07:00
John MacFarlane
a26ec96d89 LaTeX writer: fix spacing issue with list in definition list.
When a list occurs at the beginning of a definition list definition,
it can start on the same line as the label, which looks bad.

Fix that by starting such lists with an `\item[]`.
2020-09-15 17:59:03 -07:00
Christian Despres
a2d343420f
LaTeX reader: fix improper empty cell filtering (#6689) 2020-09-15 13:36:11 -07:00
John MacFarlane
6ef38e9ab3 Fix pandoc-templates target to include all partials. 2020-09-15 10:35:32 -07:00
John MacFarlane
c41ec933de Use latest skylighting. 2020-09-14 11:05:14 -07:00