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

🔀 Consolidate id deduplication/simplification for JATS #468

Merged
merged 5 commits into from
Jul 10, 2023

Conversation

fwkoch
Copy link
Collaborator

@fwkoch fwkoch commented Jul 8, 2023

JATS requires no duplicate ids across all identifiers (sections, citations, footnotes, etc etc). Further, most examples of JATS files have simple identifiers like ref-1, sec-5 etc.

To solve the first problem, I previously scattered suffixes, hashes, etc throughout the myst-cli and myst-to-jats codebase... it was messy code, made messy ids, and didn't solve all the problems (duplicate ids still popped up in realistic examples).

This PR eliminates the mess described in the previous paragraph and brings all deduplication/simplification to a couple transforms isolated to myst-to-jats: (1) first, a transform that replaces all the identifiers on the targets and creates a lookup of the replacements, then (2) a transform that updates all the references based on the lookup.

@rowanc1
Copy link
Collaborator

rowanc1 commented Jul 10, 2023

Yay!

image

@rowanc1 rowanc1 merged commit 1320ad9 into main Jul 10, 2023
3 checks passed
@rowanc1 rowanc1 deleted the feat/jats-plus branch July 10, 2023 16:54
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