aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog26
-rwxr-xr-xmake_osx_package.sh8
-rwxr-xr-xosx/osx-resources/InstallationCheck (renamed from osx-resources/InstallationCheck)0
-rw-r--r--osx/osx-resources/InstallationCheck.strings (renamed from osx-resources/InstallationCheck.strings)0
-rwxr-xr-xosx/uninstall-pandoc.pl81
-rw-r--r--pandoc.cabal9
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs2
-rw-r--r--src/Text/Pandoc/Shared.hs4
8 files changed, 122 insertions, 8 deletions
diff --git a/changelog b/changelog
index 5238e943f..e58f5516d 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,29 @@
+pandoc (1.12.4.1)
+
+ * Require highlighting-kate >= 0.5.8. Fixes a performance regression.
+
+ * Shared: `addMetaValue` now behaves slightly differently:
+ if both the new and old values are lists, it concatenates their
+ contents to form a new list.
+
+ * LaTeX reader:
+
+ + Set `bibliography` in metadata from `\bibliography` or
+ `\addbibresource` command.
+ + Don't error on `%foo` with no trailing newline.
+
+ * Org reader:
+
+ + Support code block headers (`#+BEGIN_SRC ...`) (Albert Krewinkel).
+ + Fix parsing of blank lines within blocks (Albert Krewinkel).
+
+ * Updated copyright notices (Albert Krewinkel).
+
+ * Added default.icml to data files so it installs with the package.
+
+ * Moved OSX package materials to osx directory. Added uninstall
+ script (thanks to Daniel T. Staal).
+
pandoc (1.12.4)
* Made it possible to run filters that aren't executable (#1096).
diff --git a/make_osx_package.sh b/make_osx_package.sh
index 3119f140e..86ce784ed 100755
--- a/make_osx_package.sh
+++ b/make_osx_package.sh
@@ -6,7 +6,8 @@ VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
RESOURCES=$DIST/Resources
ROOT=$DIST/pandoc
DEST=$ROOT/usr/local
-SCRIPTS=osx-resources
+OSX=osx
+SCRIPTS=$OSX/osx-resources
BASE=pandoc-$VERSION
ME=$(whoami)
CODESIGNID="Developer ID Application: John Macfarlane"
@@ -28,8 +29,8 @@ echo Building pandoc...
cabal clean
# Use cpphs to avoid problems with clang cpp on ghc 7.8 osx:
cabal install cpphs alex happy hsb2hs
-cabal install --reinstall --flags="embed_data_files" --ghc-options '-pgmPcpphs -optP--cpp'
-cabal install --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options '-pgmPcpphs -optP--cpp'
+cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" --ghc-options '-pgmPcpphs -optP--cpp'
+cabal install --ghc-options="-optl-mmacosx-version-min=10.6" --reinstall --flags="embed_data_files" pandoc-citeproc --ghc-options '-pgmPcpphs -optP--cpp'
mkdir -p $DEST/bin
mkdir -p $DEST/share/man/man1
@@ -39,6 +40,7 @@ for f in $EXES; do
cp $SANDBOX/share/man/man1/$f.1 $DEST/share/man/man1/
done
cp $SANDBOX/share/man/man5/pandoc_markdown.5 $DEST/share/man/man5/
+cp $OSX/uninstall-pandoc.pl $DEST/bin/
chown -R $ME:staff $DIST
# gzip $DEST/share/man/man?/*.*
diff --git a/osx-resources/InstallationCheck b/osx/osx-resources/InstallationCheck
index 2bd691f5c..2bd691f5c 100755
--- a/osx-resources/InstallationCheck
+++ b/osx/osx-resources/InstallationCheck
diff --git a/osx-resources/InstallationCheck.strings b/osx/osx-resources/InstallationCheck.strings
index 6c8efe0d4..6c8efe0d4 100644
--- a/osx-resources/InstallationCheck.strings
+++ b/osx/osx-resources/InstallationCheck.strings
diff --git a/osx/uninstall-pandoc.pl b/osx/uninstall-pandoc.pl
new file mode 100755
index 000000000..292bcfd96
--- /dev/null
+++ b/osx/uninstall-pandoc.pl
@@ -0,0 +1,81 @@
+#!/usr/bin/perl
+
+# Script to remove all files installed by the OSX pandoc installer
+# and unregister the package. Modified from a script contributed
+# by Daniel T. Staal.
+
+use warnings;
+use strict;
+
+use File::Spec;
+
+# The main info: this is the list of files to remove and the pkg_id.
+my $pkg_id = 'net.johnmacfarlane.pandoc';
+
+my @pkg_info;
+
+# Find which, if any, volume Pandoc is installed on.
+my $volume;
+
+# First check /, then other volumes on the box.
+my $cur_test = `pkgutil --pkgs=$pkg_id`;
+if ( $cur_test =~ m/$pkg_id/ ) {
+ $volume = '/';
+} else {
+ opendir( my $dh, '/Volumes' ) or die "Can't list Volumes: $!\n";
+ foreach my $dir ( readdir($dh) ) {
+ next if $dir =~ m/^\./; # Skip dotfiles.
+
+ my $path = File::Spec->rel2abs( $dir, '/Volumes' );
+ next if !( -d $path ); # Skip anything that isn't a directory.
+
+ my $cur_test = `pkgutil --pkgs=$pkg_id --volume '$path'`;
+ if ( $cur_test =~ m/$pkg_id/ ) {
+ $volume = $path;
+ last;
+ }
+ }
+}
+
+die "Pandoc not installed.\n" if !( defined($volume) );
+
+my @pkg_files = ();
+my $f;
+for $f (split '\n', `pkgutil --volume '$volume' --only-files --files $pkg_id`) {
+ push @pkg_files, File::Spec->rel2abs($f, $volume);
+};
+
+print "The following files will be deleted:\n\n";
+print join("\n", @pkg_files);
+print "\n\n";
+print "Do you want to proceed and uninstall pandoc (Y/N)?";
+my $input = <STDIN>;
+
+if ($input =~ m/^[Yy]/) {
+
+ # Actually remove the files.
+ foreach $f (@pkg_files) {
+ if (system("sudo rm $f") == 0) {
+ warn "Deleted $f\n";
+ } else {
+ warn "Unable to delete $f: $!\n";
+ warn "Aborting uninstall.\n";
+ exit 1;
+ }
+ }
+
+ # Clean up the install.
+ if (system("sudo pkgutil --forget $pkg_id --volume '$volume'") != 0) {
+ warn "Unable to clean up install: $!\n";
+ exit 1;
+ }
+
+} else {
+
+ print "OK, aborting uninstall.\n";
+ exit 0;
+
+}
+
+print "Pandoc has been successfully uninstalled.\n";
+exit 0;
diff --git a/pandoc.cabal b/pandoc.cabal
index 63c748a47..f29ee8fb1 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,5 +1,5 @@
Name: pandoc
-Version: 1.12.4
+Version: 1.12.4.1
Cabal-Version: >= 1.10
Build-Type: Custom
License: GPL
@@ -45,6 +45,7 @@ Data-Files:
data/templates/default.docbook,
data/templates/default.beamer,
data/templates/default.opendocument,
+ data/templates/default.icml,
data/templates/default.opml,
data/templates/default.latex,
data/templates/default.context,
@@ -226,7 +227,7 @@ Library
tagsoup >= 0.13.1 && < 0.14,
base64-bytestring >= 0.1 && < 1.1,
zlib >= 0.5 && < 0.6,
- highlighting-kate >= 0.5.7 && < 0.6,
+ highlighting-kate >= 0.5.8 && < 0.6,
data-default >= 0.4 && < 0.6,
temporary >= 1.1 && < 1.3,
blaze-html >= 0.5 && < 0.8,
@@ -327,7 +328,7 @@ Executable pandoc
text >= 0.11 && < 1.2,
bytestring >= 0.9 && < 0.11,
extensible-exceptions >= 0.1 && < 0.2,
- highlighting-kate >= 0.5.7 && < 0.6,
+ highlighting-kate >= 0.5.8 && < 0.6,
aeson >= 0.7 && < 0.8,
yaml >= 0.8.8.2 && < 0.9,
containers >= 0.1 && < 0.6,
@@ -370,7 +371,7 @@ Test-Suite test-pandoc
directory >= 1 && < 1.3,
filepath >= 1.1 && < 1.4,
process >= 1 && < 1.3,
- highlighting-kate >= 0.5.7 && < 0.6,
+ highlighting-kate >= 0.5.8 && < 0.6,
Diff >= 0.2 && < 0.4,
test-framework >= 0.3 && < 0.9,
test-framework-hunit >= 0.2 && < 0.4,
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 4b9e424d9..6f870318f 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -309,6 +309,8 @@ blockCommands = M.fromList $
, ("PandocEndInclude", endInclude)
, ("bibliography", mempty <$ (skipopts *> braced >>=
addMeta "bibliography" . splitBibs))
+ , ("addbibresource", mempty <$ (skipopts *> braced >>=
+ addMeta "bibliography" . splitBibs))
] ++ map ignoreBlocks
-- these commands will be ignored unless --parse-raw is specified,
-- in which case they will appear as raw latex blocks
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 31c490af6..4f506b5a6 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -564,8 +564,10 @@ addMetaField :: ToMetaValue a
-> Meta
addMetaField key val (Meta meta) =
Meta $ M.insertWith combine key (toMetaValue val) meta
- where combine newval (MetaList xs) = MetaList (xs ++ [newval])
+ where combine newval (MetaList xs) = MetaList (xs ++ tolist newval)
combine newval x = MetaList [x, newval]
+ tolist (MetaList ys) = ys
+ tolist y = [y]
-- | Create 'Meta' from old-style title, authors, date. This is
-- provided to ease the transition from the old API.