Show bibliography only when there are citations in the document
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
It would be great to skip the printing the bibliography section if the paper’s text has no references (“citations”) to the catalogued works.
At the moment this can be achieved using locate.
locate(loc => if bib != none and query(ref.where(element: none), loc).len() > 0 {
bibliography(bib)
})
It would be nice to have native support from the compiler. Or is the suggested approach the recommended one?
For more context see the discord thread. Thanks for those who provided input and the solution above.
Use Case
I am using the same template for different files, some of which I do not make any citations. However, an empty bibliography section is printed nevertheless.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing bibliography and citation handling, using the issue's locate, bibliography, and query(ref.where(...)) example as the behavioral reference. Determine how native support should detect whether citations exist, then add coverage showing that an uncited document omits the bibliography while cited documents still print it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100