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

Set up CI to auto-run progress.sh #57

Closed
rogerluan opened this issue Jun 29, 2020 · 9 comments
Closed

Set up CI to auto-run progress.sh #57

rogerluan opened this issue Jun 29, 2020 · 9 comments

Comments

@rogerluan
Copy link
Contributor

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

@Blackjacx
Copy link
Owner

Blackjacx commented Jun 29, 2020

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...

@rogerluan
Copy link
Contributor Author

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 Add Progress Badge #59 :) we'd just have to plug this in CI

@Blackjacx
Copy link
Owner

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

@Blackjacx
Copy link
Owner

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

@stherold stherold mentioned this issue Jun 30, 2020
2 tasks
@rogerluan
Copy link
Contributor Author

rogerluan commented Jun 30, 2020

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
}

@rogerluan
Copy link
Contributor Author

rogerluan commented Jun 30, 2020

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

@Blackjacx
Copy link
Owner

Blackjacx commented Jun 30, 2020

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

@Blackjacx
Copy link
Owner

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

@Blackjacx
Copy link
Owner

Well it rocks ✌️

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

No branches or pull requests

2 participants