-
Notifications
You must be signed in to change notification settings - Fork 104
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 CITATION.bib #73
Add CITATION.bib #73
Conversation
I would advise adding this as a plugin instead of some special case. The package is in a bit of a weird state too, where the internals are completely redone in #61... I need to finish that to make it easier to contribute. |
so #61 will be blocking to switch to the plugin mechanism right? From the doc I wasn't sure this was supposed to be a plugin:
Since this was not related to |
Oh I suppose the docs could be clearer, a GenericPlugin is basically something that has the capability to create a single file in the package (i.e. CITATION.bib) and/or add entries to the gitignore. Thanks for bringing that up. The PR is not required to make this a plugin, it's just that the plugin would be rewritten to be one line with the new internals. If you'd like to get this merged before then, feel free to implement as a Again, sorry contributing is a bit messy at the moment 🙃. |
this is indeed hairy, I think I managed to get something, still need to test it a bit |
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.
Looks good overall to me 🙂. Also please export the new plugin.
src/generate.jl
Outdated
@@ -63,6 +63,7 @@ function generate( | |||
gen_require(pkg_dir, t), | |||
gen_readme(pkg_dir, t), | |||
gen_license(pkg_dir, t), | |||
gen_citation(pkg_dir, t), |
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.
I think this can be deleted now.
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
==========================================
- Coverage 97.84% 97.63% -0.22%
==========================================
Files 13 14 +1
Lines 372 381 +9
==========================================
+ Hits 364 372 +8
- Misses 8 9 +1
Continue to review full report at Codecov.
|
src/plugins/citation.jl
Outdated
function gen_plugin(p::Citation, t::Template, pkg_name::AbstractString) | ||
pkg_dir = joinpath(t.dir, pkg_name) | ||
text = """@misc{$pkg_name.jl, | ||
\tauthor = {{$(t.author)}},\n |
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.
Are there supposed to be two curlies like {{this}} or just {one}?
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.
Two maintains the uppercase but your right it'n not necessary for authors
src/plugins/citation.jl
Outdated
pkg_dir = joinpath(t.dir, pkg_name) | ||
text = """@misc{$pkg_name.jl, | ||
\tauthor = {{$(t.author)}},\n | ||
\ttitle = {{$(pkg_name).jl}},\n |
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.
\ttitle = {{$(pkg_name).jl}},\n | |
\ttitle = {{$pkg_name.jl}},\n |
Also, same question as author
.
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.
I find it easier on the eyes to have explicit parentheses when the variable name is long-ish, otherwise it can lead to ambiguities on what belongs to the interpolated expression:
test/plugins/citation.jl
Outdated
end | ||
|
||
@testset "File generation" begin | ||
# Without a coverage plugin in the template, there should be no post-test step. |
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.
This looks like it might be a copy-paste remnant
alright tests added and passing |
@christopher-dG looks good on my side |
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.
There are a couple hanging comments still, but this looks good 🙂
Awesome, thanks 🙂 |
Since the Julia community is starting to agree on a standardized CITATION.bib file, it would be great to be able to have it from PkkTemplates