Skip to content

Commit

Permalink
Several small issues
Browse files Browse the repository at this point in the history
* use favicon.jpg in metadata if present
* handle choice correctly on titlepage
* updates to Wiki.
  • Loading branch information
jhellingman committed Mar 10, 2024
1 parent ba3feb3 commit b81223f
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 79 deletions.
119 changes: 61 additions & 58 deletions Wiki/CodingConventions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,74 +21,77 @@ handled in a special way when processing the TEI file.

[cols="<,<,<"]
|===
|*TEI element* |*`@type` value* |*Notes*
|*TEI element* |*`@type` value* |*Notes*

|`ab` |`divNum` |Indicates a division number (typically within a `head` element).
|`ab` |`flushright` |Indicates the `ab` should be set flush right.
|`ab` |`itemNum` |Indicates an item number (typically within a `item` element).
|`ab` |`lineNum` |Indicates a line number (typically within a `p` or `l` element).
|`ab` |`lineNumRef` |Indicates a reference to a line number.
|`ab` |`tocDivNum` |Indicates a division number within a toc.
|`ab` |`tocPageNum` |Indicates a page number within a toc.
|`div1` |`TranscriberNote` |The division is a note by the transcriber (rendered in a different color).
|`div2` |`SubToc` |The division is a toc for the div1 it appears in (content will be replaced by generated content).
|`divGen` |`apparatus` |Generate a section with apparatus notes (can be used multiple times, all apparatus notes between this and the previous instance will be included).
|`divGen` |`Colophon` |Generate a colophon (based on information in the TEI header).
|`divGen` |`ColophonBody` |Generate the body of a colophon (based on information in the TEI header).
|`divGen` |`Footnotes` |Generate a section with footnotes.
|`divGen` |`FootnotesBody` |Just the body.
|`divGen` |`gallery` |Generate a gallery of illustrations (requires availability of thumbnail images).
|`divGen` |`Inclusion` |Include an external file here; using `@url` attribute.
|`divGen` |`index` |Generate an index.
|`divGen` |`IndexToc` |Generate a one-line toc for an Index (displaying one-letter links).
|`divGen` |`LanguageFragments` |Generate a list of fragments in foreign languages (i.e., not the main language of the text).
|`divGen` |`loi` |Generate a table of illustrations.
|`divGen` |`pgfooter` |Generate the Project Gutenberg boilerplate footer.
|`divGen` |`pgheader` |Generate the Project Gutenberg header.
|`divGen` |`toc` |Generate a table of contents. Additional `@rend` attribute value tocMaxLevel(n) can be used to control the depth.
|`divGen` |`toca` |Generate a table of contents (including chapter arguments).
|`divGen` |`tocBody` |Just the body.
|`head` |`label` |The (division) heading is a label indicating its type and number. (Typically, 'Chapter IX').
|`ab` |`divNum` |Indicates a division number (typically within a `head` element).
|`ab` |`figNum` |Indicates a figure number (typically within a `head` element).
|`ab` |`flushright` |Indicates the `ab` should be set flush right. (Deprecated: prefer semantic mark-up)
|`ab` |`itemNum` |Indicates an item number (typically within a `item` element).
|`ab` |`lineNum` |Indicates a line number (typically within a `p` or `l` element).
|`ab` |`lineNumRef` |Indicates a reference to a line number.
|`ab` |`parNum` |Indicates a paragraph number.
|`ab` |`tocDivNum` |Indicates a division number within a toc.
|`ab` |`tocFigNum` |Indicates a figure number within a list of illustrations.
|`ab` |`tocPageNum` |Indicates a page number within a toc.
|`div1` |`TranscriberNote` |The division is a note by the transcriber (rendered in a different color).
|`div2` |`SubToc` |The division is a toc for the div1 it appears in (content will be replaced by generated content).
|`divGen` |`apparatus` |Generate a section with apparatus notes (can be used multiple times, all apparatus notes between this and the previous instance will be included).
|`divGen` |`Colophon` |Generate a colophon (based on information in the TEI header).
|`divGen` |`ColophonBody` |Generate the body of a colophon (based on information in the TEI header).
|`divGen` |`Footnotes` |Generate a section with footnotes.
|`divGen` |`FootnotesBody` |Just the body.
|`divGen` |`gallery` |Generate a gallery of illustrations (requires availability of thumbnail images).
|`divGen` |`Inclusion` |Include an external file here; using `@url` attribute.
|`divGen` |`index` |Generate an index.
|`divGen` |`IndexToc` |Generate a one-line toc for an Index (displaying single-letter links).
|`divGen` |`LanguageFragments` |Generate a list of fragments in foreign languages (i.e., not the main language of the text).
|`divGen` |`loi` |Generate a list of illustrations.
|`divGen` |`pgfooter` |Generate the Project Gutenberg boilerplate footer.
|`divGen` |`pgheader` |Generate the Project Gutenberg header.
|`divGen` |`toc` |Generate a table of contents. Additional `@rend` attribute value tocMaxLevel(n) can be used to control the depth.
|`divGen` |`toca` |Generate a table of contents (including chapter arguments).
|`divGen` |`tocBody` |Just the body.
|`head` |`label` |The (division) heading is a label indicating its type and number. (Typically, 'Chapter IX') Omit when the label is the only head of a chapter.
|`head` |`sub` |The (division) heading is a subtitle.
|`head` |`super` |The (division) heading is the title of a higher level division.
|`idno` |`epub-id` |The `idno` gives a unique identifier for the generated ePub file.
|`idno` |`ISBN` |The `idno` gives the ISBN for the edition.
|`idno` |`LCCN` |The `idno` gives the Library of Congress call number.
|`idno` |`LibThing` |The `idno` gives the Library Thing catalog number for the edition.
|`idno` |`OCLC` |The `idno` gives the WorldCat catalog number for the edition.
|`idno` |`OLN` |The `idno` gives the Open Library catalog number for the (source) edition.
|`idno` |`OLW` |The `idno` gives the Open Library catalog number for the work.
|`idno` |`PGnum` |The `idno` gives the Project Gutenberg ebook number.
|`list` |`determinationTable` |Convert the list to a (potentially nested) table as used for determination in biological works.
|`list` |`tocList` |Convert the list to a (potentially nested) table of contents.
|`p` |`figBottom` |The paragraph will be placed on the bottom-center of a figure.
|`p` |`figBottomLeft` |The paragraph will be placed on the bottom-left of a figure.
|`p` |`figBottomRight` |The paragraph will be placed on the bottom-right of a figure.
|`p` |`figTop` |The paragraph will be placed on the top-center of a figure.
|`p` |`figTopLeft` |The paragraph will be placed on the top-left of a figure.
|`p` |`figTopRight` |The paragraph will be placed on the top-right of a figure.
|`ref` |`endnoteref` |The reference refers to an end-note.
|`ref` |`noteref` |The reference refers to a footnote (The generated footnote number of the note referred to is used in the output; this is intended to be used when a note reference marker is used multiple times to refer to the same footnote, not when referring to a footnote otherwise).
|`ref` |`pageref` |The reference refers to a page (by number; the ref is supposed to only include the actual number referred to).
|`title` |`pgshort` |The title is a short title for Project Gutenberg purposes.
|`titlePart` |`main` |The title part is the main title.
|`titlePart` |`series` |The title part is a series title.
|`head` |`super` |The (division) heading is the title of a higher level division. (Typically, the title of the book repeated above the first chapter.)
|`idno` |`epub-id` |The `idno` gives a unique identifier for the generated ePub file.
|`idno` |`ISBN` |The `idno` gives the ISBN for the edition (don't use for the ISBN of the source!).
|`idno` |`LCCN` |The `idno` gives the Library of Congress call number.
|`idno` |`LibThing` |The `idno` gives the Library Thing catalog number for the edition.
|`idno` |`OCLC` |The `idno` gives the WorldCat catalog number for the edition.
|`idno` |`OLN` |The `idno` gives the Open Library catalog number for the (source) edition.
|`idno` |`OLW` |The `idno` gives the Open Library catalog number for the work.
|`idno` |`PGnum` |The `idno` gives the Project Gutenberg ebook number.
|`list` |`determinationTable` |Convert the list to a (potentially nested) table as used for determination in biological works.
|`list` |`tocList` |Convert the list to a (potentially nested) table of contents.
|`p` |`figBottom` |The paragraph will be placed on the bottom-center of a figure.
|`p` |`figBottomLeft` |The paragraph will be placed on the bottom-left of a figure.
|`p` |`figBottomRight` |The paragraph will be placed on the bottom-right of a figure.
|`p` |`figTop` |The paragraph will be placed on the top-center of a figure.
|`p` |`figTopLeft` |The paragraph will be placed on the top-left of a figure.
|`p` |`figTopRight` |The paragraph will be placed on the top-right of a figure.
|`ref` |`endnoteref` |The reference refers to an end-note.
|`ref` |`noteref` |The reference refers to a footnote (The generated footnote number of the note referred to is used in the output; this is intended to be used when a note reference marker is used multiple times to refer to the same footnote, not when referring to a footnote otherwise).
|`ref` |`pageref` |The reference refers to a page (by number; the ref is supposed to only include the actual number referred to).
|`title` |`pgshort` |The title is a short title for Project Gutenberg purposes.
|`titlePart` |`main` |The title part is the main title.
|`titlePart` |`series` |The title part is a series title.
|`titlePart` |`sub` |The title part is a subtitle.
|`titlePart` |`volume` |The title part is a volume label (e.g., 'Volume II').
|===
[cols="<,<,<"]
|===
|*TEI element* |*`@place` value* |*Notes*
|*TEI element* |*`@place` value* |*Notes*

|`note` |`apparatus` |The note is part of a critical apparatus.
|`note` |`foot` |The note is a footnote (*default*).
|`note` |`margin`, `left`, `right` |The note is a marginal note (set to the left or right of the text block).
|`note` |`cut-in-left`, `cut-in-right` |The note is a _cut-in_ note (set inside the text block).
|`note` |`table` |The note appears directly under the table it appears in.
|`note` |`apparatus` |The note is part of a critical apparatus.
|`note` |`foot` |The note is a footnote (*default*).
|`note` |`margin`, `left`, `right` |The note is a marginal note (set to the left or right of the text block).
|`note` |`cut-in-left`, `cut-in-right` |The note is a _cut-in_ note (set inside the text block; the main text flows around it).
|`note` |`table` |The note appears directly under the table it appears in.
|===
[cols="<,<,<"]
|===
|*TEI element* |*`@unit` value* |*Notes*
|*TEI element* |*`@unit` value* |*Notes*

|`milestone` |`tb` |The milestone is a thematic break.
|`milestone` |`tb` |The milestone is a thematic break.
|===
50 changes: 29 additions & 21 deletions Wiki/UsingTheRendAttribute.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ Simple rendering attribute values provide single keywords to provide a rendering

[cols="<,<"]
|===
|*Element* |*Recognized `@rend` values*

|`hi` |`italic` (_default_) `bold` `bi` `sc` `asc` `sup` `sub` `ex`
|`figure` |`center` (_default_) `left` `right` `inline`
|`p` |`block` `center` `left` (_default_) `right` `indent` `noindent`
|`q` |`block`
|`list` |`number` `bullet` `none` (_default_)
|_Any_ |_Any_ (_these will be added to the class attribute of the output element in HTML_)
|*Element* |*Recognized `@rend` values*

|`hi` |`italic` (_default_) `bold` `bi` `sc` `asc` `sup` `sub` `ex`
|`figure` |`center` (_default_) `left` `right` `inline`
|`p` |`block` `center` `left` (_default_) `right` `indent` `noindent`
|`q` |`block`
|`list` |`number` `bullet` `none` (_default_)
|_Any_ |`rtl` `ltr` (_see section below on directionality_)
|_Any_ |_Any_ (_these will be added to the class attribute of the output element in HTML_)
|===

=== Rendition Ladders
Expand Down Expand Up @@ -54,25 +55,32 @@ The following keys and values are supported: (Note that this list is not exhaust

[cols="<,<,<,<"]
|===
|*Element* |*Key* |*Value* |*Example*

|`text` |`stylesheet` |name of CSS stylesheet, multiple stylesheets can be specified, separated by a comma |`style/classic.css`
|_Any_ |`font` |`italic`, `bold`, `fsc` (full caps and smallcaps), `smallcaps`, `underlined`, `gothic` (note the difference from fall-through CSS) |`&lt;hi rend=&quot;font(bold)&quot;&gt;`
|`p`, `q` |`align` |`right`, `left`, `center`, `block` (that is, justified) |`&lt;p rend=&quot;align(block)&quot;&gt;`
|`p`, `l` |`indent` |The number characters to indent. The size of a character is not fixed, but is roughly the size of the letter m. |`&lt;l rend=&quot;indent(2)&quot;&gt;`
|_Any_ |`link` |any url, rendered as link to the indicated url. |`&lt;figure rend=&quot;link(images/a.jpg)&quot;&gt;`
|`figure`, `head`, `cell` |`image` |any url, rendered as in-line image, obtained from the indicated url. When used on a `head` element, the image appears above the head, when used on a `cell` element, the image appears in the table-cell (typically used to pull in large braces spanning cells). |`&lt;figure rend=&quot;image(images/a.jpg)&quot;&gt;`
|`figure` |`float` |The place to float in image, table, etc. Possible values: left, right. |`&lt;figure rend=&quot;float(left)&quot;&gt;`
|`figure` |`hover-overlay` |In HTML output, when the mouse hovers over the image, the alternative image is shown (using CSS only). |`&lt;figure rend=&quot;hover-overlay(images/overlay.jpg)&quot;&gt;`
|`table`, `list` |`columns` |Set the element in multiple columns. May be applied to tables and lists. |`&lt;list rend=&quot;columns(2)&quot;&gt;...&lt;/list&gt;`
|_Any_ |`class` |Sets a class attribute in the corresponding HTML output. This can be used in combination with custom CSS stylesheets to achieve special effects. |`&lt;p rend=&quot;class(myClass)&quot;&gt;`
|`l` |`hemistich` |Indents the current line with a certain space. When the value starts with a `^` followed by a number _n_, the content of the line _n_ lines before is used, when the value starts with a `#` followed by an id, the content of the element with the id is used, otherwise, the literal content is used. |`&lt;l rend=&quot;hemistich(^1)&quot;&gt;`, `&lt;l rend=&quot;hemistich(#vs21)&quot;&gt;`, `&lt;l rend=&quot;hemistich(Content)&quot;&gt;`
|*Element* |*Key* |*Value* |*Example*

|`text` |`stylesheet` |name of CSS stylesheet, multiple stylesheets can be specified, separated by a comma |`style/classic.css`
|_Any_ |`font` |`italic`, `bold`, `fsc` (full caps and smallcaps), `smallcaps`, `underlined`, `gothic` (note the difference from fall-through CSS) |`&lt;hi rend=&quot;font(bold)&quot;&gt;`
|`p`, `q` |`align` |`right`, `left`, `center`, `block` (that is, justified) |`&lt;p rend=&quot;align(block)&quot;&gt;`
|`p`, `l` |`indent` |The number characters to indent. The size of a character is not fixed, but is roughly the size of the letter m. |`&lt;l rend=&quot;indent(2)&quot;&gt;`
|_Any_ |`link` |any url, rendered as link to the indicated url. |`&lt;figure rend=&quot;link(images/a.jpg)&quot;&gt;`
|`figure`, `head`, `cell` |`image` |any url, rendered as in-line image, obtained from the indicated url. When used on a `head` element, the image appears above the head, when used on a `cell` element, the image appears in the table-cell (typically used to pull in large braces spanning cells). |`&lt;figure rend=&quot;image(images/a.jpg)&quot;&gt;`
|`figure` |`float` |The place to float in image, table, etc. Possible values: left, right. |`&lt;figure rend=&quot;float(left)&quot;&gt;`
|`figure` |`hover-overlay` |In HTML output, when the mouse hovers over the image, the alternative image is shown (using CSS only). |`&lt;figure rend=&quot;hover-overlay(images/overlay.jpg)&quot;&gt;`
|`table`, `list` |`columns` |Set the element in multiple columns. May be applied to tables and lists. |`&lt;list rend=&quot;columns(2)&quot;&gt;...&lt;/list&gt;`
|_Any_ |`class` |Sets a class attribute in the corresponding HTML output. This can be used in combination with custom CSS stylesheets to achieve special effects. |`&lt;p rend=&quot;class(myClass)&quot;&gt;`
|`l` |`hemistich` |Indents the current line with a certain space. When the value starts with a `^` followed by a number _n_, the content of the line _n_ lines before is used, when the value starts with a `#` followed by an id, the content of the element with the id is used, otherwise, the literal content is used. |`&lt;l rend=&quot;hemistich(^1)&quot;&gt;`, `&lt;l rend=&quot;hemistich(#vs21)&quot;&gt;`, `&lt;l rend=&quot;hemistich(Content)&quot;&gt;`
|===

==== Using `@style` and `@rendition`

As an alternative to the `@rend` attribute, the current TEI guidelines also provide `@style` and `@rendition` to define presentation in a formally defined language. `tei2html` assumes that is CSS. See the http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-att.global.rendition.html[TEI guidelines on rendition attributes]. Unlike the values of `@rend`, the specified CSS values are not interpreted at all, but passed to the output CSS directly.

==== Directionality

Since ePub does not allows CSS to be used for directionality, but requires that the HTML `@dir` attribute is used, the following `@rend` values are translated to a `@dir` attribute in HTML.

. `direction(...)`
. `class(rtl)` and `class(ltr)` and the bare equivalents.

==== Implementation notes:

. Handle the `@style` attribute, and output it as a CSS rule.
Expand Down
4 changes: 4 additions & 0 deletions modules/header.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
<link rel="icon" href="{$cover-file}" type="image/x-cover"/>
</xsl:if>

<xsl:if test="f:is-image-present('images/favicon.jpg')">
<link rel="icon" href="images/favicon.jpg" type="image/x-icon"/>
</xsl:if>

<!-- Insert Dublin Core metadata -->
<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"/>

Expand Down
4 changes: 4 additions & 0 deletions modules/titlepage.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
<xsl:apply-templates select="."/>
</xsl:template>

<xsl:template match="choice" mode="titlePage">
<xsl:apply-templates select="."/>
</xsl:template>

<xsl:template match="lb" mode="titlePage">
<br/>
</xsl:template>
Expand Down
Loading

0 comments on commit b81223f

Please sign in to comment.