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

Use time markup in colophon #759

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Use time markup in colophon #759

wants to merge 2 commits into from

Conversation

robinwhittleton
Copy link
Member

This defaults years to be within <time> tags, which will automatically work for everything published after 1000. It also adjusts prepare_release to add the ISO datetime to the colophon “released on” field.

I knocked this together in 20 mins, so if you think it’ll be too much work for not enough value to update the corpus, let’s close it, no harm done 🙂

This defaults years to be within <time> tags, which will automatically work for everything published after 1000. It also adjusts prepare_release to add the ISO datetime to the colophon “released on” field.
@apasel422
Copy link
Contributor

I had been thinking about proposing this a while ago. Nice!

@acabal
Copy link
Member

acabal commented Oct 21, 2024

OK, I think we can do this; but we will of course have to update the corpus. That might be tricky... we can assume any string of 4 digits is a year, but what about low or BC dates like in Epictetus or odd formulations (also Epictetus)?

Then, we will have to calculate the ISO timestamp of the actual release date, this will have to be scripted a one-off update.

I think updating the corpus will be the actual hard part here.

Lastly we need to update se_epub_build.py line 209 in the toolset to insert <time> during build.

@robinwhittleton
Copy link
Member Author

I’ll look into the se_epub_build.py update, thanks for the hint.

I had a scan through the corpus and found this non-standard dating. We might want to pick a standard for BC/BCE and AD/CE as well.

Date ranges with incomplete years

Published 0 -> 999 so needs a 4-digit datetime padded with zeros

BCE dates that can’t be represented with datetime

Vague dates that can’t be represented with datetime

@robinwhittleton
Copy link
Member Author

Let’s reiterate this once more: I really don’t mind if you decide that the value isn’t there and we don’t want to do this.

@acabal
Copy link
Member

acabal commented Oct 23, 2024

I think it's consistent with the project goals so it's worthwhile. Updating the corpus will be work.

I also wonder if we can add a lint check for this that somehow ignores odd constructions or year ranges like in short fiction collections.

Note that I think it should be possible to create an ISO timestamp of a BCE date; the years would just be negative. See https://www.tondering.dk/claus/cal/iso8601.php However whether or not that will be validate is an open question, you can try running it through an HTML validator to see.

@robinwhittleton
Copy link
Member Author

So, I’d tried negative numbers before, but got errors in the validator and dismissed it as non-spec-compliant. But I‘ve just realised that I didn’t know that years needed to be padded to four digits with zeros, and trying -0001 just throws a warning about time zones now, not an error.

I had considered lint checks, but I figured that, to start with at least, if we have the <time> elements in the colophon template they’re likely to stay in place.

I will probably need to update the examples in the manual’s “Colophon” section. And it might be worth adding something about how to complete the datetime attribute.

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