Commit graph

11763 commits

Author SHA1 Message Date
John MacFarlane
23ca15e7ad Man reader: allow empty simple table cells. 2018-10-25 22:53:48 -07:00
John MacFarlane
1ee594bf0e Man reader: be more forgiving with table options. 2018-10-25 22:40:42 -07:00
John MacFarlane
444485d62c Man reader: be more forgiving when parsing tables.
We now look only at the last row of the format specifiers,
if there is more than one row.  (This is the default.)
2018-10-25 22:35:55 -07:00
John MacFarlane
e752e3d3c7 Groff tokenizer: handle \s+2, etc. 2018-10-25 22:35:35 -07:00
John MacFarlane
3e3854fd4f Man reader: be more forgiving in parsing table format spec. 2018-10-25 22:21:04 -07:00
John MacFarlane
5945c3b011 Man reader: support tables.
Closes #4982.
2018-10-25 22:13:41 -07:00
Albert Krewinkel
096cbe6987 Lua: allow access to pandoc state (#5015)
* Lua: allow access to pandoc state

Lua filters and custom writers now have read-only access to most fields
of pandoc's internal state via the global variable `PANDOC_STATE`.

* Lua: allow iterating through fields of PANDOC_STATE

* Lua filters doc: describe CommonState

* Lua filters doc: mention global variable PANDOC_STATE

* Lua: add access to logs

Log messages can currently only be printed, but not decomposed.
2018-10-25 22:12:14 -07:00
John MacFarlane
8f9ab3db25 Man reader: handle tables.
This still needs a bit of work. In particular, we should
try to produce Plain cells when possible.

See #4982.
2018-10-25 15:59:39 -07:00
John MacFarlane
20032c440b Groff tokenizer: make TableFormat a structured type. 2018-10-25 13:07:39 -07:00
John MacFarlane
50b4f0cce0 Groff tokenizer: introduced type synonym for TableFormat. 2018-10-25 12:40:53 -07:00
John MacFarlane
d009a0fa52 Groff tokenizer: Add structured repr of table options. 2018-10-25 12:35:58 -07:00
John MacFarlane
31759731e7 Implemented groff table lexing.
We don't yet actually parse the tables in man, but most
of the hard work is done.

Also:

Export lexGroff from T.P.Readers.Groff, instead of
lower-level definitions.

Rename things in T.P.Readers.Groff as `*Groff` rather
than `*Man`.
2018-10-25 12:01:35 -07:00
Alexander Krotov
07fc850172 Muse writer: add support for grid tables 2018-10-25 18:35:02 +03:00
John MacFarlane
02e515cada Groff reader: got \f[] working properly. 2018-10-25 00:16:35 -07:00
John MacFarlane
718a947f7d Man reader: fixed nested emphasis. 2018-10-25 00:06:37 -07:00
John MacFarlane
bc7b4d944a T.P.Readers.Groff: use FontSpec, not list of FontKind. 2018-10-24 23:21:35 -07:00
John MacFarlane
c5a42e695e Man reader: improve source posiiton info. 2018-10-24 22:44:51 -07:00
John MacFarlane
e4726518af T.P.Readers.Groff: improve LinePart.
Separate font change and font size change tokens.

With this change, emphasis no longer works. This needs to
be implemented in the parser, not the lexer.
2018-10-24 22:04:51 -07:00
John MacFarlane
6c71100fcf Added Text.Pandoc.Readers.Groff.
This is an internal module that exports a tokenizer for groff
formats.

Closes #4998.
2018-10-24 17:38:08 -07:00
John MacFarlane
123381765c Use latest texmath. 2018-10-24 12:06:37 -07:00
Alexander Krotov
ba3ba602ea Use foldl' instead of maximum to account for empty lists 2018-10-24 19:31:30 +03:00
John MacFarlane
f1c476fe3c Ms writer - removed old escapeBar.
We don't need this now that we use @ for delim.
2018-10-24 09:12:28 -07:00
John MacFarlane
3a9f807052 GroffChar: added @ to list of standard escapes.
Because we use it as a delimiter for tables (in man)
and for math (in ms).
2018-10-24 08:59:10 -07:00
John MacFarlane
bac25e82d3 Rename manEscapes -> standardEscapes 2018-10-24 08:51:42 -07:00
Alexander Krotov
f859162554 Vimwiki reader: test empty preformatted text 2018-10-24 15:07:05 +03:00
Alexander Krotov
5f7eaaf893 Muse reader: simplify museToPandocTable
to get rid of partial functions (head, tail, maximum)
2018-10-24 11:36:37 +03:00
John MacFarlane
55068c4cae Man reader: Add placeholder for table token. 2018-10-23 23:35:37 -07:00
John MacFarlane
8efb8975ed Groff writer character escaping changes.
T.P.GroffChar:  replaced `essentialEscapes` with `manEscapes`,
which includes all the escapes mentioned in the groff_man manual.

T.P.Writers.Groff: removed escapeCode; changed parameter on
escapeString from Bool to new type `EscapeMode`.
Rewrote `escapeString`.
2018-10-23 21:44:07 -07:00
John MacFarlane
556e3eef4a Man reader: ALlow empty definition list definitions. 2018-10-23 13:19:06 -07:00
John MacFarlane
8f428c4e10 Man reader: handle implicitly closed RS, nf, EX.
These are implicitly closed by a new section command.
(See e.g. tiffcp.1)
2018-10-23 12:48:17 -07:00
John MacFarlane
b0fa2b954f Man reader: handle .if. 2018-10-23 11:47:12 -07:00
John MacFarlane
c916a07bad Man reader: ignore \s font size changes. 2018-10-23 10:49:21 -07:00
John MacFarlane
55315ed0d8 Man reader: primitive conditional support.
We skip conditionals in general, except

     .ie n

which is used commonly in man pages to test for nroff.
For these we evaluate the 'if' portion.

Closes #4996.
2018-10-23 10:35:35 -07:00
John MacFarlane
81d2372f57 Man reader: support .nop. 2018-10-23 09:37:28 -07:00
Alexander Krotov
0dfe999302 Fix Muse writer style 2018-10-23 18:51:52 +03:00
Alexander Krotov
509d2ea525 Simplify Text.Pandoc.Pretty.offset 2018-10-23 13:35:49 +03:00
Alexander Krotov
ec2d86e34f Muse writer: use length instead of realLength to calculate definition indentation
Muse parsers don't take character width into account when calculating indentation.
2018-10-23 13:35:49 +03:00
John MacFarlane
a7819c6440 Man reader: allow any nonspace char for macro name. 2018-10-23 00:49:57 -07:00
John MacFarlane
c6590b193d Man reader: handle \fS as a no-op.
This changes font, but to what?  Can't find in documentation.
2018-10-23 00:18:41 -07:00
John MacFarlane
8b82667f8a Man reader: allow lowercase b,i etc. for font commands.
These seem to work.
2018-10-23 00:07:39 -07:00
John MacFarlane
bda1c0da81 Man reader: Handle optional argument in ME, UE macros.
Closes #4995.
2018-10-22 23:56:02 -07:00
John MacFarlane
261cbad0ef Groff writers escaping changes.
- Improve escaping of accented characters with `--ascii`.
  Combining accents are now handled properly.
- Don't escape spaces and tabs in code blocks. This doesn't
  seem to be necessary.
2018-10-22 23:48:12 -07:00
John MacFarlane
8b204dda77 T.P.Writers.Groff - don't export escapeChar. 2018-10-22 23:48:12 -07:00
Brian Leung
7eea5c62ed LaTeX reader: add support for nolinkurl command. (#4992) 2018-10-22 23:36:44 -07:00
Nick Fleisher
19e0fcb68b Add viz. to abbreviations file (#5007) 2018-10-22 18:45:46 -07:00
Alexander Krotov
4275d58a9f Muse writer: do not insert newline before lists 2018-10-23 03:38:59 +03:00
Alexander Krotov
1d3460c0b0 Muse writer: code cleanup 2018-10-23 03:38:59 +03:00
John MacFarlane
0c7ac0c862 GroffChar: Proper combining characters for combining accents. 2018-10-22 16:02:04 -07:00
John MacFarlane
87fa837569 Man reader: improved combining accents.
We now handle e.g. `\[A ho]`.
2018-10-22 15:49:54 -07:00
John MacFarlane
0327226d4c Man reader: don't parse \[ul] as unicode escape. 2018-10-22 12:05:34 -07:00