Commit graph

11628 commits

Author SHA1 Message Date
Albert Krewinkel
e3b85517d6
Lua filters doc: fix and add more links to types 2018-10-18 22:27:14 +02:00
John MacFarlane
5935718628 Remove unneeded import. 2018-10-18 10:57:46 -07:00
John MacFarlane
3fbbdd92fb linux Dockerfile - use released static build of stack. 2018-10-18 10:31:16 -07:00
John MacFarlane
efbb329f1a Groff escaping changes.
- `--ascii` is now turned on automatically for man output, for
  portability.  All man output will be escaped to ASCII.
- In T.P.Writers.Groff, `escapeChar`, `escapeString`, and
  `escapeCode` now take a boolean parameter that selects
  ascii-only output.  This is used by the Ms writer for
  `--ascii`, instead of doing an extra pass after writing
  the document.
- In ms output without `--ascii`, unicode is used whenever
  possible (e.g. for double quotes).
- A few escapes are changed: e.g. `\[rs]` instead of `\\` for
  backslash, and `\ga]` instead of `` \` `` for backtick.
2018-10-18 10:21:34 -07:00
John MacFarlane
bbd94eae2b Add Text.Pandoc.GroffChar.
This will hold common escaping data for groff characters.
2018-10-18 09:39:55 -07:00
John MacFarlane
24f388e1a7 man/ms writers: use \[at] for escaped @. 2018-10-17 17:39:42 -07:00
John MacFarlane
ebdb2deb0d Updated version bounds for containers and haddock-library.
Allow haddock-library 1.7 and containers 0.6.*.

Closes #4974.
2018-10-17 17:30:14 -07:00
John MacFarlane
f48960b75f Move common groff functions to Text.Pandoc.Writers.Groff
(unexported module).  These are used in both the man and ms
writers.

Moved groffEscape out of Text.Pandoc.Writers.Shared [cancels earlier
API change from adding it, which was after last release].

This fixes strong/code combination on man (should be `\f[CB]` not
`\f[BC]`), mentioned in #4973.

Updated tests.

Closes #4975.
2018-10-17 17:26:37 -07:00
Alexander Krotov
b3feaba6af Man writer: use \f[R] instead of \f[] to reset font
Fixes #4973
2018-10-17 18:29:07 +03:00
Alexander Krotov
6fc812485e Muse reader: allow examples to be indented with tabs 2018-10-17 18:17:30 +03:00
Alexander Krotov
1071732719 Muse reader: remove indentation from examples indicated by {{{ and }}} 2018-10-17 13:57:05 +03:00
John MacFarlane
5c42101ee9 Merge branch 'groff_reader' of https://github.com/Yanpas/pandoc into Yanpas-groff_reader 2018-10-16 18:39:20 -07:00
Yan Pas
2c4e8941a7 update cabal, add man-reader 2018-10-17 01:34:12 +03:00
Yan Pas
7741cdbf04 added old-style test 2018-10-17 00:21:52 +03:00
John MacFarlane
63b3886bfe Added note to customizing-pandoc. 2018-10-16 10:42:48 -07:00
John MacFarlane
a552af612e customizing-pandoc: add suggestion about 'pandoc -t native'. 2018-10-16 09:57:10 -07:00
John MacFarlane
e32220ef4f Revised customizing-pandoc.md and included TODOs. 2018-10-16 09:54:59 -07:00
Alexander Krotov
7f814c5339 Muse reader: simplify "atStart" 2018-10-16 19:26:54 +03:00
Mauro Bieg
a5fc46cb8f add docs about customizing pandoc (#4972)
closes #3288
2018-10-16 09:10:34 -07:00
Alexander Krotov
d2262122d3 Muse reader: code cleanup 2018-10-16 18:40:52 +03:00
Alexander Krotov
50aa7bfddc Muse reader: simplify "commonPrefix" implementation 2018-10-16 16:23:59 +03:00
Alexander Krotov
d3ba2fc3d8 Muse reader: simplify emphasis parsing 2018-10-16 15:56:07 +03:00
Albert Krewinkel
b831bd9fc1 Lua filter docs: extend description of table fields 2018-10-16 08:01:59 +02:00
John MacFarlane
885cbfd420 Only override --quickcheck-tests=N if N is not default value (100).
Some of the round-trip tests are set to do a maximum of 25
trials when the default value is given.

Closes #4956.
2018-10-15 22:15:43 -07:00
John MacFarlane
85394d4034 LaTeX reader: small verbatim mode cleanups. 2018-10-15 17:28:37 -07:00
John MacFarlane
252398a4f3 LaTeX reader: withVerbatimMode now does nothing if already in
verbatim mode.  Previously nested uses wouldn't work properly.
2018-10-15 17:28:10 -07:00
John MacFarlane
5bd852c5db LaTeX reader: simplified type on doMacros'. 2018-10-15 17:16:01 -07:00
Yan Pas
ce27bf9a02 builders 2018-10-16 03:12:06 +03:00
John MacFarlane
ae51de3b3d LaTeX reader: small efficiency improvement. 2018-10-15 15:54:49 -07:00
John MacFarlane
1db585689a LaTeX reader: tokenize before pulling tokens,
rather than after.  This has some performance penalty
but is more reliable.

Closes #4408.
2018-10-15 15:54:49 -07:00
Yan Pas
1684e918b2 font as a set of styles, mono font support 2018-10-16 01:53:04 +03:00
Albert Krewinkel
7e9e24b8bc Lua filter docs: describe Attr type 2018-10-15 23:01:23 +02:00
Albert Krewinkel
f6559e5def Lua filter docs: render field names as code 2018-10-15 22:52:02 +02:00
Yan Pas
2ca50e95b7 style issues 2018-10-15 23:35:27 +03:00
Albert Krewinkel
d9f179f7f2 Lua filter docs: fix typos 2018-10-15 22:17:12 +02:00
John MacFarlane
788b1bb3d8 LaTeX reader: more care with verbatim mode in macro definitions.
This solves some of the issues in #4408, but it is fragile and may
introduce new problems. We really need to change the approach
fundamentally and expand macros before pulling tokens from the stream,
rather than after.
2018-10-15 12:32:38 -07:00
Albert Krewinkel
aed7aecfc3 Lua filter docs: complete, fix MetaValue documentation 2018-10-15 21:10:05 +02:00
Albert Krewinkel
8a00b30e40 Lua pandoc module: ensure MetaList elements behave like Lists
Methods usable on Lists can also be used on MetaList objects.
2018-10-15 21:08:39 +02:00
Albert Krewinkel
a444321be8 Lua pandoc module: fix MetaList constructor
Passing a MetaList object to the constructor `pandoc.MetaList` now
returns the passed list as a MetaList. This is consistent with the
constructor behavior when passed an (untagged) list.

Previously, the constructor used to create a new MetaList with the
passed MetaList as its only element.
2018-10-15 21:00:50 +02:00
John MacFarlane
d04ded4ca9 LaTeX reader: more careful placement of withVerbatimMode.
for macros
2018-10-15 11:59:05 -07:00
John MacFarlane
6f6ad0514d LaTeX reader: make macroDef polymorphic and allow in inline context.
Otherwise we can't parse something like
```
\lowercase{\def\x{Foo}}
```
I have actually seen tex like this in the wild.
2018-10-15 11:46:31 -07:00
John MacFarlane
e6ee032a6d LaTeX reader: improved parsing of \def, \let.
We now correctly parse:

```
\def\bar{hello}
\let\fooi\bar
\def\fooii{\bar}
\fooi +\fooii

