Skip to content

Crosswalk directory refactor - #130

Open
meldra wants to merge 10 commits into
codemeta:masterfrom
meldra:crosswalk-directory-refactor
Open

Crosswalk directory refactor#130
meldra wants to merge 10 commits into
codemeta:masterfrom
meldra:crosswalk-directory-refactor

Conversation

@meldra

@meldra meldra commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

meldra added 5 commits August 4, 2026 21:26
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 progval left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread content/crosswalk/_index.md Outdated
Comment on lines +23 to +24
Various [tools](/tools) for CodeMeta use Crosswalk mappings to convert existing
metadata into a `codemeta.json` file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure any of them actually use the crosswalks. They are not really machine-readable.

@lindangulopez lindangulopez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@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"].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oh wow i have no idea how... they were definitely the complete var before. thanks.

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.

3 participants