Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Handling several examples #44

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

Merged
merged 19 commits into from
Dec 30, 2024
Merged

Handling several examples #44

merged 19 commits into from
Dec 30, 2024

Conversation

MarcoTrevisiol
Copy link
Contributor

Added support to several examples (both on Helpers and aoc.get mix task). Upgraded deps. Slight change to embedded template.

I hope to have explained everything well-enough in the Changelog. I hope each commit is clean and focused enough, as well.

Furthermore, I am using this version myself and I found it extremely useful on days like 16 or 15 where there are several useful example or days like 21 where the example is not the first "pre code" HTML child.

@mathsaey
Copy link
Owner

Thank you for your pull request! I sadly don't have time for AoC this year, which is why this repo has been a bit dead. However, I'll try to look at your PR asap, though it may only happen after Christmas. I am certainly okay with the idea of supporting multiple examples, as that is a pain point I ran into myself several times.

Does your PR include examples present in part 2 of the challenge? Or does it only look at the public part of the page for now?

@MarcoTrevisiol
Copy link
Contributor Author

I changed the mix aoc.get task so that it downloads each example it can find. I did not explicitly mentioned, but with this commit the private function fetch_examples take a session argument that is passed to the request (if it is not nil), therefore one gets the example of the second part as well. Of course, one needs to invoke the task a second time, after the first part has been completed (remark: this is completely safe since existing files are skipped).

@mathsaey
Copy link
Owner

I went through the updated code and made a few changes. Most changes are quite minor. The two most significant changes are:

  • I added a function list_examples function so that users can easily find out which example corresponds to which n.
  • I changed nth to n, as I think it's shorter to type without loss of information.

Let me sure to know if you disagree with any of these. If you don't, I think I can merge & release this as is 😄.

@MarcoTrevisiol
Copy link
Contributor Author

I agree with all of your changes. Please go on and thank you for the nice work!

@mathsaey
Copy link
Owner

Thank you for the contribution! I'll make one more change: I'll publish this as version 5.0, as the name change of the example files will cause people's tests to break if they don't run mix aoc.get before upgrading.

@mathsaey mathsaey merged commit 327f887 into mathsaey:master Dec 30, 2024
10 checks passed
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