Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Build static web page #559
Build static web page #559
Changes from 25 commits
d191232
5ca7f38
5bc35cf
6dc2992
ab56070
0cf95c3
be6726b
d2d402b
0e7511a
66a9aa5
ad8316c
376652d
e797830
712fc8e
9ef45ae
7c02a28
ff6453e
f8d6f86
c266055
5e1de6a
0aed88a
30beee5
ade5769
eedd67c
221b7b8
b2e8cb3
a8ff044
a5371ee
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add the description now: #569. Frank gave a suggestion of what text to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code to create a single card would be good in a helper function. It will make the overall logic easier to read.
I know you're changing the
count_read_more
variable, which is global. The clearest approach would be to have your function return something that indicates the read more was used, and then whatever calls your helper function updatescount_read_more
accordingly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After our conversation, we decided to keep the code inside the
build_website
method. The creation of the cards is not complex enough to read, and a helper function won't be called from any other method in the file. That auxiliary function would have to return two values, the card itself and a boolean to inform when the read-more-button has been used, therefore it can be less readable at the end.Another point in favor of the helper function is that it will be more easy to test. Right now we can only create a test for the creation of the entire website and not for each card. Regardless this is true and we don't follow the DRY programming ideology, we think that this function doesn't need a test because there aren't many things that can fail, and in addition, the website is simple enough to just open the result (
index.html
) and see if all worked.