-
Notifications
You must be signed in to change notification settings - Fork 0
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
termid
is not always integer
#1
Comments
@strogonoff I agree, and that should be the correct place. Let's make them integers then? I'm actually not sure if Jekyll can do Integer sorting...? |
Liquid allows sorting by a key and if it’s an integer then I assume it’ll sort by the value. I’m +1 on casting each string to integer unless we actually expect non-integer term IDs. Something like |
perhaps |
Perhaps -- I kind of remember that Liquid cannot sort Integers. I think that's why I didn't make the sort happen. Can you double check? |
@ronaldtse I see what you mean, there are reports that everything in Jekyll document frontmatter gets cast to strings. (Although if everything gets cast to string, it’s super confusing why I was getting what seemed like type mismatch error when trying to sort by In any case it’s a generic library without any promise of Jekyll support specifically so IMO it’s not Jekyll sites that should be the main motivation to fix this, just general consistency of output. It might or might not make Geolexica work, I wouldn’t put extra priority because of that. |
Correct, this is a generic library. If possible, feel free to help fix this 👍 |
Fixed, but need to add specs. (in #8) |
In the resulting YAML,
termid
is sometimes a string, sometimes an integer:Generally an unwelcome inconsistency, it also prevents sorting concepts by term ID in restricted environments such as Liquid templates.
I think a conversion can be added here (not sure whether this is the correct spot and what is the best way to do this in Ruby):
https://github.com/riboseinc/tc211-termbase/blob/46de3c8992fd4efa952e77e235aaedeb772ec627/lib/tc211/termbase/concept.rb#L35
The text was updated successfully, but these errors were encountered: