Skip to content

Commit

Permalink
updates for --filter pandoc-citeproc-preamble -> --citeproc change
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Whitton <[email protected]>
  • Loading branch information
spwhitton committed Aug 21, 2022
1 parent c968fae commit 88669fc
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 57 deletions.
38 changes: 16 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

## Synopsis

pandoc-citeproc-preamble is a JSON filter for [Pandoc][] which
inserts a preamble before the output that the [pandoc-citeproc][]
filter appends to the document. This preamble might include a heading
(e.g. "Bibliography") and raw markup to format the bibliography for
the output format.
pandoc-citeproc-preamble is a JSON filter for [Pandoc][] which inserts a
preamble before the output that Pandoc's citeproc filter appends to the
document. This preamble might include a heading (e.g. "Bibliography") and raw
markup to format the bibliography for the output format.

[Pandoc]: http://pandoc.org/ "Pandoc home page"

[pandoc-citeproc]: http://hackage.haskell.org/package/pandoc-citeproc

## Installation

Users of Debian 10 or later or Ubuntu 17.04 or later: `apt-get install
Expand All @@ -34,10 +31,9 @@ If you are not a Haskell programmer, you might find it easier to

## Usage

Add `--filter pandoc-citeproc-preamble` somewhere after `--filter
pandoc-citeproc`, e.g.
Add `--filter pandoc-citeproc-preamble` somewhere after `--citeproc`, e.g.

$ pandoc -s --filter pandoc-citeproc --bibliography=~/doc/mine.bib --filter pandoc-citeproc-preamble ~/doc/my_essay.mdwn -o ~/my_essay.pdf
$ pandoc -s --citeproc --bibliography=~/doc/mine.bib --filter pandoc-citeproc-preamble ~/doc/my_essay.mdwn -o ~/my_essay.pdf

In this case, since the output format is LaTeX,
pandoc-citeproc-preamble will look for the preamble in the file
Expand Down Expand Up @@ -67,18 +63,16 @@ agnostic with regard to the output format they will eventually be
compiled to: it should not be necessary to include in one's input
file, for example, LaTeX code to format the bibliography.

When compiling to PDF (which is probably the most common case for
users of pandoc-citeproc), formatting code is usually required to have
the entries of pandoc-citeproc's bibliography line up with each other;
by default, all entries except the first will be indented. Another
common customisation is to set up a [hanging indent][] for bibliography
entries.

Since pandoc-citeproc doesn't provide any facility to add formatting
control code to its output, pandoc-citeproc-preamble is necessary to
avoid the user being forced to add their control code to the end of
their input files, thereby losing the input file's agnosticity with
regard to output format.
When compiling to PDF (which is probably the most common case for users of
Pandoc's citeproc filter), formatting code is usually required to have the
entries of Pandoc's bibliography line up with each other; by default, all
entries except the first will be indented. Another common customisation is to
set up a [hanging indent][] for bibliography entries.

Since Pandoc's citeproc filter doesn't provide any facility to add formatting
control code to its output, pandoc-citeproc-preamble is necessary to avoid the
user being forced to add their control code to the end of their input files,
thereby losing the input file's agnosticity with regard to output format.

[hanging indent]: http://www.computerhope.com/jargon/h/hanginde.htm "description of hanging indent"

Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
pandoc-citeproc-preamble (1.7-1) UNRELEASED; urgency=medium

* Replace references to pandoc-citeproc.
We now say "Pandoc's citeproc filter", "Pandoc's bibliography", etc..
* Replace '--filter pandoc-citeproc' -> '--citeproc' (Closes: #1017256).
* Drop build-dep and autopkgtest dep on pandoc-citeproc.

-- Sean Whitton <[email protected]> Sat, 20 Aug 2022 13:25:24 -0700

pandoc-citeproc-preamble (1.6-1) unstable; urgency=medium

* Drop mistaken Tests: field from d/tests/control.
Expand Down
22 changes: 10 additions & 12 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Build-Depends: debhelper (>= 10),
libghc-text-conversions-dev,
libghc-pandoc-types-dev (>= 1.20),
pandoc <!nocheck>,
pandoc-citeproc <!nocheck>,
Standards-Version: 4.4.1
Homepage: https://spwhitton.name/tech/code/pandoc-citeproc-preamble/
Vcs-Git: https://git.spwhitton.name/pandoc-citeproc-preamble
Expand All @@ -20,15 +19,14 @@ Depends: ${shlibs:Depends},
${misc:Depends},
${haskell:Depends},
Recommends: pandoc-citeproc
Description: insert a preamble before pandoc-citeproc's bibliography
pandoc-citeproc-preamble is a JSON filter for Pandoc which inserts a
preamble before the output that the pandoc-citeproc filter appends to
the document. This preamble might include a heading
(e.g. "Bibliography") and raw markup to format the bibliography for
the output format.
Description: insert a preamble before Pandoc's bibliography
pandoc-citeproc-preamble is a JSON filter for Pandoc which inserts a preamble
before the output that Pandoc's citeproc filter appends to the document. This
preamble might include a heading (e.g. "Bibliography") and raw markup to
format the bibliography for the output format.
.
Since pandoc-citeproc doesn't provide any facility to add formatting
control code to its output, pandoc-citeproc-preamble is necessary to
avoid the user being forced to add their control code to the end of
their input files, thereby losing the input file's agnosticity with
regard to output format.
Since Pandoc's citeproc filter doesn't provide any facility to add formatting
control code to its output, pandoc-citeproc-preamble is necessary to avoid
the user being forced to add their control code to the end of their input
files, thereby losing the input file's agnosticity with regard to output
format.
2 changes: 1 addition & 1 deletion debian/tests/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Test-Command: test/test
Restrictions: rw-build-tree
# ^ produces test/output.tex
Depends: @, pandoc, pandoc-citeproc
Depends: @, pandoc
29 changes: 13 additions & 16 deletions pandoc-citeproc-preamble.1.pod
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
=head1 NAME

pandoc-citeproc-preamble - insert a preamble before pandoc-citeproc's bibliography
pandoc-citeproc-preamble - insert a preamble before Pandoc's bibliography

=head1 SYNOPSIS

B<pandoc-citeproc-preamble>

=head1 DESCRIPTION

B<pandoc-citeproc-preamble> is a JSON filter for pandoc(1) which
inserts a preamble before the output that the pandoc-citeproc(1)
filter appends to the document. This preamble might include a heading
(e.g. "Bibliography") and/or raw markup to format the bibliography for
the output format.
B<pandoc-citeproc-preamble> is a JSON filter for pandoc(1) which inserts a
preamble before the output that Pandoc's citeproc filter appends to the
document. This preamble might include a heading (e.g. "Bibliography") and/or
raw markup to format the bibliography for the output format.

=head1 USAGE

Add B<--filter pandoc-citeproc-preamble> somewhere after B<--filter
pandoc-citeproc>, e.g.
Add B<--filter pandoc-citeproc-preamble> somewhere after B<--citeproc>, e.g.

=over 4

% pandoc -s --filter pandoc-citeproc --bibliography=~/doc/mine.bib \
% pandoc -s --citeproc --bibliography=~/doc/mine.bib \
--filter pandoc-citeproc-preamble \
~/doc/my_essay.mdwn -o ~/my_essay.pdf

Expand Down Expand Up @@ -55,13 +53,12 @@ eventually be compiled. For example, it should not be necessary to
include LaTeX code in one's input file in order to format the
bibliography. The input file might also be compiled to HTML.

However, when compiling to PDF, formatting code is usually required in
order to have the entries of pandoc-citeproc's bibliography line up
with each other; by default, all entries except the first will be
indented. Another common customisation is to set up a hanging indent
for bibliography entries.
However, when compiling to PDF, formatting code is usually required in order
to have the entries of Pandoc's bibliography line up with each other; by
default, all entries except the first will be indented. Another common
customisation is to set up a hanging indent for bibliography entries.

Since pandoc-citeproc(1) doesn't provide any facility to add
Since Pandoc's citeproc filter doesn't provide any facility to add
formatting control code to its output, B<pandoc-citeproc-preamble> is
necessary to avoid the user being forced to add their control code to
the end of their input files, thereby losing the input file's
Expand All @@ -73,4 +70,4 @@ Sean Whitton <[email protected]>

=head1 SEE ALSO

pandoc(1), pandoc-citeproc(1)
pandoc(1)
4 changes: 2 additions & 2 deletions pandoc-citeproc-preamble.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pandoc-citeproc-preamble
version: 1.6
synopsis: Insert a preamble before pandoc-citeproc's bibliography
version: 1.7
synopsis: Insert a preamble before Pandoc's bibliography
description: Please see README.md
homepage: https://github.com/spwhitton/pandoc-citeproc-preamble
license: GPL-3
Expand Down
5 changes: 2 additions & 3 deletions src/pandoc-citeproc-preamble.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{-
pandoc-citeproc-preamble --- Insert a preamble before pandoc-citeproc's bibliography
pandoc-citeproc-preamble --- Insert a preamble before Pandoc's bibliography
Copyright (C) 2015-2016, 2019 Sean Whitton
Expand Down Expand Up @@ -34,8 +34,7 @@ insertPreamble :: Block -> [Block] -> [Block]
insertPreamble preamble = foldr step []
where
step refsDiv@(Div ("refs", _, _) theRefs) xs =
-- check whether pandoc-citeproc actually inserted any
-- references
-- check whether Pandoc actually inserted any references
if null theRefs
then refsDiv : xs
else preamble : refsDiv : xs
Expand Down
2 changes: 1 addition & 1 deletion test/test
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ die "need to build before testing\n" unless -x $pcp;
unlink $output if -e $output;

print "testing with " . (`pandoc --version`)[0];
system "pandoc -s --filter pandoc-citeproc --bibliography=test.bib"
system "pandoc -s --citeproc --bibliography=test.bib"
. " --filter $pcp -M citeproc-preamble=../examples/default.latex"
. " test.mdwn -f markdown -o $output";

Expand Down

0 comments on commit 88669fc

Please sign in to comment.