Commit graph

13029 commits

Author SHA1 Message Date
John MacFarlane
34e6464e30 Improve sample --defaults file in MANUAL.txt. 2019-10-11 08:57:49 -07:00
John MacFarlane
8a64bd0abf Allow output-file to be null in --defaults. 2019-10-11 08:57:34 -07:00
John MacFarlane
c468951d8e Remove redundant import. 2019-10-11 08:20:31 -07:00
John MacFarlane
1985199ce8 stack.yaml - re-add HsYAML-aeson, as pandoc-citeproc uses it 2019-10-11 08:20:27 -07:00
John MacFarlane
7388cd3e7a Improve parsing of --defaults.
- Add FromYAML instances to Opt and to all subsidiary types.
- Remove the use of HsYAML-aeson, which doesn't give good
  position information on errors.
- Rename some fields in Opt to better match cli options or
  reflect what the ycontain [API change]:

  + optMetadataFile -> optMetadataFiles
  + optPDFEngineArgs -> optPDFEngineOpts
  + optWrapText -> optWrap
- Add IpynbOutput enumerated type to Text.Pandoc.App.Opts.
  Use this instead fo a string for optIpynbOutput.
- Add FromYAML instance for Filter in Text.Pandoc.Filters.

With these changes parsing of defaults files should be
complete and should give decent error messages.

Now (unlike before) we get an error if an unknown field
is used.
2019-10-10 23:21:18 -07:00
John MacFarlane
2523941453 Fix examplel for defaults. 2019-10-10 10:34:35 -07:00
John MacFarlane
5085fe605a Added documentation for --defaults. 2019-10-10 10:33:35 -07:00
John MacFarlane
33f70e9819 Add -d as synonym for --defaults. 2019-10-10 10:12:23 -07:00
John MacFarlane
558b91801a Reorder options in --help. 2019-10-10 10:12:05 -07:00
John MacFarlane
a3cd74c29b --metadata-file: when multiple files specified, second takes precedence...
on conflicting fields.  This changes earlier behavior (but not in
a release), where first took precedence.

Note that this may seem inconsistent with the behavior of
multiple YAML blocks within a document, where the first takes
precedence.  Still, it is convenient to be able to override
defaults with options later on the command line.
2019-10-10 10:00:45 -07:00
John MacFarlane
68b09a6d81 Make some writers sensitive to 'unlisted' class on headings.
If this is present on a heading with the 'unnumbered' class,
the heading won't appear in the TOC.  This class has no
effect if 'unnumbered' is not also specified.

This affects HTML-based writers (including slide shows
and epub), LateX (including beamer), RTF, and PowerPoint.
Other writers do not yet support `unlisted`.

Closes #1762.
2019-10-10 09:15:40 -07:00
John MacFarlane
2b1361e738 Remove unnecessary import. 2019-10-10 08:36:27 -07:00
John MacFarlane
fcefcfec39 --defaults: add .yaml extension if absent, look in user data dir...
under "defaults" subdirectory.
2019-10-09 23:29:25 -07:00
John MacFarlane
ff1df241a9 T.P.App.Opt: rename optReader, optWriter as optFrom, optTo.
This will allow to: and from: in defaults.
2019-10-09 21:54:41 -07:00
John MacFarlane
070e098b48 Make sure that input-files works in --default files. 2019-10-09 17:51:33 -07:00
John MacFarlane
a3729ef2da RST writer: proper handling of :align: on figures, images.
When the image has the `align-right` (etc.) class, we now use
an `:align:` attribute.

Closes #4420.
2019-10-09 15:05:22 -07:00
John MacFarlane
5ec9044288 Update s5 test for mathjax 3 change. 2019-10-09 14:32:30 -07:00
zorkow
f792c7900b Changes in try pandoc 2019-10-09 14:30:25 -07:00
zorkow
3c7f1bf96c Basic changes for MathJax 3. 2019-10-09 14:30:25 -07:00
John MacFarlane
8a77bbf6eb Update cabal.project to use dev version of doctemplates. 2019-10-09 14:23:29 -07:00
John MacFarlane
83702404af Initial implementation of --defaults option.
Need documentation.
2019-10-09 12:44:09 -07:00
John MacFarlane
5419988f22 T.P.App.Opt: Changed optMetadata to Meta, to allow structured values.
[API change]

The current behavior of the `--metadata` option stays the same.
2019-10-09 11:46:20 -07:00
John MacFarlane
3351dcfc45 Add HsYAML-aeson to build-depends 2019-10-09 11:01:33 -07:00
John MacFarlane
3aa069e1d5 Change optVariables from [(String, String)] to Context Text.
In Text.Pandoc.App.Opt [API change].
2019-10-09 11:01:33 -07:00
John MacFarlane
aceee9ca48 Options.WriterOptions: Change type of writerVariables to Context Text.
This will allow structured values.

