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

Add TokenIDE file generator #18

Merged
merged 5 commits into from
Jan 2, 2024
Merged

Add TokenIDE file generator #18

merged 5 commits into from
Jan 2, 2024

Conversation

kg583
Copy link
Member

@kg583 kg583 commented Dec 20, 2023

The script uses a single class, TokenIDESheet, to store the contents of a token file, as I found it monstrously more difficult to juggle the XML directly. The class has constructors and exporters for XML strings and elements.

The with_tokens method is used to create a copy of the sheet with all the specified token data added in. All metadata found in the original sheet like style parameters are maintained. You can also make a completely new sheet by calling the method on an empty instance.

Note that display names are not added as alternate names if they aren't already there as they are not unique. I don't think this is a big issue, though, as TokenIDE is the example use case for the accessible names (which are used when inserting completely new tokens).

@kg583 kg583 self-assigned this Dec 20, 2023
@kg583 kg583 added the enhancement New feature or request label Dec 20, 2023
@kg583 kg583 merged commit a8f5d28 into main Jan 2, 2024
1 check passed
@kg583 kg583 deleted the tokenide branch January 2, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant