-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple bibliography files #94
base: main
Are you sure you want to change the base?
Conversation
Just verified the changes by running this manually. What I am uncertain of is what |
I'm wondering whether this feature could be added to the existing |
bibtex-file attribute can now be used for multiple files instead.
Yes, probably a better idea. Fixed in latest commit. |
lib/asciidoctor-bibtex/processor.rb
Outdated
@biblio = [] | ||
bibfiles.each do |bibfile| | ||
bibtex = BibTeX.open bibfile, filter: [LatexFilter] | ||
@biblio += [bibtex] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something more compact like:
@biblio = bibfiles.map { |bibfile| BibTeX.open bibfile, filter: [LatexFilter] }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up in latest patches
lib/asciidoctor-bibtex/processor.rb
Outdated
@@ -48,13 +48,17 @@ def apply(value) | |||
# current document, and run the different steps to add the citations | |||
# and bibliography | |||
class Processor | |||
def initialize(bibfile, links = false, style = 'ieee', locale = 'en-US', | |||
def initialize(bibfiles, links = false, style = 'ieee', locale = 'en-US', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility it would be better to accept both a single string and an array of strings here. This would also simplify the patch in the tests since single-bib could still be handled with the old syntax, and only the new test using an array would have to be introduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String arguments restored in latest patch series
Also restored the old tests to pass strings instead.
I think this is ready for re-review now. Let me know if there is something else that need to be addressed. |
Hello, thank you for the improvement. any progress on this capability? I am reusing asciidoc files maintained in another repository and adding them to the main repository as a submodule in Git. That's why I need to use two bibtex files; one from the injected repository and the other is maintained by me in the main repository. |
Adds support for multiple bibliography files.
Introduces support for multiple bibliography files by treating
bibtex-file
as a comma separated list.The search order for entries is in the file order.
This PR resolves #87