Skip to content

Commit 76f23f9

Browse files
committed
Rename filter to "multibib"
1 parent 0410fb5 commit 76f23f9

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
DIFF ?= diff
1+
# Name of the filter file, *with* `.lua` file extension.
2+
FILTER_FILE := $(wildcard *.lua)
3+
4+
# Allow to use a different pandoc binary, e.g. when testing.
25
PANDOC ?= pandoc
6+
# Allow to adjust the diff command if necessary
7+
DIFF = diff
38

49
# Use special expected output file if it exists.
510
expected_output = test/expected.$(PANDOC_VERSION).txt
611
ifeq ($(wildcard $(expected_output)),)
712
expected_output = test/expected.txt
813
endif
914

10-
test: test/input.md multiple-bibliographies.lua
15+
test: test/input.md $(FILTER_FILE)
1116
@$(PANDOC) -d test/test.yaml \
1217
| $(DIFF) $(expected_output) -
1318

README.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
# multiple-bibliographies
1+
# multibib
2+
3+
[![GitHub build status][CI badge]][CI workflow]
24

35
This filter allows to create multiple bibliographies using
46
`citeproc`. The content of each bibliography is controlled via
57
YAML values and the file in which a bibliographic entry is
68
specified.
79

8-
## Usage
10+
[CI badge]: https://img.shields.io/github/workflow/status/pandoc-ext/multibib/CI?logo=github
11+
[CI workflow]: https://github.com/pandoc-ext/multibib/actions/workflows/ci.yaml
912

1013
The bibliographies must be defined in a map below the
1114
`bibliography` key in the document's metadata. E.g.
@@ -35,3 +38,53 @@ The placement of bibliographies is controlled via special divs.
3538
Each refs-*x* div should have a matching entry *x* in the
3639
metadata. These divs are filled with citations from the respective
3740
bib-file.
41+
42+
43+
Usage
44+
------------------------------------------------------------------
45+
46+
The filter modifies the internal document representation; it can
47+
be used with many publishing systems that are based on pandoc.
48+
49+
### Plain pandoc
50+
51+
Pass the filter to pandoc via the `--lua-filter` (or `-L`) command
52+
line option.
53+
54+
pandoc --lua-filter multibib.lua ...
55+
56+
### Quarto
57+
58+
Users of Quarto can install this filter as an extension with
59+
60+
quarto install extension pandoc-ext/multibib
61+
62+
and use it by adding `multibib` to the `filters` entry
63+
in their YAML header.
64+
65+
``` yaml
66+
---
67+
filters:
68+
- multibib
69+
---
70+
```
71+
72+
### R Markdown
73+
74+
Use `pandoc_args` to invoke the filter. See the [R Markdown
75+
Cookbook](https://bookdown.org/yihui/rmarkdown-cookbook/lua-filters.html)
76+
for details.
77+
78+
``` yaml
79+
---
80+
output:
81+
word_document:
82+
pandoc_args: ['--lua-filter=multibib.lua']
83+
---
84+
```
85+
86+
License
87+
------------------------------------------------------------------
88+
89+
This pandoc Lua filter is published under the MIT license, see
90+
file `LICENSE` for details.

multiple-bibliographies.lua renamed to multibib.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--[[
2-
multiple-bibliographies – create multiple bibliographies
2+
multibib – create multiple bibliographies
33
44
Copyright © 2018-2022 Albert Krewinkel
55

test/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ input-files: ['test/input.md']
22
to: plain
33
standalone: true
44
filters:
5-
- multiple-bibliographies.lua
5+
- multibib.lua

0 commit comments

Comments
 (0)