Skip to content

Commit

Permalink
fix some wikipedia styling
Browse files Browse the repository at this point in the history
i.e. remove disambiguation links and push tables to the right
  • Loading branch information
peterstadler committed Jul 5, 2018
1 parent 97cd503 commit 483c58a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ declare
%templates:wrap
%templates:default("lang", "en")
function app:wikipedia-text($node as node(), $model as map(*), $lang as xs:string) as item()* {
let $wikiText := wega-util:transform($model('wikiContent')//xhtml:div[@id='bodyContent'], doc(concat($config:xsl-collection-path, '/wikipedia.xsl')), config:get-xsl-params(()))/node()
let $wikiText := wega-util:transform($model('wikiContent')//xhtml:div[@id='bodyContent'], doc(concat($config:xsl-collection-path, '/wikipedia.xsl')), config:get-xsl-params(()))
return
if(exists($wikiText)) then $wikiText
else lang:get-language-string('failedToLoadExternalResource', $lang)
Expand Down
11 changes: 11 additions & 0 deletions resources/less/gui.less
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,17 @@ div.table-wrapper {
padding: 0 0.5em 0 0;
}

/* Some Wikipedia styling rules*/
#wikipediaText {
.float-right {
float:right;
margin: 0em 0em 2em 2em;
}
.wikipediaOrigin {
font-style: italic;
}
}

/* settings for "What happened on?" on start page */
.history {
p {
Expand Down
11 changes: 8 additions & 3 deletions xsl/wikipedia.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="div[@id='siteSub']">
<xsl:element name="span">

<xsl:template match="div[@id='siteSub']" priority="1">
<xsl:element name="div">
<xsl:attribute name="class" select="'wikipediaOrigin'"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

<!--<xsl:template match="p[1]">
<xsl:element name="p">
<xsl:attribute name="class" select="'shortInfo'"/>
Expand Down Expand Up @@ -74,7 +76,7 @@
<xsl:template match="li[ancestor::div[@id='toc']]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<span class="toggle-toc-item"><i class="fa fa-plus-square" aria-hidden="true" style="display:none;"></i><i class="fa fa-minus-square" aria-hidden="true"></i></span>
<span class="toggle-toc-item"><i class="fa fa-plus-square" aria-hidden="true" style="display:none;"/><i class="fa fa-minus-square" aria-hidden="true"/></span>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
Expand Down Expand Up @@ -114,4 +116,7 @@
<xsl:template match="div[@id='contentSub']"/>
<xsl:template match="div[@id='NavContent']"/>
<xsl:template match="div[matches(@class, 'haudio')]" priority="1"/>
<xsl:template match="a[following-sibling::div/@id='mw-content-text']"/>
<xsl:template match="table[@id='Vorlage_Begriffsklärungshinweis']"/>
<xsl:template match="div[@class='hatnote navigation-not-searchable']"/>
</xsl:stylesheet>

0 comments on commit 483c58a

Please sign in to comment.