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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions se/data/templates/colophon.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo." src="../images/logo.svg" epub:type="z3998:publisher-logo se:image.color-depth.black-on-transparent"/>
</header>
<p><i epub:type="se:name.publication.book">TITLE</i><br/>
was published in YEAR by<br/>
was published in <time>YEAR</time> by<br/>
<a href="AUTHOR_WIKI_URL">AUTHOR</a>.</p>
<p>This ebook was produced for<br/>
<a href="https://standardebooks.org">Standard Ebooks</a><br/>
by<br/>
<a href="PRODUCER_URL">PRODUCER</a>,<br/>
and is based on a transcription produced in PG_YEAR by<br/>
and is based on a transcription produced in <time>PG_YEAR</time> by<br/>
<b epub:type="z3998:personal-name">TRANSCRIBER_1</b>, <b epub:type="z3998:personal-name">TRANSCRIBER_2</b>, and <a href="https://www.pgdp.net">The Online Distributed Proofreading Team</a><br/>
for<br/>
<a href="PG_URL">Project Gutenberg</a><br/>
and on digital scans from the<br/>
<a href="IA_URL">Internet Archive</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">PAINTING</i>,<br/>
a painting completed in YEAR by<br/>
a painting completed in <time>YEAR</time> by<br/>
<a href="COVER_ARTIST_WIKI_URL">COVER_ARTIST</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></b><br/>
<b><time datetime="1900-01-01T00:00:00Z">January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/SE_IDENTIFIER">standardebooks.org/ebooks/SE_IDENTIFIER</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
4 changes: 2 additions & 2 deletions se/se_epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,8 @@ def set_release_timestamp(self) -> None:
dom = self.get_dom(file_path)

if dom.xpath("/html/body/section[contains(@epub:type, 'colophon')]"):
for node in dom.xpath("/html/body/section[contains(@epub:type, 'colophon')]//b[contains(text(), 'January 1, 1900')]"):
node.replace_with(se.easy_xml.EasyXmlElement(etree.fromstring(str.encode("<b>" + now_friendly + "</b>"))))
for node in dom.xpath("/html/body/section[contains(@epub:type, 'colophon')]//time[contains(text(), 'January 1, 1900')]"):
node.replace_with(se.easy_xml.EasyXmlElement(etree.fromstring(str.encode("<time datetime=\"" + now_iso + "\">" + now_friendly + "</time>"))))

with open(file_path, "w", encoding="utf-8") as file:
file.write(dom.to_string())
Expand Down
2 changes: 1 addition & 1 deletion se/se_epub_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def build(self, run_epubcheck: bool, check_only: bool, build_kobo: bool, build_k
with open(file_path, "r+", encoding="utf-8") as file:
xhtml = file.read()

xhtml = xhtml.replace("<p>The first edition of this ebook was released on<br/>", f"<p>This edition was released on<br/>\n\t\t\t<b>{last_updated_friendly}</b><br/>\n\t\t\tand is based on<br/>\n\t\t\t<b>revision {self.last_commit.short_sha}</b>.<br/>\n\t\t\tThe first edition of this ebook was released on<br/>")
xhtml = xhtml.replace("<p>The first edition of this ebook was released on<br/>", f"<p>This edition was released on<br/>\n\t\t\t<b><time datetime=\"{last_updated_iso}\">{last_updated_friendly}</time></b><br/>\n\t\t\tand is based on<br/>\n\t\t\t<b>revision {self.last_commit.short_sha}</b>.<br/>\n\t\t\tThe first edition of this ebook was released on<br/>")

file.seek(0)
file.write(xhtml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo." src="../images/logo.svg" epub:type="z3998:publisher-logo se:image.color-depth.black-on-transparent"/>
</header>
<p><i epub:type="se:name.publication.book">Unknown Novel</i><br/>
was published in 1810 by<br/>
was published in <time>1810</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Jane_Austen">Jane Austen</a>.</p>
<p>This ebook was produced for<br/>
<a href="https://standardebooks.org">Standard Ebooks</a><br/>
by<br/>
<b>An Anonymous Volunteer</b>,<br/>
and is based on a transcription produced in 2010 by<br/>
and is based on a transcription produced in <time>2010</time> by<br/>
<b class="name">An Anonymous Volunteer</b><br/>
for<br/>
<a href="https://www.gutenberg.org/ebooks/161">Project Gutenberg</a><br/>
and is based on digital scans from the<br/>
<a href="https://archive.org/details/bub_gb_RtT0OLKFMHsC">Internet Archive</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">At the Mirror</i>,<br/>
a painting completed in 1827 by<br/>
a painting completed in <time>1827</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Georg_Friedrich_Kersting">Georg Friedrich Kersting</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></b><br/>
<b><time datetime="1900-01-01T00:00:00Z">January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/jane-austen/unknown-novel">standardebooks.org/ebooks/jane-austen/unknown-novel</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo." src="../images/logo.svg" epub:type="z3998:publisher-logo se:image.color-depth.black-on-transparent"/>
</header>
<p><i epub:type="se:name.publication.book">Unknown Novel</i><br/>
was published in 1810 by<br/>
was published in <time>1810</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Jane_Austen">Jane Austen</a>.</p>
<p>This ebook was produced for<br/>
<a href="https://standardebooks.org">Standard Ebooks</a><br/>
by<br/>
<b>An Anonymous Volunteer</b>,<br/>
and is based on a transcription produced in 2010 by<br/>
and is based on a transcription produced in <time>2010</time> by<br/>
<b class="name">An Anonymous Volunteer</b><br/>
for<br/>
<a href="https://www.gutenberg.org/ebooks/161">Project Gutenberg</a><br/>
and is based on digital scans from the<br/>
<a href="https://archive.org/details/bub_gb_RtT0OLKFMHsC">Internet Archive</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">At the Mirror</i>,<br/>
a painting completed in 1827 by<br/>
a painting completed in <time>1827</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Georg_Friedrich_Kersting">Georg Friedrich Kersting</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></b><br/>
<b><time datetime="1900-01-01T00:00:00Z">January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/jane-austen/unknown-novel">standardebooks.org/ebooks/jane-austen/unknown-novel</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo" src="../images/logo.svg" epub:type="z3998:publisher-logo"/>
</header>
<p><i epub:type="se:name.publication.book">Great Expectations</i><br/>
was published in 1861 by<br/>
was published in <time>1861</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Charles_Dickens">Charles Dickens</a>.</p>
<p>This ebook was produced for the<br/>
<a href="https://standardebooks.org">Standard Ebooks project</a><br/>
by<br/>
<a href="https://lauraklappenbach.com">Laura Klappenbach</a>,<br/>
and is based on a transcription produced in 1998 by<br/>
and is based on a transcription produced in <time>1998</time> by<br/>
<b epub:type="z3998:personal-name">An Anonymous Volunteer</b> and <b epub:type="z3998:personal-name">David Widger</b><br/>
for<br/>
<a href="https://www.gutenberg.org/ebooks/1400">Project Gutenberg</a><br/>
and on digital scans from the<br/>
<a href="https://catalog.hathitrust.org/Record/011405484">HathiTrust Digital Library</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">Self-Portrait</i>,<br/>
a painting completed in 1812 by<br/>
a painting completed in <time>1812</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Joseph_Paelinck">Joseph Paelinck</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>December 23, 2019, 10:06 <abbr class="eoc">p.m.</abbr></b><br/>
<b><time datetime="2019-12-23T22:06:00Z">December 23, 2019, 10:06 <abbr class="eoc">p.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/charles-dickens/great-expectations">standardebooks.org/ebooks/charles-dickens/great-expectations</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</header>
<p><i epub:type="se:name.publication.book">Great Expectations</i><br/>

was published in 1861 by<br/>
was published in <time>1861</time> by<br/>

<a href="https://en.wikipedia.org/wiki/Charles_Dickens">Charles Dickens</a>.</p>
<p>This ebook was produced for the<br/>
Expand All @@ -24,7 +24,7 @@

<a href="https://lauraklappenbach.com">Laura Klappenbach</a>,<br/>

and is based on a transcription produced in 1998 by<br/>
and is based on a transcription produced in <time>1998</time> by<br/>

<b epub:type="z3998:personal-name">An Anonymous Volunteer</b> and <b epub:type="z3998:personal-name">David Widger</b><br/>

Expand All @@ -39,20 +39,20 @@

<i epub:type="se:name.visual-art.painting">Self-Portrait</i>,<br/>

a painting completed in 1812 by<br/>
a painting completed in <time>1812</time> by<br/>

<a href="https://en.wikipedia.org/wiki/Joseph_Paelinck">Joseph Paelinck</a>.<br/>

The cover and title pages feature the<br/>

<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>

typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>

<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>

<b>December 23, 2019, 10:06 <abbr class="eoc">p.m.</abbr>
<b><time datetime="2019-12-23T22:06:00Z">December 23, 2019, 10:06 <abbr class="eoc">p.m.</abbr></time>
</b><br/>

You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
Expand Down
10 changes: 5 additions & 5 deletions tests/lint/semantic/s-041/in/src/epub/text/colophon.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo." src="../images/logo.svg" epub:type="z3998:publisher-logo se:image.color-depth.black-on-transparent"/>
</header>
<p><i epub:type="se:name.publication.book">Unknown Novel</i><br/>
was published in 1810 by<br/>
was published in <time>1810</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Jane_Austen">Jane Austen</a>.</p>
<p>This ebook was produced for<br/>
<a href="https://standardebooks.org">Standard Ebooks</a><br/>
by<br/>
<b>An Anonymous Volunteer</b>,<br/>
and is based on a transcription produced in 2010 by<br/>
and is based on a transcription produced in <time>2010</time> by<br/>
<b class="name">An Anonymous Volunteer</b><br/>
for<br/>
<a href="https://www.gutenberg.org/ebooks/161">Project Gutenberg</a><br/>
and is based on digital scans from the<br/>
<a href="https://archive.org/details/bub_gb_RtT0OLKFMHsC">Internet Archive</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">At the Mirror</i>,<br/>
a painting completed in 1827 by<br/>
a painting completed in <time>1827</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Georg_Friedrich_Kersting">Georg Friedrich Kersting</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></b><br/>
<b><time datetime="1900-01-01T00:00:00Z">January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/jane-austen/unknown-novel/john-doe">standardebooks.org/ebooks/jane-austen/unknown-novel/john-doe</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
10 changes: 5 additions & 5 deletions tests/lint/semantic/s-056/in/src/epub/text/colophon.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
<img alt="The Standard Ebooks logo" src="../images/logo.svg" epub:type="z3998:publisher-logo"/>
</header>
<p><i epub:type="se:name.publication.book">Unknown Novel</i><br/>
was published in 1900 by<br/>
was published in <time>1900</time> by<br/>
<a href="https://en.wikipedia.org/wiki/Jane_Austen">Jane Austen</a>.</p>
<p>This ebook was produced for the<br/>
<a href="https://standardebooks.org">Standard Ebooks project</a><br/>
by<br/>
<a href="https://producer.example.com">A. Producer</a>,<br/>
and is based on a transcription produced in 2000 by<br/>
and is based on a transcription produced in <time>2000</time> by<br/>
<b epub:type="z3998:personal-name">A. Transcriber</b>, <b epub:type="z3998:personal-name">B. Transcriber</b>, and <a href="https://www.pgdp.net">The Online Distributed Proofreading Team</a><br/>
for<br/>
<a href="https://www.gutenberg.org/ebooks/1">Project Gutenberg</a><br/>
and on digital scans from the<br/>
<a href="https://archive.org/details/emmaanovelinthr02austgoog">Internet Archive</a>.</p>
<p>The cover page is adapted from<br/>
<i epub:type="se:name.visual-art.painting">A Very Nice Painting</i>,<br/>
a painting completed in 1900 by<br/>
a painting completed in <time>1900</time> by<br/>
<a href="https://artist.example.com">Ann Artist</a>.<br/>
The cover and title pages feature the<br/>
<b epub:type="se:name.visual-art.typeface">League Spartan</b> and <b epub:type="se:name.visual-art.typeface">Sorts Mill Goudy</b><br/>
typefaces created in 2014 and 2009 by<br/>
typefaces created in <time>2014</time> and <time>2009</time> by<br/>
<a href="https://www.theleagueofmoveabletype.com">The League of Moveable Type</a>.</p>
<p>The first edition of this ebook was released on<br/>
<b>January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></b><br/>
<b><time datetime="1900-01-01T00:00:00Z">January 1, 1900, 12:00 <abbr class="eoc">a.m.</abbr></time></b><br/>
You can check for updates to this ebook, view its revision history, or download it for different ereading systems at<br/>
<a href="https://standardebooks.org/ebooks/jane-austen/unknown-novel">standardebooks.org/ebooks/jane-austen/unknown-novel</a>.</p>
<p>The volunteer-driven Standard Ebooks project relies on readers like you to submit typos, corrections, and other improvements. Anyone can contribute at <a href="https://standardebooks.org">standardebooks.org</a>.</p>
Expand Down
Loading