-
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
Improve rendering of the bibliography #76
Comments
To the maintainers, please @ me if you need help creating the idiomatic / semantic structure that the converters rely on for formatting this document element. |
I see. This behavior inherits from the orginal asciidoc-bib. I am looking into this issue. |
I am completely blank on the Ruby side of things but am happy to help testing changes. |
The problem here is that in numerical styles such as IEEE, we need to customize the list item header to be exactly |
Shouldn't it be a matter of literally replacing the paragraphs with unordered list items and marking the entire list as |
That's essentially it. Since this extension comes after block parsing, the unordered list does not have to use the bibliography syntax in AsciiDoc. It just needs to be an unordered list with the correct block style. I'll share some code that shows how this would be done. |
Thanks, Dan. My major concern is how to represent the bibliography list. Eventually, there are two cases:
How can I represent case 1 in asciidoctor? |
I am of course lacking the insight into the implementation but as I understand it, the code currently renders something equivalent to |
Currently, the bibliography list in AsciiDoc has to be an unordered list that uses a square marker. And all the converters recognize this requirement. If we need to be able to customize how a bibliography list is displayed using one of the other list types or styles, then that is something that needs to be addressed in AsciiDoc. It's not something an extension should be changing because then we'll have lost the integrity of the document semantics. I'd be happy to prototype support for a secondary list style on a bibliography list in Asciidoctor PDF. |
Here's an example of how to create a bibliography list from an extension: require 'asciidoctor/pdf'
input = <<~EOS
= Document Title
[bibliography]
== Bibliography
EOS
Asciidoctor::Extensions.register do
tree_processor do
process do |doc|
bibsect = doc.sections.last
biblist = create_list bibsect, :ulist
biblist.style = 'bibliography'
biblist << (create_list_item biblist, 'text of bibliography item')
bibsect << biblist
nil
end
end
end
Asciidoctor.convert input, safe: :safe, backend: :pdf, to_file: 'out.pdf' |
In the interim of having support for customizing the list marker on an bibliography list (at least from the API), I could understand needing to implement the items as paragraphs as you do today. But at the very least, you should be passing attributes (namely the role) defined on the macro to those paragraphs so that the styling can be controlled. In other words:
The |
Previously, the bibliography entries have been rendered as individual paragraphs. This commit tweaks the rendering to rather use an unstyled, left-aligned, unordered list. This essentially fixes asciidoctor#76 and relates to asciidoctor/asciidoctor-pdf#1889.
According to this ticket, apparently Bibtex doesn't generate idiomatic text structures for Asciidoctor to eventually render PDFs properly. To quote the most relevant section from the original ticket:
The text was updated successfully, but these errors were encountered: