Crosswalk directory refactor - #130
Conversation
This is a fairly significant change. The script grabs the field headers from the `codemeta.csv` file and generates a markdown file in /content/crosswalk for each. The default values can be overridden using the values in the `data/crosswalk_pages.json This somewhat future-proofs crosswalk additions as it will no longer be necessary for a page to be manually created in a whole separate repo, for the crosswalk to be properly disoverable. Which has demonstrably been an issue. I could have simply made the missing pages but this is the more sensible approach. The script preserves the existing customizations for each of the existing crosswalk pages. This PR does not yet remove the pages, pending discussion.
Also make use of new parameters for the alt text for list images.
progval
left a comment
There was a problem hiding this comment.
It does not remove the existing markdown files in content/crosswalk/. I think this allows for easier reviewing.
It's fine, you can remove them.
| Various [tools](/tools) for CodeMeta use Crosswalk mappings to convert existing | ||
| metadata into a `codemeta.json` file. |
There was a problem hiding this comment.
I'm not sure any of them actually use the crosswalks. They are not really machine-readable.
There was a problem hiding this comment.
@meldra is there a bug in line 41:
match = next((item for item in orides if (item["stem"] == real_stem) or (["short"] == real_stem) or (["name"] == real_stem)), None)
The second and third conditions are missing item before the brackets. ["short"] on
its own is a new list containing the word "short" not a lookup on item. So it's
comparing a list to a string, which is never true in Python. Same issue with ["name"].
| stem_clean = real_stem = stem.strip() | ||
| stem_slug = re.sub(r'[^a-zA-Z0-9]+', '-', stem_clean) | ||
|
|
||
| # Find our stem in the overrides file |
There was a problem hiding this comment.
@meldra is there a bug in line 41:
match = next((item for item in orides if (item["stem"] == real_stem) or (["short"] == real_stem) or (["name"] == real_stem)), None)
The second and third conditions are missing item before the brackets. ["short"] on
its own is a new list containing the word "short" not a lookup on item. So it's
comparing a list to a string, which is never true in Python. Same issue with ["name"].
There was a problem hiding this comment.
oh wow i have no idea how... they were definitely the complete var before. thanks.
|
One issue I've just noticed is that these generated files need to be gitignored. However the _index.md page needs to remain, so the directory cannot be fully ignored. Easiest solution would be to generate a gitignore for the directory at the same time as the pages, which I'll do tomorrow. |
They're generated now and don't need to live in the repository so the generated collection just pollutes checkouts.
8d6f72e to
03227e1
Compare
I was tired and forgot about ! The generated stuff is gitignored now. This is also now temporarily available for preview at https://codemeta.opinions.monster/crosswalk |
This automates the sync of crosswalks to the website repository.
It does not remove the existing markdown files in
content/crosswalk/. I think this allows for easier reviewing. They should all be faithfully reproduced with amendments. I believe the github action will happily commit the changes when deployed live.