Skip to content

Commit b852c14

Browse files
authored
Fix bibliography heading (#204)
After upgrading to pandoc 3.5, the bibliography heading stopped being a heading due to a change in jgm/pandoc@3d90234. I thought the behaviour was a bug and filed jgm/pandoc#10367, but it's behaviour as expected, and the workaround is simple: just add a heading manually. This PR removes the metadata setting for the reference section heading, along with documentation and test updates.
1 parent cfa469a commit b852c14

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ the `bibliography` feature:
172172
pbb enable bibliography
173173
```
174174

175+
The bibliography is appended to the end of a post. If you want a heading for
176+
it, just add one to the end of the post.
177+
175178
[`--citeproc`]: <https://pandoc.org/MANUAL.html#citations>
176179

177180
### dot graphs

man/pbb.1

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,8 @@ pandoc documentation
226226
for details regarding the format and location of the bibliography as well as how
227227
citations work.
228228
.PP
229-
The heading of the bibliography defaults to \*(lqBibliography\*(rq and can be
230-
adjusted by modifying the value of
231-
.I reference-section-title
232-
in
233-
.IR .metadata.yml .
229+
If you want a heading for the reference section, add one to the end of the
230+
Markdown.
234231
.SS dot graphs
235232
When a code block has the class
236233
.IR dot ,
@@ -265,10 +262,9 @@ to modify its contents.
265262
.TP
266263
.I .metadata.yml
267264
Stores metadata used by pandoc such as the heading for the table of contents,
268-
the field that controls generation of the table of contents (which can be
265+
and the field that controls generation of the table of contents (which can be
269266
overridden per post, see
270-
.BR OPTIONS ),
271-
and the heading for the bibliography.
267+
.BR OPTIONS ).
272268
.TP
273269
.I assets
274270
Contains various assets used when the blog is built:

pbb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ init() {
140140
printf '%s\n' \
141141
'toc: false' \
142142
'toc-title: Table of contents' \
143-
'reference-section-title: Bibliography' \
144143
> "$metadata"
145144
git add "$metadata"
146145

test/bibliography.bats

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ load test_helper
1313
# My first post
1414
1515
Blah blah [@Ritchie1974].
16+
17+
## Bibliography
1618
EOF
1719

1820
run pbb build
@@ -24,7 +26,6 @@ load test_helper
2426
cat docs/????-??-??-*.html
2527
grep -Pqz 'data-cites="Ritchie1974">\(Ritchie\sand\sThompson\s1974\)' docs/????-??-??-*.html
2628

27-
# Post contains bibliography; not a heading until jgm/pandoc#10367 is fixed
28-
# grep -q 'id="bibliography".*>Bibliography</h1>' docs/????-??-??-*.html
29-
grep -q '<p>Bibliography</p>' docs/????-??-??-*.html
29+
# Post contains bibliography
30+
grep -q 'id="bibliography".*>Bibliography</h1>' docs/????-??-??-*.html
3031
}

test/init.bats

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ load test_helper
2222
# Conf file contains title
2323
grep -Fqx 'blogtitle=Testblog' .pbbconfig
2424

25-
# Metadata file contains TOC and bibliography settings
25+
# Metadata file contains TOC settings
2626
grep -Fqx 'toc: false' .metadata.yml
2727
grep -Fqx 'toc-title: Table of contents' .metadata.yml
28-
grep -Fqx 'reference-section-title: Bibliography' .metadata.yml
2928

3029
# Header file contains title
3130
[[ $(< includes/header.html) == '<div id="blogtitle"><a href="./">Testblog</a></div>' ]]

0 commit comments

Comments
 (0)