Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tei->html: platform name, uri, aux files dir as template params
  • Loading branch information
EsGeh authored and EsGeh committed Jan 19, 2020
1 parent a7cae32 commit bd204a5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/stylesheets/tei2html/tei2html.xsl
Expand Up @@ -35,12 +35,17 @@
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="'../../../data/aux'"/>

<!--
<xsl:param name="verbosity" as="xs:integer" required="no" select="0"/>
-->

<xsl:template match="/">
<xsl:sequence select="eoa:info(concat('platform name: ', $platform_name))"/>
<xsl:sequence select="eoa:info(concat('platform uri: ', $platform_uri))"/>
<xsl:variable name="output_subdir" as="xs:string">
<xsl:value-of select="eoa:conc_path3($output_dir, $series, $publication_number)"/>
</xsl:variable>
Expand Down
3 changes: 3 additions & 0 deletions src/stylesheets/tei2html/tei2html_chapter.xsl
Expand Up @@ -18,6 +18,9 @@
</eoa:entry>
</xsl:param>
<xsl:param name="chapter_nr" as="xs:integer" required="1"/>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="../../../data/aux"/>

<xsl:output method="html" encoding="UTF-8"/>

Expand Down
2 changes: 2 additions & 0 deletions src/stylesheets/tei2html/tei2html_chapter_utils.xsl
Expand Up @@ -34,8 +34,10 @@
<xsl:with-param name="title">
<xsl:call-template name="chapter_title"/>
</xsl:with-param>
<!--
<xsl:with-param name="platform_name">Edition Open Access</xsl:with-param>
<xsl:with-param name="platform_link">http://edition-open-access.de</xsl:with-param>
-->
<xsl:with-param name="platform_logo">
<!-- TODO: replace by "text logo" -->
<xsl:value-of select="concat($webdesign_url, 'assets/images/logo.png')"/>
Expand Down
3 changes: 3 additions & 0 deletions src/stylesheets/tei2html/tei2html_publ_frontpage.xsl
Expand Up @@ -18,6 +18,9 @@
<eoa:title>Publications</eoa:title>
</eoa:entry>
</xsl:param>
<xsl:param name="platform_name" as="xs:string" select="'dummy-platform'"/>
<xsl:param name="platform_uri" as="xs:string" select="'http://dummy-platform.com'"/>
<xsl:param name="aux_uri" as="xs:string" select="../../../data/aux"/>

<xsl:include href="tei2html_publ_frontpage_utils.xsl"/>
<xsl:include href="utils/html_container.xsl"/>
Expand Down
2 changes: 0 additions & 2 deletions src/stylesheets/tei2html/tei2html_publ_frontpage_utils.xsl
Expand Up @@ -27,8 +27,6 @@
<xsl:with-param name="title">
<xsl:apply-templates select="//tei:titleStmt/tei:title[@type='main']"/>
</xsl:with-param>
<xsl:with-param name="platform_name">Edition Open Access</xsl:with-param>
<xsl:with-param name="platform_link">http://edition-open-access.de</xsl:with-param>
<xsl:with-param name="platform_logo">
<!-- TODO: replace by "text logo" -->
<xsl:value-of select="eoa:conc_path($webdesign_url, 'assets/images/logo.png')"/>
Expand Down
4 changes: 1 addition & 3 deletions src/stylesheets/tei2html/utils/common.xsl
Expand Up @@ -13,9 +13,7 @@
indent="yes"
/>

<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(eoa:conc_path($aux_uri, 'translations.xml'))"/>
<xsl:variable name="apos" as="xs:string">'</xsl:variable>

<xsl:function name="eoa:prepare_ref_strings" as="xs:string*">
Expand Down
6 changes: 4 additions & 2 deletions src/stylesheets/tei2html/utils/render.xsl
Expand Up @@ -31,8 +31,10 @@
<xsl:param name="breadcrumb_items" as="element(eoa:entry)*"/>
<xsl:param name="nav_items" as="element(eoa:entry)*"/>
<xsl:param name="footer_items" as="element(eoa:entry)*"/>
<!--
<xsl:param name="platform_name"/>
<xsl:param name="platform_link"/>
-->
<xsl:param name="platform_logo"/>
<xsl:param name="title"/>
<xsl:param name="meta_tags"/>
Expand All @@ -58,7 +60,7 @@
<div class="header__content">
<div class="blocklogo container">
<div class="blocklogo__logo">
<a href="{$platform_link}">
<a href="{$platform_uri}">
<img class="blocklogo__img" src="{eoa:conc_path($webdesign_url, 'logo.png')}" alt="logo" data-object-fit="cover"/>
</a>
</div>
Expand Down Expand Up @@ -152,7 +154,7 @@
<a class="share" href="#">Share<span>this Page</span></a>
</div>
<div class="footer-logo">
<a class="footer-logo__link" href="{$platform_link}" target="_blank">
<a class="footer-logo__link" href="{$platform_uri}" target="_blank">
<img class="logo logo--text" src="{$platform_logo}" alt="{$platform_name}"/>
</a>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/tei2html.py
Expand Up @@ -128,9 +128,15 @@ def copy_dir(
type = Path,
help="static files of publication (relative to OUTPUT_DIR, or absolute)"
)
parser.add_argument(
"-n", "--platform-name",
default = 'dummy-platform',
type = str,
help="internal links must be absolute, to this address, or relative, if empty"
)
parser.add_argument(
"-u", "--platform-uri",
default = '',
default = 'http://dummy-platform.com',
type = str,
help="internal links must be absolute, to this address, or relative, if empty"
)
Expand Down Expand Up @@ -204,6 +210,7 @@ def copy_dir(
f"output_dir={output_dir}",
f"webdesign_url={args.webdesign}",
f"publ_static_url={args.static}",
f"platform_name={args.platform_name}",
f"platform_uri={args.platform_uri}",
] +
args.param,
Expand Down

0 comments on commit bd204a5

Please sign in to comment.