Commit graph

2032 commits

Author SHA1 Message Date
John MacFarlane
283f1e60cc Use parsec parsers to split locator.
This is easier to read and maintain.
Also, formatting is now stripped from the locator prefix,
so you can write e.g. '*p.* 33'.
2010-11-27 07:08:32 -08:00
John MacFarlane
044a9a6157 Added 'stringify' to Text.Pandoc.Shared. 2010-11-27 07:08:06 -08:00
John MacFarlane
0ca84f0d38 Markdown suffix parser fix.
If suffix doesn't begin with punctuation, include opening
comma and space in result.

Previously,

@item [only a suffix]

would result in something like

Doe (2002only a suffix)

because there was no opening delimiter.
2010-11-26 22:34:53 -08:00
John MacFarlane
0871a512d7 Split locator and suffix in Biblio rather than Markdown parser.
Patch from Nathan Gass.
2010-11-26 12:06:56 -08:00
John MacFarlane
e8516ff337 Set HOME in RunTests.
Patch from Nathan Gass.
2010-11-26 11:48:22 -08:00
John MacFarlane
0955a0e329 More flexible handling of --csl.
Look for csl files in ~/.csl if not found locally.
Add .csl extension if it is not provided.
2010-11-23 21:40:05 -08:00
John MacFarlane
1b1287e888 Removed citeproc flag and CPP conditionals. 2010-11-23 21:14:31 -08:00
John MacFarlane
be909d2bfc Fixed eol mistake in test. 2010-11-22 23:10:00 -08:00
John MacFarlane
b48fa0ea59 Check biblio for all citations, not just textual. 2010-11-22 23:09:30 -08:00
John MacFarlane
3c7c1d8574 Changed markdown citation tests.
Now the tests are produced in HTML format (so we can see all
formatting).  Also, we produce them in three different style,
chicago-author-date, ieee, and mhra.
2010-11-22 22:54:40 -08:00
John MacFarlane
8e71b5b279 Updated markdown-citations test for new citeproc changes. 2010-11-21 09:30:32 -08:00
John MacFarlane
7ef7d85b3f HTML reader: Export htmlTag. 2010-11-20 22:10:16 -08:00
John MacFarlane
254c67a4fb Made citeproc flag default to True. 2010-11-20 22:00:57 -08:00
John MacFarlane
05f5766abe Biblio: Check for == rather than /=.
This is more perspicuous.
2010-11-20 22:00:17 -08:00
John MacFarlane
3eef887dfa Citation related changes.
* Don't look for bibliography in ~/.pandoc.  Reason:  doing
  this requires a read + parse of the bibliography even when
  the document doesn't use citations.  This is a big performance
  drag on regular pandoc invocations.
* Only look for default.csl if the document contains references.
  Reason:  avoids the need to read and parse csl file when the
  document contains no references anyway.
* Removed findFirstFile from Shared.
2010-11-20 08:11:30 -08:00
John MacFarlane
46121aa2e1 Use default biblio.{xml,json,bib} in pandoc data dir if none specified. 2010-11-19 22:14:02 -08:00
John MacFarlane
9cb0581de6 Shared: Added findFirstFile, findDataFile, refactored readDataFile. 2010-11-19 22:13:30 -08:00
John MacFarlane
6390103509 Markdown citation parser: small refactoring for clarity. 2010-11-18 14:16:18 -08:00
John MacFarlane
bbb60a2586 If --csl not specified, read from data files or default.
Thus --csl behaves like --reference-odt, --template, etc.
2010-11-18 14:15:26 -08:00
John MacFarlane
482b4b8d73 Added default.csl to data files. 2010-11-18 14:14:20 -08:00
John MacFarlane
f3bb3c1ff1 Markdown citation parser improvements and test updates.
Now we handle a suffix after a bare locator, e.g.
@item1 [p. 30, suffix]
The suffix now includes any punctuation that introduces it.
A few tests fail because of problems with citeproc (extra space
before the suffix, missing space after comma separating multiple
page ranges in the locator).
2010-11-18 13:22:20 -08:00
John MacFarlane
aaf7de0dda Markdown reader: Revised parser for new citation syntax.
Suffixes and prefixes are now [Inline].  The locator is separated
from the citation key by a blank space.  The locator consists of
one introductory word and any number of words containing at
least one digit.  The suffix, if any, is separated from the locator
by a comma, and continues til the end of the citation.
2010-11-18 12:38:45 -08:00
John MacFarlane
dbe0cefc9a Biblio: Removed stringify; pass inline list to citeproc. 2010-11-17 15:36:17 -08:00
John MacFarlane
47c64d4fc4 Don't pass a [Str ""] as citationPrefix. 2010-11-17 15:35:53 -08:00
John MacFarlane
ce9fc2a37d Updated for changes in Citaiton type.
citationPrefix now [Inline] rather than String;
citationSuffix added.