\def\bar{goodbye}
\fooi +\fooii
```
2018-10-15 11:27:04 -07:00
John MacFarlane
68ec838014 LaTeX reader: Fix small regression in pattern argumnents...
introduced in last commit.
2018-10-15 09:46:15 -07:00
John MacFarlane
41663e9eef More refactoring of LaTeX reader code. 2018-10-15 00:37:17 -07:00
John MacFarlane
8f5cd946db T.P.R.LaTeX.Parsing: moved more functions. 2018-10-15 00:37:17 -07:00
John MacFarlane
22f81f78bd Added failing test case for macros. 2018-10-15 00:37:17 -07:00
John MacFarlane
78ebbc6eef LaTeX reader: improve parsing of \def argspec. 2018-10-15 00:37:17 -07:00
John MacFarlane
e752a027f1 T.P.R.LaTeX.Parsing: moved some functions up a level. 2018-10-15 00:37:17 -07:00
Albert Krewinkel
1435d0b079
Lua filters doc: add ReaderOptions to list of objects 2018-10-15 07:56:35 +02:00
Albert Krewinkel
594d36437b
Lua filters: rename ReaderOptions fields, use snake_case
Snake case is used in most variable names, using camelCase for these
fields was an oversight. A metatable is added to ensure that the old
field names remain functional.
2018-10-15 07:56:35 +02:00