FredHutch / wiki

SciWiki: Collective KnowledgeBase for Scientific Data and Use
https://sciwiki.fredhutch.org
Other
38 stars 46 forks source link

Add author contribution list to bottom of each page #78

Open vortexing opened 6 years ago

vortexing commented 6 years ago

Long term goal: On the bottom of each page, render a list of the users who have commits on the master branch with edits to the file that makes each page.

I can do the API call in R to get what I want at least, but how/where to get the information but how to get the same info via Liquid/or in-page API call and get it to render a list of names?

library(httr)
# Get the list of commits on the page "store_collaboration.md".  
out <-content(GET(url = "https://api.github.com/repos/FredHutch/wiki/commits?path=_computing/store_collaboration.md", config = list(authenticate(gitusername, gittoken))))

unique(sapply(out, function(x) x$commit$author$name))

I'm also not finding a good example of this out in the google-world. If someone knows how to do this or finds good help, post it here.

atombaby commented 5 years ago

I think this could be tricky. It could also really bulk up the pages. wikimedia has a special tab for this sort of thing. There is a sample here:

https://gist.github.com/alx/730347

which could likely be modified for used. There are two links we could provide that may get us to done without a lot of work. The history file for the file:

https://github.com/FredHutch/wiki/commits/master/_gendemos/MakingTidyData.md

and this link:

https://github.com/FredHutch/wiki/contributors/master/_gendemos/MakingTidyData.md/list

Which likely could be included in the file

dtenenba commented 1 year ago

This would be a fun thing to do sometime. We may want (?) to filter out all users who are no longer part of the FredHutch org in GitHub.