Skip to content
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

Edition missing #60

Open
ulthiel opened this issue Jul 12, 2022 · 2 comments
Open

Edition missing #60

ulthiel opened this issue Jul 12, 2022 · 2 comments

Comments

@ulthiel
Copy link

ulthiel commented Jul 12, 2022

The edition field of a Bibtex entry seems to be missing from the generated references. Could this be added?

Here's an example:

@book{Knuth-4A,
	author = {Knuth, D. E.},
	edition = {Sixteenth printing, April 2021},
	pages = {xv+883},
	publisher = {Addison-Wesley, Upper Saddle River, NJ},
	title = {The art of computer programming. {V}ol. 4{A}. {C}ombinatorial algorithms. {P}art 1},
	year = {2011}}
@fingolfin
Copy link
Contributor

The bib text is generated in this function:

function Selectors.runner(::Type{BibliographyBlock}, x, page, doc)
@info "Expanding bibliography."
raw_bib = "<dl>"
for (id, entry) in doc.plugins[CitationBibliography].bib
@info "Expanding bibliography entry: $id."
# Add anchor that citations can link to from anywhere in the docs.
Anchors.add!(doc.internal.headers, entry, entry.id, page.build)
authors = xnames(entry) |> tex2unicode
link = xlink(entry)
title = xtitle(entry) |> tex2unicode
published_in = xin(entry) |> tex2unicode
raw_bib *= """<dt>$id</dt>
<dd>
<div id="$id">$authors, $(linkify(title, link)), $published_in</div>
</dd>"""
end
raw_bib *= "\n</dl>"
page.mapping[x] = Documents.RawNode(:html, raw_bib)
end

So I guess modifying this to insert the edition (if it is defined) should be possible, as long as one can access the edition value. For e.g. the title, this is done by the helper functions like xtitle which are defined in Bibliography.jl, like here: https://github.com/Humans-of-Julia/Bibliography.jl/blob/9d7386b5ad075a5f43eadff691c47961b38d566d/src/staticweb.jl#L23-L25. So that together could be used to resolve the issue.

Of course on the long run a more general and flexible solution as in issue #22 would be nicer...

@goerz
Copy link

goerz commented Jul 13, 2023

Can you check whether this is still a problem in DocumenterCitations.jl v1.0? If so, please open a new issue at https://github.com/JuliaDocs/DocumenterCitations.jl/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants