Blackjacx / WWDC

You don't have the time to watch all the WWDC session videos yourself? No problem me and many contributors extracted the gist for you 🥳

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set up CI to auto-run progress.sh

rogerluan opened this issue · comments

This could probably be GitHub Actions, since it's free and easy to use :)

I found this and this article. We could use the same principle to generate the README.md instead of editing it all the time. Steps would be the following:

  • instead of contributing to the readme we create a new folder 2020
  • pre-populate it with md files named session_number.md
  • Fill the files with the same stubs you created earlier this week
  • once a PR is merged README.md is re-generated using a GitHub action

Advantages:

  • No more manual TOC editing
  • No more conflicts
  • Clean file structure
  • Older years could be part of the default branch and don't have to be archived on another branch
  • Progress could be added automatically

What do you think? I also have use for these separate MD files in another side project...

Interesting approach, I had thought of something similar but thought that it would be an overkill.

I like the pros you raised, though. I think the only con is implementing it (time consuming implementation).
So, comparing "leaving things as is" to the advantages you raised:

  • ToC editing would still be manual, but not a big deal imo.
  • Conflicts are already minimum AFAIK, since the stubbing of the sessions
  • I like the clean file structure you proposed, better than what we have now.
  • We actually don't need the 2019 branch, we can create a 2019_sessions.md with the 2019 branch's README and make it live in master, and README.md would always contain the latest WWDC (2020 for now, but in june 2021 it'd be 2021's).
  • Progress could be added via CI without all that hassle, see #59 :) we'd just have to plug this in CI

I think I'll face the effort. It will be worth it in the end 👍 I'll make it my weekend project ^^

@rogerluan which algorithm did you use to create the site link for the toc entries (#session_header)

I just wrote this:

func normalizeTitleToHyperlink(_ title: String) -> String {
    return title
        .lowercased()
        .replacingOccurrences(of: "★", with: "")
        .replacingOccurrences(of: " ", with: "-")
        .replacingOccurrences(of: "'", with: "")
        .replacingOccurrences(of: "’", with: "")
        .replacingOccurrences(of: "\"", with: "")
        .replacingOccurrences(of: ":", with: "")
        .replacingOccurrences(of: ",", with: "")
        .replacingOccurrences(of: "?", with: "")
        .replacingOccurrences(of: "&", with: "")
}

It's not extensive, but worked out for all the nearly 200 video session entries. To validate the entries, I scanned all the output:

let normalizedLine = normalizeTitleToHyperlink(line)
var set = CharacterSet.alphanumerics
set.insert(charactersIn: "-")
if normalizedLine.rangeOfCharacter(from: set.inverted) != nil {
    print("## \(line)\t\t\tBroke and printed: \(normalizedLine)")
    didFailForAtLeastOneEntry = true
}

Do you have Telegram? reach me on https://t.me/rogerluan @Blackjacx :)

I will tomorrow, late now here :-)

If you have time you can have a look over PR #62
It resolves 2 of the issues :-) Would be cool to have it cross checked before I merge it ^^
After this I'll continue watching sessions like crazy ✌️

It is better to read the commits instead of all the changes at once

Okay the PR is merged. I'll close this when it is confirmed that the readme generation is working

Well it rocks ✌️