Skip to content

Commit

Permalink
tei->html: render bibliographies, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EsGeh authored and EsGeh committed Dec 19, 2019
1 parent 08d0ffe commit fa4f45e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ In order to apply the workflow to any other publication copy it into the `input/

$ gather_pickledata.py input/example/tei/exampleTEI.xml input/example/tei/example.bib
$ tei2imxml.py -f input/example/tei/exampleTEI.xml

1. eoaTEI -> html

$ tei2html.py
16 changes: 15 additions & 1 deletion src/stylesheets/tei2html/tei2html_chapter_utils.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
</div>
<a class="accordion__showall show" href="#">Close All</a>
<!-- print chapter content -->
<xsl:apply-templates mode="container" select="(if (tei:div[@type = 'section']) then (tei:div[@type = 'section'][1]/(. | following-sibling::*)) else (*))[not(self::tei:head)]"/>
<xsl:apply-templates mode="container" select="(if (tei:div[@type = 'section']) then (tei:div[@type = 'section'][1]/(. | following-sibling::*)) else ())[not(self::tei:head)]"/>
<xsl:call-template name="footnotes"/>
</div>
</xsl:template>
Expand Down Expand Up @@ -373,4 +373,18 @@ tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
</xsl:call-template>
</xsl:template>

<xsl:template mode="chapter_main_paragraphs" match="tei:listBibl[@type = 'references']">
<xsl:variable name="id"><xsl:call-template name="container_id"/></xsl:variable>
<xsl:sequence select="eoa:info(concat('bibliography', $id))"/>
<xsl:call-template name="render_paragraph_container">
<xsl:with-param name="content" as="element()*">
<xsl:for-each select="tei:bibl">
<p class="bibliography">
<xsl:apply-templates mode="inline"/>
</p>
</xsl:for-each>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
2 changes: 1 addition & 1 deletion src/stylesheets/tei2html/utils/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<xsl:param name="platform_uri" as="xs:string" select="''"/>

<xsl:variable name="transl" select="document('../../data/aux/translations.xml')"/>
<xsl:variable name="transl" select="document('../../../data/aux/translations.xml')"/>
<xsl:variable name="apos" as="xs:string">'</xsl:variable>

<xsl:function name="eoa:prepare_ref_strings" as="xs:string*">
Expand Down
4 changes: 2 additions & 2 deletions src/tei2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def copy_dir(
)
parser.add_argument(
"-f", "--filename",
default = Path("*.xml"),
default = Path("*_with_bibl.xml"),
type = Path,
help = "xml file inside PUBLICATION_DIR, or absolute path. Patterns like '*.xml' are also acceptable"
)
Expand Down Expand Up @@ -138,7 +138,7 @@ def copy_dir(
)
parser.add_argument(
"PUBLICATION_DIR",
default = Path("input/example/tei"),
default = DEFAULT_OUTPUT_DIR / "from_tei/with_bibl",
help = "directory containing the publication (including resources like pictures, etc.)",
nargs = '?', # (optional)
type = Path,
Expand Down

0 comments on commit fa4f45e

Please sign in to comment.