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

Add nocite tag #323

Closed
wants to merge 1 commit into from
Closed

Add nocite tag #323

wants to merge 1 commit into from

Conversation

iveney
Copy link

@iveney iveney commented Jan 28, 2021

Taking a stab at #322, which adds a nocite tag that do not output citation [1] in place, but will silently track them and print out the mentioned citations via {% bibliography --cited %}

It works locally on my own blog, but I was not able to run cucumber correctly.

➜  jekyll-scholar git:(nocite) rake
/Users/ivanx/.rbenv/versions/2.7.1/bin/ruby -S bundle exec cucumber
Traceback (most recent call last):
	13: from /Users/ivanx/.rbenv/versions/2.7.1/bin/ruby_executable_hooks:22:in `<main>'
	12: from /Users/ivanx/.rbenv/versions/2.7.1/bin/ruby_executable_hooks:22:in `eval'
	11: from /Users/ivanx/.rbenv/versions/2.7.1/bin/cucumber:23:in `<main>'
	10: from /Users/ivanx/.rbenv/versions/2.7.1/bin/cucumber:23:in `load'
	 9: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/bin/cucumber:11:in `<top (required)>'
	 8: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/bin/cucumber:11:in `require'
	 7: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/cli/main.rb:8:in `<top (required)>'
	 6: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/cli/main.rb:8:in `require'
	 5: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber.rb:6:in `<top (required)>'
	 4: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber.rb:6:in `require'
	 3: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/parser.rb:2:in `<top (required)>'
	 2: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/parser.rb:2:in `require'
	 1: from /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/ast.rb:9:in `<top (required)>'
/Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/ast.rb:9:in `require': /Users/ivanx/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/cucumber-1.3.11/lib/cucumber/ast/step.rb:80: circular argument reference - name (SyntaxError)

@inukshuk
Copy link
Owner

Great, thanks!

I can take a look at this, but please add the nocite tag source file and the tests to this PR.

As for the nocite helper, we don't need to convert the entry at all, since we're not doing anything with it. It should be OK to just check bibliography.key?(key) which tells us whether or not the entry exists; if it does exist, add it to cited_keys and we're good. It's an interesting question what to do if a key is missing: since the tag isn't supposed to print anything we could either silently ignore it -- or, to alert users to the fact that they're citing a missing key print the missing reference string. What do you think?

@thhagelmayer thhagelmayer mentioned this pull request May 19, 2022
@iveney iveney closed this Jun 26, 2024
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

Successfully merging this pull request may close these issues.

2 participants