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

Citations from docstrings are not collected #39

Closed
jordifradera opened this issue Sep 18, 2023 · 5 comments · Fixed by #40
Closed

Citations from docstrings are not collected #39

jordifradera opened this issue Sep 18, 2023 · 5 comments · Fixed by #40
Assignees
Labels
bug Something isn't working

Comments

@jordifradera
Copy link

I found no way to include a citation in a docstring of a method.

"""
     f(x)

A dummy function to show the problem [dummycitation](@cite).
"""
function f(x)
    x+1
end

Maybe there is one...

Citation is read from the references.bib, but not found later.
The following error show up:

Warning: Bibliography anchor for key 'dummycitation' not found.
└ @ DocumenterCitations .....\.julia\packages\DocumenterCitations\f0eDy\src\citations.jl:456

A workaround is to place the citation in a .md of your documentation pages.

[dummycitation](@cite)

Then the citation is rendered even inside doscstrings.

Using DocumenterCitations v1.2.0 with Julia 1,9.1.

@fredrikekre
Copy link
Member

Just ran into this as well. I guess we don't traverse docstrings during the collection phase.

@fredrikekre fredrikekre added the bug Something isn't working label Sep 18, 2023
@goerz
Copy link
Member

goerz commented Sep 18, 2023

Haven’t had a chance yet to confirm, but I’ll make sure to fix this asap, later this week

@sjdaines
Copy link

And here... this used to work, now failing with Documenter.jl v1.0 and DocumenterCitations v1.2

Example of failure: https://github.com/PALEOtoolkit/PALEOcopse.jl/actions/runs/6207321855/job/16852451709

@goerz goerz changed the title add citation in docstrings Citations from docstrings are not collected Sep 20, 2023
@goerz
Copy link
Member

goerz commented Sep 20, 2023

Indeed, this was a regression in version 1.2, where we don't recurse into docstring nodes during the collection step. Thus, any reference that was only cited in a docstring would be missed.

Should be fixed with #40

@jordifradera
Copy link
Author

Many thanks!!
Awsome package that saves a huge amount of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants