Commit graph

9341 commits

Author SHA1 Message Date
John MacFarlane
d1444b4ecd RST reader/writer: support unknown interpreted text roles...
...by parsing them as Span with "role" attributes.
This way they can be manipulated in the AST.

Closes #3407.
2017-08-17 16:01:44 -07:00
John MacFarlane
b1f6fb4af5 HTML reader: support column alignments.
These can be set either with a `width` attribute or
with `text-width` in a `style` attribute.

Closes #1881.
2017-08-17 12:08:32 -07:00
John MacFarlane
b9b35059f6 LaTeX reader: support \lq, \rq. 2017-08-17 12:08:32 -07:00
ickc
2a0e2e6fd6 slidy uses https instead of http (#3848)
grep -rl 'http://www.w3.org/Talks/Tools/Slidy2' . | xargs sed -i 's/http:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/https:\/\/www\.w3\.org\/Talks\/Tools\/Slidy2/g'
2017-08-17 10:11:49 -07:00
John MacFarlane
c175317d03 LaTeX reader: support \textquoteleft|right, \textquotedblleft|right.
Closes #3849.
2017-08-17 10:09:35 -07:00
John MacFarlane
ae61d5f57d LaTeX reader: rudimentary support for \hyperlink. 2017-08-16 10:56:16 -07:00
John MacFarlane
db715ca847 LaTeX reader: use Link instead of Span for \ref.
This makes more sense semantically and avoids unnecessary
Span [Link] nestings when references are resolved.
2017-08-16 10:56:12 -07:00
John MacFarlane
c6ec189a96 Revision to binary format output to stdout:
We now allow default output to stdout when it can be
determined that the output is being piped.  (On Windows,
as mentioned before, this can't be determined.)

Using '-o -' forces output to stdout regardless.
2017-08-16 10:39:34 -07:00
schrieveslaach
cf4b40162d LaTeX reader: add Support for glossaries and acronym package (#3589)
Acronyms are not resolved by the reader, but acronym and glossary information is put into attributes on Spans so that they can be processed in filters.
2017-08-16 10:24:46 -07:00
John MacFarlane
708bb8afe4 Fix import in PDF. 2017-08-16 10:13:16 -07:00
John MacFarlane
68434957d6 Fixed command test #2994 on Windows. 2017-08-16 09:47:25 -07:00
John MacFarlane
61cf3affa9 Change behavior with binary format output to stdout.
Previously, for binary formats, output to stdout was disabled
unless we could detect that the output was being piped (and not
sent to the terminal).  Unfortunately, such detection is not
possible on Windows, leaving windows users no way to pipe binary
output.  So we have changed the behavior in the following way:

* If the -o option is not used, binary output is never sent
  to stdout by default; instead, an error is raised.
* IF '-o -' is used, binary output is sent to stdout, regardless
  of whether it is being piped. This works on Windows too.
2017-08-16 09:45:12 -07:00
Albert Krewinkel
7a40f4865f Ensure hslua is build for 32 bits on windows i386
This prevents some otherwise hard to find and hard miscalculations in
lua filters.
2017-08-16 15:47:05 +02:00
Albert Krewinkel
9b31835530 Update to hslua-0.8.0
hslua no longer provides lua stack instances for Int and Double, the
necessary instances are added to the Custom writer and the lua filtering
system.
2017-08-16 15:47:05 +02:00
John MacFarlane
f8b6a224ae Remove initial check for pdf creating program.
Instead, just try running it and raise the exception if it
isn't found at that point.

This improves things for users of Cygwin on Windows, where
the executable won't be found by `findExecutable` unless
`.exe` is added.

The same exception is raised as before, but at a later
point.

Closes #3819.
2017-08-15 21:17:20 -07:00
John MacFarlane
97fe6c35b5 Docx writer: fixed a regression (infinite loop on certain lists).
Bug was introduced by commit a868b238f2.
2017-08-15 14:05:10 -07:00
John MacFarlane
892a4edeb1 Implement multicolumn support for slide formats.
The structure expected is:

    <div class="columns">
      <div class="column" width="40%">
        contents...
      </div>
      <div class="column" width="60%">
        contents...
      </div>
    </div>

Support has been added for beamer and all HTML slide formats.

Closes #1710.

Note:  later we could add a more elegant way to create
this structure in Markdown than to use raw HTML div elements.
This would come for free with a "native div syntax" (#168).
Or we could devise something specific to slides
2017-08-14 23:17:44 -07:00
John MacFarlane
23d29ee10c Use latest commit for pandoc-citeproc. 2017-08-14 15:45:18 -07:00
John MacFarlane
9c577b17b7 Update tests for changes to LaTeX template. 2017-08-14 13:19:54 -07:00
John MacFarlane
38578ad06c Test fixes so we can find data files.
In old tests & command tests, we now set the environment variable
pandoc_datadir.

In lua tests, we set the datadir explicitly.
2017-08-14 13:03:26 -07:00
Andrew Dunning
ceda566a5e Fix hyperref options clash (#3847)
Avoids an options clash when loading a package (e.g. `tufte-latex`) that uses `hyperref` settings different from those in the template (introduced in <feffd7c64a>).
2017-08-14 12:33:46 -07:00
John MacFarlane
64ff86514b Added example of setting date with lua filter. 2017-08-14 09:57:01 -07:00
John MacFarlane
319d7ed6ff Changed command test for #2994 so it actually tests the writer. 2017-08-14 00:00:50 -07:00
John MacFarlane
c7cbd3ddc2 Fixed command tests to set local path.
Previously we just tacked on a directory to the command
line, but that didn't work when we e.g. used a pipe for round tripping,
with two invocations of pandoc.
2017-08-13 23:59:38 -07:00
John MacFarlane
6aef1bd228 Better handle complex \def macros as raw latex. 2017-08-13 12:45:04 -07:00
John MacFarlane
425b731050 LaTeX reader: Allow @ as a letter in control sequences.
@ is commonly used in macros using `\makeatletter`.
Ideally we'd make the tokenizer sensitive to `\makeatletter`
and `\makeatother`, but until then this seems a good change.
2017-08-13 12:24:06 -07:00
John MacFarlane
bf9ec6dfd8 LaTeX reader: fix \let\a=0 case, with single character token. 2017-08-13 12:16:51 -07:00
John MacFarlane
f9656ece4e Resolve references to section numbers in LaTeX reader. 2017-08-13 11:48:44 -07:00
John MacFarlane
253a7c6201 LaTeX reader: track header numbers and correlate with labels. 2017-08-13 11:30:17 -07:00
schrieveslaach
2845ab5976 Put content of \ref, \label commands into span… (#3639)
* Put content of `\ref` and `\label` commands into Span elements so they can be used in filters.
* Add support for `\eqref`
2017-08-13 10:58:45 -07:00
John MacFarlane
8f65590ce9 CommonMark writer: prefer pipe tables to HTML tables...
...even if it means losing relative column width information.
See #3734.
2017-08-13 10:43:43 -07:00
John MacFarlane
506866ef73 Markdown writer: Use pipe tables if raw_html disabled...
and `pipe_tables` enabled, even if the table has relative
width information.

Closes #3734.
2017-08-13 10:37:24 -07:00
John MacFarlane
39066eba1d Added some Functor constraints needed for ghc 7.8. 2017-08-13 10:00:46 -07:00
Albert Krewinkel
3d87e2080a
Delete Text.Pandoc.Lua.SharedInstances
Stack instances for common data types are now provides by hslua. The
instance for Either was useful only for a very specific case; the
function that was using the `ToLuaStack Either` instance was rewritten
to work without it.

Closes: #3805
2017-08-13 17:48:43 +02:00
Albert Krewinkel
6e6cee454e Text.Pandoc.Lua: cleanup element walking code
WalkM is general enough to work in any monad, not just IO. Also get rid
of the LuaException type, sufficient to use the one defined in hslua.
2017-08-13 17:24:17 +02:00
Albert Krewinkel
b9c7adf02e
Text.Pandoc.Lua: Optimize performance by using raw table access
Raw table accessing functions never call back into haskell, which allows
the compiler to use more aggressive optimizations. This improves lua
filter performance considerably (⪆5% speedup).
2017-08-13 14:25:36 +02:00
Albert Krewinkel
2dc3dbd68b Use hslua >= 0.7, update Lua code 2017-08-13 14:23:54 +02:00
John MacFarlane
418bda8128 Docx writer: pass through comments.
We assume that comments are defined as parsed by the
docx reader:

    I want <span class="comment-start" id="0" author="Jesse Rosenthal"
    date="2016-05-09T16:13:00Z">I left a comment.</span>some text to
    have a comment <span class="comment-end" id="0"></span>on it.

We assume also that the id attributes are unique and properly
matched between comment-start and comment-end.

Closes #2994.
2017-08-12 22:59:53 -07:00
John MacFarlane
be9957bddc Escape MetaString values (as added with --metadata flag).
Previously they would be transmitted to the template without
any escaping.

Note that `--M title='*foo*'` yields a different result from

    ---
    title: *foo*
    ---

In the latter case, we have emphasis; in the former case, just
a string with literal asterisks (which will be escaped
in formats, like Markdown, that require it).

Closes #3792.
2017-08-12 20:27:42 -07:00
John MacFarlane
0ab8670a0e LaTeX reader: Fixed space after \figurename etc. 2017-08-12 13:40:28 -07:00
John MacFarlane
3897df868a LaTeX reader: support \chaptername, \partname, \abstractname, etc.
See #3559.
Obsoletes #3560.
2017-08-12 13:28:18 -07:00
John MacFarlane
f7346bbfc1 Added Listing to Term.
So far only added to English.
2017-08-12 13:19:50 -07:00
John MacFarlane
cc6db2aa8f Added new translations. 2017-08-12 13:18:09 -07:00
John MacFarlane
78e61cedd0 Added Encl, Glossary to Term 2017-08-12 13:14:27 -07:00
John MacFarlane
f035f0ffe3 LaTeX reader: have \setmainlanguage set lang in metadata. 2017-08-12 12:34:36 -07:00
John MacFarlane
444f8e9569 Improved error report on loading translation file. 2017-08-12 12:25:33 -07:00
John MacFarlane
622c3f2fa6 Change to yaml for translation files. 2017-08-12 12:17:38 -07:00
John MacFarlane
b6e0add76a Set user data dir at beginning, so readDataFile has access to it. 2017-08-12 12:15:40 -07:00
John MacFarlane
467ca2a1ad Fixed data-dir on translations tests. 2017-08-12 10:39:25 -07:00
John MacFarlane
dbb81f513c More translation tests. 2017-08-11 23:59:27 -07:00