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

templating #2

Merged
merged 5 commits into from
Aug 8, 2022
Merged

templating #2

merged 5 commits into from
Aug 8, 2022

Conversation

hillalex
Copy link
Collaborator

@hillalex hillalex commented Aug 3, 2022

Adding categories, names and emojis into the final json generated, and using hugo templates to render the lists of repos. The same approach can be used to add new views (disease areas etc).

Also update the graph generation to use the same pattern, i.e. have an executable run_generate_graphs script, and deleted obsolete files.

Next step will be to iterate the homepage layout.

scripts/parse.py Outdated
def write_repos(dat, config):
dest = os.path.join(config.path, "repos.json")
dest = os.path.join(config.path, "../data/" "repos.json")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

seemed sensible to just write this into the data dir directly, since that's where it will get used

@hillalex hillalex requested a review from richfitz August 3, 2022 14:19
Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

look good - just some comments, none of which necessarily need anything other than clarification

root = os.path.dirname(os.path.realpath(__file__))
with open('./static/repos.json', 'r') as f:
repos = json.load(f)
generate_graph(repos, "odin", "./static/odin-graph.json")
Copy link
Member

Choose a reason for hiding this comment

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

do you think it's worth doing this by the sprawling config object (so that it's easy to add more later etc)?

scripts/parse.py Outdated
def write_repos(dat, config):
dest = os.path.join(config.path, "repos.json")
dest = os.path.join(config.path, "../data/" "repos.json")
Copy link
Member

Choose a reason for hiding this comment

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

can you create the directory first here, the script errors if it does not exist already.

also can you use something other than Python's creepy implicit string concatenation (either + explicitly or an fstring)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ha, didn't actually notice I'd done this

{
Copy link
Member

Choose a reason for hiding this comment

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

why has only this file changed? when I ran things they all looked unprettified?

Copy link
Member

Choose a reason for hiding this comment

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

also surprised that we've not picked up/removed any additional links in the graph despite the change in R package dependency parsing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just reformatted it to manually eyeball it

Copy link
Member

Choose a reason for hiding this comment

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

for that, I use cat file | jq . usually :)

@hillalex hillalex requested a review from richfitz August 4, 2022 13:02
@hillalex hillalex merged commit af9ab97 into source Aug 8, 2022
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