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 list of speakers #143

Closed
wants to merge 14 commits into from
Closed

Add list of speakers #143

wants to merge 14 commits into from

Conversation

MikeRogers0
Copy link
Contributor

@MikeRogers0 MikeRogers0 commented Nov 25, 2020

Issue: #31

The aim of this is to create a list of the most recent speakers which is easy to keep up to date.

TODO

  1. Setup a nice design for displaying speakers
  2. Setup redirect
  3. Verify all speaker data collected from markdown files is accurate (It has some duplicate links & linking to the wrong person).
  4. Add pagination if required? Maybe some kind of search also.

{
"Mike Rogers": {
"profile": {
"github_username": "MikeRogers0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cool thing about GitHub is we can pull a bunch more data about the speaker via their API without an API key.

Copy link
Member

@h-lame h-lame left a comment

Choose a reason for hiding this comment

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

I know this is a draft so not sure what sort of early feedback you're looking for, but I've left some thoughts anyway. Quite excited to see something come together on this though, thanks for tackling it!

Gemfile.lock Outdated Show resolved Hide resolved
source/speakers/index.html.erb Outdated Show resolved Hide resolved
<p>
<%= link_to speaker.blog, speaker.blog %>
</p>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

I know we've taken inspiration from some other website on this, but I'm pretty sure we'll never get most of these details, so lets pare it right back. I quite like the svg icons for the twitter / GitHub links, but I also know that without a huge amount of effort we're probably not going to get twitter and GitHub links for most of our speakers, and for some we don't even have those, some folk just link to LinkedIn and personal websites were the preferred link back in the past. Perhaps we can just introspect on the one link we do have and render an appropriate icon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps we can just introspect on the one link we do have and render an appropriate icon?

I agree :) I was hoping to find a way to pull in a bit more information, I think I'll save that for another PR :)

def all_speakers
data.speakers
.collect { |name, speaker_data| Speaker.new(name, speaker_data) }
.sort_by { |speaker| speaker.name }
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should order this by recency of the speakers talks, so it changes once each meeting is published to show the most recent speakers? I don't think sorting by frequency of talks is a good idea, but maybe recency is weird. We've enough speakers that maybe we'd want A..Z in page navigation so doing anything other than alphabetical is weird?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree we should sort by most recently published, I think it's possible now I've figured out a way to pull the coverage data into a easier to work with format.

lib/speaker_helpers.rb Outdated Show resolved Hide resolved
@MikeRogers0
Copy link
Contributor Author

MikeRogers0 commented Dec 5, 2020

I'm still working on this, but would love some thoughts on the best way to populate a list of speakers and their talks @h-lame :)

The approach I'm currenting is to parse all the source/meetings/*/*/index.html.md files, searching for ## Agenda heading, then from there figuring the the talk title & the speaker (So the first link after the H3, then the following coverage or the speakers talk summary). What do you think?

@MikeRogers0
Copy link
Contributor Author

image

Pretty exciting & a Work in progress, but I figured out a way to extract most the speaker data from previous meetings.

My plan is to export it into a data file, which we can then use to display all the previous speakers & their talks 👍

@MikeRogers0
Copy link
Contributor Author

MikeRogers0 commented Dec 6, 2020

image

@h-lame - What do you think of the http://127.0.0.1:4567/speakers/index.html page? I still need to fix a few of the entries (e.g. where it says the author name is "Redis" & links are duplicated.), but I think I'm on the right path :D

Approach wise: Once I nail down the data, we could potentially have display all the previous speakers with their talks. Then maybe in a future PR we could add a search.

<% elsif speaker_link.include?('github.com') %>
<%= image_tag 'github.svg', width: 24, height: 24 %>
<% else %>
🔗
Copy link
Member

Choose a reason for hiding this comment

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

Can we get an SVG for a standard link svg too? I don't know where the twitter and GitHub ones came from, but the link emoji looks different and has a different baseline, so hopefully we can get a link svg from the same place.


<ul>
<% speaker.talks.each do |talk| %>
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month] %> <%= talk[:year] %></li>
Copy link
Member

Choose a reason for hiding this comment

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

Minor but let's titlecase the month:

Suggested change
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month] %> <%= talk[:year] %></li>
<li><%= link_to talk[:title], "/meetings/#{talk[:year]}/#{talk[:month]}/" %> - <%= talk[:month].titlecase %> <%= talk[:year] %></li>

end

def save_authors_to_json!
File.write(SPEAKERS_DATA_FILE, JSON.pretty_generate(@authors))
Copy link
Member

Choose a reason for hiding this comment

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

Be nice if this file was sorted by name so it's easier to look through and easier to edit as we add things for future meetings. Thinking particularly of the case where we have to add a new talk to an existing speaker. The current order is weird so would get out of hand quickly as we added to it.

Copy link
Member

@h-lame h-lame left a comment

Choose a reason for hiding this comment

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

Looking good so far. The biggest hurdle is going to be the data. I think you've done a great job on extracting what we have, but a cursory skim through the file does suggest there's a lot of tidy up to do.

I think we could try a different parsing approach, tweak what we have, or just do a manual fix up. Not sure what would be best TBH.

What strikes me as odd is we now have speakers.json that has {::coverage ...} links in it to the contents of data/coverage/*.yml and I wonder, if all this should be data/talks/*.yml and we slice and dice what we pull out of those into different structures to support the different rendering purposes in the app?

def call
load_all_talks_from_files!

@talks = @talks.flatten.select { |talk| talk[:author] != nil }.group_by { |talk| talk[:author] }
Copy link
Member

Choose a reason for hiding this comment

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

There's nothing in the file for talks from before 2010. I know the structure of the write-ups has changed a bit, but not by a huge amount I don't think. So it's weird there's nothing in there from those early meetings.

In the json file I've spotted a few weird speaker names where we've got a greedy regexp match on names with multiple links in them. So I wonder if we should revisit the parsing approach in general? Would we get better results if we rendered the page from markdown -> HTML and then parse with nokogiri? Or maybe we render into Kramdowns internal structure and walk parse that?

@MikeRogers0
Copy link
Contributor Author

I'm a little bit slammed & I don't think I'll be able to complete this. Instead of leaving it hanging, I'm going to close it off & come back to it when I have more time.

@MikeRogers0 MikeRogers0 closed this Apr 4, 2021
@MikeRogers0 MikeRogers0 deleted the feature/add-list-of-speakers branch April 4, 2021 19:58
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