[API change]
2019-10-09 11:01:33 -07:00
John MacFarlane
1b10b5cea9 Use th to derive json instance for LineEnding. 2019-10-08 08:02:24 -07:00
John MacFarlane
34c61fcad5 Text.Pandoc.Options: change To/FromJSON instances for...
HTMLMathMethod, CiteMethod, ObfuscationMethod, TrackChanges, WrapOption,
TopLevelDivision, ReferenceLocation, HTMLSlideVariant.

In each case we use lowercase (or hyphenated lowercase) for
constructors to line up more closely with command-line option
values.

This is a breaking change for those who manually decode or encode
JSON for these data types (e.g. for ReaderOptions or WriterOptions).

See #5790.
2019-10-07 22:23:51 -07:00
John MacFarlane
e4ccfeab8c Shored.camelCaseToHyphenated: handle ABCDef = abc-def. 2019-10-07 21:31:03 -07:00
John MacFarlane
8fb9a0d168 Remove derive_json_via_th flag; always use TH.
This cuts down on code duplication and reduces the chance
for errors.  See #4083.
2019-10-07 21:23:50 -07:00
John MacFarlane
b235a187dc Make derive_json_via_th flag false by default 2019-10-07 17:33:41 -07:00
John MacFarlane
3f28e332bf Remove misleading sentence in --variables documentation. 2019-10-07 11:54:51 -07:00
John MacFarlane
3c58cc4f33 Remove redundant import. 2019-10-07 10:24:47 -07:00
John MacFarlane
da070bea47 Use typeMismatch. 2019-10-07 00:04:47 -07:00
John MacFarlane
6e537aeda8 T.P.App.Opt: custom FromJSON instance for LineEnding.
So either CRLF or crlf will work.
2019-10-06 23:48:34 -07:00
John MacFarlane
3ef0cdd8f9 Opt: Change optHighlightStyle to a Maybe String instead of Maybe Style.
Do the parsing/loading of themes later, after option parsing.
2019-10-06 23:15:52 -07:00
John MacFarlane
5f8254c4b9 Code cleanup 2019-10-06 22:26:26 -07:00
John MacFarlane
fcfdc8210f Text.Pandoc.App.Opt: Remove optBaseHeaderLevel from Opt.
We now just use optShiftHeadingLevelBy, to avoid redundancy.
2019-10-06 21:31:28 -07:00
John MacFarlane
cf1703396c Text.Pandoc.App.Opt: Change optShiftHeadingLevel to optShiftHeadingLevelBy...
to match the option.
2019-10-06 16:55:12 -07:00
John MacFarlane
ceeb565203 stack.yaml - added some missing flags 2019-10-06 16:53:23 -07:00
John MacFarlane
2e35eafd12 Text.Pandoc.App.Opt: more convenient To/FromJSON instances.
Make the field names like `strip-empty-paragraphs` rather
than `optStripEmptyParagraphs`.
2019-10-06 16:25:05 -07:00
John MacFarlane
175c57a966 Clarify that --dpi provides a default and doesn't override...
dpi values specified in the images themselves.  See #5721.
2019-10-06 09:32:45 -07:00
John MacFarlane
7d25a7f3fe release-candidate.yml: add zip for windows. 2019-10-05 10:17:06 -07:00
John MacFarlane
d40349d541 Update release-candidate.yml for GitHub actions.
Adds builds for macos and for both 32- and 64-bit windows.
2019-10-05 10:01:04 -07:00
John MacFarlane
c1015abb4d windows rc: build 32- and 64-bit msi. 2019-10-04 22:43:39 -07:00
John MacFarlane
dd503df20a linux tarball: add architecture -amd64 to filename.
Now it will be: pandoc-VERSION-linux-ARCH.tar.gz
2019-10-04 22:00:17 -07:00
Alexander Krotov
6898445548 hlint Muse writer 2019-10-04 18:29:00 +03:00
Alexander Krotov
6a9cafc67a hlint Muse reader tests 2019-10-04 18:28:53 +03:00
Alexander Krotov
701ae8634e hlint FB2 reader 2019-10-04 18:28:45 +03:00
Alexander Krotov
8efc677368 Fix all hlint warnings in Muse reader 2019-10-04 18:22:05 +03:00
John MacFarlane
638c2ed460 Fix compiler warnings on ghc 8.8. 2019-10-04 07:20:51 -07:00