Commit 72c3a5d5 authored by sendler's avatar sendler 🐢
Browse files

Merge branch 'feature/transformation-update' into 'staging'

Feature/transformation update

See merge request ARCHITRAVE/SADE!9
parents f5686989 18d967bc
......@@ -379,17 +379,24 @@ return
<span id="page{string($node/@n)}" class="pb" facs="{ string($node/@facs) }">{ string($node/@n) }</span>
case element ( tei:fw ) return
if (string($node/@place) = 'top-right') then (
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{ string($node) }</span></div>
<div class="tei-fw" style="text-align:right"><span class="fw {string($node/@place)}">{ local:magic($node/node()) }</span></div>
)
else (
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{ string($node) }</span></div>
<div class="tei-fw" style="text-align:left"><span class="fw {string($node/@place)}">{ local:magic($node/node()) }</span></div>
)
case element ( tei:choice ) return
if (string('') = string('')) then (
if ($node/tei:abbr) then (
<abbr class="abbr-yes" style="display:inline" title="{$node/tei:expan}">{ local:magic($node/tei:abbr) }</abbr>,
<abbr class="abbr-no" style="display:none" title="{$node/tei:abbr}">{ local:magic($node/tei:expan) }</abbr>
)
else ()
else if ($node/tei:sic) then (
<abbr class="corr-yes" style="display:inline" title="{$node/tei:corr}">{ local:magic($node/tei:sic) }</abbr>,
<abbr class="corr-no" style="display:none" title="{$node/tei:sic}">{ local:magic($node/tei:corr) }</abbr>
)
else
()
case element (tei:date) return
<span class="tei-date" data-toggle="tooltip" data-placement="bottom" title="{local:castDate(string($node/@when))}">{local:magic($node/node())}<i class="far fa-calendar-alt"></i></span>(: put a span around! is this ok? :)
case element ( tei:lb ) return
......@@ -398,54 +405,71 @@ return
<span class="hi {string($node/@rend)}" rend="{string($node/@rend)}">{ local:magic($node/node()) }</span>
case element ( tei:supplied ) return
<span class="tei-add"><span class="tei-add-bracket">⟨</span>{string($node)}<span class="tei-add-bracket">⟩</span></span>
case element ( tei:placeName ) return
if (($node/@subtype) = 'rooms') then (
<span class="placeName">{local:magic($node/node())}</span>,
<a class="placeName" href="#" onclick="openPlaceName('{substring-before(string($node/@ref),' ')}')" textgridURI="{substring-before(string($node/@ref),' ')}">
<i class="fas fa-map-marker-alt"></i>
</a>,
<a class="placeName" href="#" onclick="openPlaceName('{substring-after(string($node/@ref),' ')}')" textgridURI="{substring-after(string($node/@ref),' ')}">
<i class="fas fa-map-marker-alt"></i>
</a>
)
else (
<a class="placeName" href="#" onclick="openPlaceName('{string($node/@ref)}')" textgridURI="{$node/@ref}">
<span class="placeName">{local:magic($node/node())}</span>
<i class="fas fa-map-marker-alt"></i>
</a>
)
let $refs := tokenize($node/@ref, " ")
return
if ( count($refs) gt 1) then
(<span class="placeName">{local:magic($node/node())}</span>,
for $ref in $refs return
<a class="placeName" href="#" onclick="openPlaceName('{$ref}')" textgridURI="{$ref}">
<i class="fas fa-map-marker-alt"></i>
</a>
)
else
<a class="placeName" href="#" onclick="openPlaceName('{$refs}')" textgridURI="{$refs}">
<span class="placeName">{local:magic($node/node())}</span>
<i class="fas fa-map-marker-alt"></i>
</a>
case element ( tei:geogName ) return
<a class="placeName" href="#" onclick="openPlaceName('{string($node/@ref)}')" textgridURI="{$node/@ref}">
<span class="placeName">{local:magic($node/node())}</span>
<i class="fas fa-map-marker-alt"></i>
</a>
let $refs := tokenize($node/@ref, " ")
return
if ( count($refs) gt 1 ) then
(<span class="placeName">{local:magic($node/node())}</span>,
for $ref in $refs return
<a class="placeName" href="#" onclick="openPlaceName('{$ref}')" textgridURI="{$ref}">
<i class="fas fa-map-marker-alt"></i>
</a>)
else
<a class="placeName" href="#" onclick="openPlaceName('{string($node/@ref)}')" textgridURI="{$node/@ref}">
<span class="placeName">{local:magic($node/node())}</span>
<i class="fas fa-map-marker-alt"></i>
</a>
case element ( tei:persName ) return
if (($node/@subtype) = 'persons') then (
<span class="persName">{local:magic($node/node())}</span>,
<a class="persName" href="#" onclick="openPersName('{substring-before(string($node/@ref),' ')}')" textgridURI="{substring-before(string($node/@ref),' ')}">
<i class="fas fa-user"></i>
</a>,
<a class="persName" href="#" onclick="openPersName('{substring-after(string($node/@ref),' ')}')" textgridURI="{substring-after(string($node/@ref),' ')}">
<i class="fas fa-user"></i>
</a>
)
else if (($node/@subtype) = 'family') then (
<a class="persName" href="#" onclick="openPersName('{string($node/@ref)}')" textgridURI="{$node/@ref}">
<span class="persName">{local:magic($node/node())}</span>
<i class="fas fa-users"></i>
</a>
)
else (
<a class="persName" href="#" onclick="openPersName('{string($node/@ref)}')" textgridURI="{$node/@ref}">
<span class="persName">{local:magic($node/node())}</span>
<i class="fas fa-user"></i>
</a>
)
let $refs := tokenize($node/@ref, " ")
return
if ( count($refs) gt 1) then
(<span class="persName">{local:magic($node/node())}</span>,
for $ref in $refs return
<a class="persName" href="#" onclick="openPersName('{$ref}')" textgridURI="{$ref}">
<i class="fas fa-user"></i>
</a>)
else
<a class="persName" href="#" onclick="openPersName('{$refs}')" textgridURI="{$refs}">
<span class="persName">{local:magic($node/node())}</span>
{if ( $node/@subtype = "family" ) then
<i class="fas fa-users"></i>
else
<i class="fas fa-user"></i>}
</a>
case element ( tei:rs ) return
<a class="ArtWork" href="#" onclick="openArtWork('{string($node/@ref)}')" textgridURI="{$node/@ref}" type="{string($node/@type)}">
<span class="ArtWork">{local:magic($node/node())}</span>
<i class="far fa-gem"></i>
</a>
let $refs := tokenize($node/@ref, " ")
return
if ( count($refs) gt 1 ) then
(<span class="ArtWork">{local:magic($node/node())}</span>,
for $ref in $refs return
<a class="ArtWork" href="#" onclick="openArtWork('{$ref}')" textgridURI="{$ref}" type="{string($node/@type)}">
<i class="far fa-gem"></i>
</a>)
else
<a class="ArtWork" href="#" onclick="openArtWork('{$refs}')" textgridURI="{$node/@ref}" type="{string($node/@type)}">
<span class="ArtWork">{local:magic($node/node())}</span>
<i class="far fa-gem"></i>
</a>
case element ( tei:del ) return
<span class="del"><strike>{string($node)}</strike></span>
case element ( tei:unclear ) return
......@@ -558,6 +582,44 @@ return
)
else (local:magic($node/node()))
case element ( tei:table ) return
local:parse-table($node)
case element ( tei:metamark ) return
element div {
attribute class {"horizontalRule"}
}
case element ( tei:list ) return
element div {
attribute class {"list"},
local:magic($node/node())
}
case element ( tei:item ) return
element span {
attribute class {"tei-item"},
local:magic($node/node())
}
case element ( tei:label ) return
element span {
if ( $node[@rend="center"] ) then
attribute class { "centeredText" }
else
(),
local:magic($node/node())
}
case element ( tei:head ) return
element span {
if ( $node[@rend="center"] ) then
attribute class { "centeredText" }
else
(),
local:magic($node/node())
}
default return
local:magic($node/node())}
......@@ -568,3 +630,27 @@ return
}
}
};
declare function local:parse-table($table as element(tei:table)) as element(div) {
let $head := $table/tei:head
let $foot := $table/tei:trailer
return
element div {
attribute class { "table-container" },
element table {
if ( $head ) then element caption { local:magic($head/node()) } else (),
element tbody {
let $rows := $table/tei:row
for $row in $rows
let $cells := $row/tei:cell
return
element tr {
for $cell in $cells return
element td { local:magic($cell/node()) }
}
}
},
if ( $foot ) then local:magic($foot/node()) else ()
}
};
\ No newline at end of file
......@@ -70,3 +70,50 @@ button:focus {
filter: gray; /* Internet Explorer IE6-9 */
-webkit-filter: grayscale(1); /* Old WebKit Browsers */
}
.latin {
font-family: "ModernAntiqua", sans-serif;
font-size: 0.85em;
}
.italic {
font-style: italic;
}
.underline {
text-decoration: underline;
}
table {
width: 100%;
}
caption {
caption-side: top;
color: inherit;
padding: 0;
}
.horizontalRule {
border-bottom: 1px solid black;
display: inline-block;
top: -0.5rem;
position: relative;
width: 20%;
}
.tei-item {
display: list-item;
list-style: none;
margin-left: 1rem;
}
.topRight {
float: right;
}
.centeredText {
display: flow-root;
margin: auto;
width: 50%;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment