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 citation and references #575

Merged
merged 4 commits into from
Aug 5, 2019

Conversation

rollaball
Copy link
Member

@rollaball rollaball commented Jul 31, 2019

  • Please check if the PR fulfills these requirements
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Adds Components for Citation and References.

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?
    Add [Cite/] anywhere on the page with props authors, title and source.
    Then Add [Cite.References /] and it will get the list of all citations on the page

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

  • Other information:
    Issue: Add reference component #509

@rollaball
Copy link
Member Author

rollaball commented Jul 31, 2019

Idyll is a markup language and toolkit for writing interactive articles. [Cite 
  url:"https://idl.cs.washington.edu/files/2018-Idyll-UIST.pdf" 
  authors:"Matthew Conlen and Jeffrey Heer"
  title:"Idyll: A Markup Language for Authoring and Publishing Interactive Articles on the Web"
/]

[Cite.References/]

Screenshot from 2019-07-31 15-13-36

@rollaball rollaball marked this pull request as ready for review July 31, 2019 09:45
@mathisonian
Copy link
Member

This looks great @rollaball!

One use case this doesn't quite cover yet is a way to cite via an id. For example it is common to cite the same work multiple times, it would be nice if there were a way to provide a shortcut if you want to reference something again, without typing in all the information. Can you think of a clean way to do that?

@rollaball
Copy link
Member Author

rollaball commented Jul 31, 2019

[Cite author:"..." title:"..." url:"..." referenceName:"..." /]
[Cite referenceName:"..." /]

@mathisonian does this seem like a good way to do this?

@mathisonian
Copy link
Member

That works for me! Only comment is that referenceName is a little verbose, what about just name or id? Of those two id maybe is clearer than name since one might reasonable think name is referring to the author name or paper title. @fredhohman you have any comment on this?

We should probably print a warning if you provide a referenceName but it doesn't have any associated data yet.

I like this API because it doesn't seem like it would need any changes if we also add bibtex support in the future.

@fredhohman
Copy link

Nice!

I agree id is more clear, because name could be referring to a number of different fields of a citation/reference/publication.

Other examples:

@mathisonian
Copy link
Member

It should probably accept a date property as well that takes an arbitrary string.

@mathisonian
Copy link
Member

Thanks for the links @fredhohman!

@rollaball would calling it key mess with react's special key property?

@rollaball
Copy link
Member Author

@mathisonian
Tried it and it is messing with the special key. Will have to call it something else.

@rollaball
Copy link
Member Author

@mathisonian
so what should I go ahead with? id or citation-key?

@mathisonian
Copy link
Member

@rollaball let's go with id

@rollaball
Copy link
Member Author

rollaball commented Aug 1, 2019

Hey, @mathisonian
I have made the changes

Copy link
Member

@mathisonian mathisonian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested locally and everything seems to work great, thanks @rollaball! I've just left a couple small update requests and then I'm good to merge 👍 .

packages/idyll-components/src/cite.js Outdated Show resolved Hide resolved
packages/idyll-components/src/cite.js Show resolved Hide resolved
@mathisonian mathisonian merged commit 0528768 into idyll-lang:master Aug 5, 2019
@mathisonian
Copy link
Member

Updates look great - thanks @rollaball 🎉

@rollaball rollaball deleted the citations-and-references branch August 5, 2019 21:24
@rollaball rollaball mentioned this pull request Aug 6, 2019
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.

3 participants