This change presupposes no changes in citeproc-hs.
It passes a string for these values to citeproc-hs.
Eventually, citeproc-hs should use an [Inline] for
these as well.
2010-11-16 20:31:22 -08:00
John MacFarlane
f0b7945b20 Updated HCAR entry. 2010-11-16 19:03:15 -08:00
John MacFarlane
55e991614d Removed unneeded format argument in call to readBiblioFile. 2010-11-16 07:16:38 -08:00
John MacFarlane
d73a531d89 Biblio: don't add footnote if empty. 2010-11-16 07:15:30 -08:00
John MacFarlane
b158ae21a2 Improve handling of bibliography not found error. 2010-11-13 08:50:04 -08:00
John MacFarlane
7aecddd0f7 Replaced --biblio-file with --bibliography, removed --biblio-format.
Bibliography format is guessed from the file extension of the
bibliography.

Also, the bibliography entries are now read during option parsing.
2010-11-13 08:42:09 -08:00
John MacFarlane
1fa2973da6 Repairs to citation parser + citation test suite. 2010-11-12 19:30:59 -08:00
John MacFarlane
e88daeba11 Merge branch 'master' into citeproc 2010-11-12 18:57:37 -08:00
John MacFarlane
bf4d919989 Improvements to test suite for citations. 2010-11-12 18:46:34 -08:00
John MacFarlane
f272b81f85 Set LANG in test runner. 2010-11-12 18:40:16 -08:00
John MacFarlane
c2636e61d7 Treat argument as URI only if it has http(s) scheme.
Previously pandoc would treat the c: in some windowns filespecs
as a URI scheme and try to download... Thanks to Peter Wang for
pointing this out.
2010-11-12 18:30:50 -08:00
John MacFarlane
c44ff4c555 Added material for citation tests.
Currently they fail with a multibyte error from citeproc-hs
when it tries to read locale.
2010-11-12 00:38:31 -08:00
John MacFarlane
79bab2d210 Revised citation parsers for markdown reader.
Added a form for in-text citations:

@doe99 [30; see also @smith99].
2010-11-12 00:37:44 -08:00
John MacFarlane
5c6dc5767d Biblio: Use a Map for the lookup table. 2010-11-11 22:35:04 -08:00
John MacFarlane
1bfd8110af Merge branch 'master' into citeproc 2010-11-11 21:31:15 -08:00
John MacFarlane
36d4e649a6 Added support for textual citations (but not yet markdown syntax).
Patch from Andrea Rossato.
2010-11-11 21:30:34 -08:00
John MacFarlane
ca51bbbf16 HTML reader: don't parse raw HTML inside <code> tag.
Previously '<code><a>x</a></code>' would be parsed as
Code "<a>x</a>", which is not what you want.
2010-11-11 20:02:37 -08:00
John MacFarlane
83e6c01e4d Merge branch 'master' into citeproc 2010-11-09 22:52:36 -08:00
John MacFarlane
21556e37f4 Allow HTML comments as inline elements in markdown.
So,
aaa <!-- comment --> bbb
can be a single paragraph.
2010-11-09 22:51:02 -08:00
John MacFarlane
07775b5f4f cabal file: Made library and executable build-depends match. 2010-11-06 15:00:37 -07:00
John MacFarlane
23c6f56bc5 Removed CITEPROC CPP conditionals from library code.
By Cabal policy, the API should not change depending on flags.
2010-11-06 14:58:54 -07:00
John MacFarlane
f7f6b2427d Changes to use citeproc-hs 0.3. 2010-11-06 14:43:23 -07:00
John MacFarlane
db03741847 Removed Text.Pandoc.Definition, bump version to 1.7.
We now get Text.Pandoc.Definition from the new pandoc-types package.
This will make it possible for other programs to supply output
in Pandoc format, without depending on the whole pandoc package.
2010-11-05 17:06:47 -07:00
John MacFarlane
5871c4d51f Biblio: small fix to detection of punctuation (A. Rossato). 2010-11-04 09:11:15 -07:00
John MacFarlane
5e1dc6adda Biblio: Improve footnote generation.
Patch from Andrea Rossato.
2010-11-03 12:58:29 -07:00
John MacFarlane
075840231b Improve footnote generation of in-text citations w/ note styles.
Patch from Andrea Rossato.
2010-11-02 21:10:33 -07:00