Skip to content

Commit

Permalink
Merge pull request #516 from openSUSE/docteam-746-trd-xslt
Browse files Browse the repository at this point in the history
Create TRD stylesheets structure
  • Loading branch information
tomschr authored Dec 9, 2022
2 parents ee79206 + 06a873a commit 7eb306f
Show file tree
Hide file tree
Showing 23 changed files with 605 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ DIR2013_SUSE := suse2013
DIR2021_SUSE := suse2021-ns
DIR2022_SUSE := suse2022-ns
DIRSBP := sbp
DIRTRD := trd

#--------------------------------------------------------------
# Directories and files that will be created
Expand Down Expand Up @@ -77,6 +78,7 @@ SUSESTYLEDIR2013-NS := $(INST_STYLE_ROOT)/$(DIR2013_SUSE)-ns
SUSESTYLEDIR2021-NS := $(INST_STYLE_ROOT)/$(DIR2021_SUSE)
SUSESTYLEDIR2022-NS := $(INST_STYLE_ROOT)/$(DIR2022_SUSE)
SBPDIR := $(INST_STYLE_ROOT)/$(DIRSBP)
TRDDIR := $(INST_STYLE_ROOT)/$(DIRTRD)

DOCDIR := $(DESTDIR)$(PREFIX)/doc/packages/suse-xsl-stylesheets
TTF_FONT_DIR := $(DESTDIR)$(PREFIX)/fonts/truetype
Expand All @@ -86,7 +88,7 @@ INST_STYLEDIRS := $(STYLEDIR2005) $(STYLEDIR2005-NS) \
$(DAPSSTYLEDIR2013) $(DAPSSTYLEDIR2013-NS) \
$(OPENSUSESTYLEDIR2013) $(OPENSUSESTYLEDIR2013-NS) \
$(SUSESTYLEDIR2013) $(SUSESTYLEDIR2013-NS) \
$(SUSESTYLEDIR2021-NS) $(SUSESTYLEDIR2022-NS) $(SBPDIR)
$(SUSESTYLEDIR2021-NS) $(SUSESTYLEDIR2022-NS) $(SBPDIR) $(TRDDIR)

INST_DIRECTORIES := $(INST_STYLEDIRS) $(DOCDIR) \
$(TTF_FONT_DIR) $(CATALOG_DIR)
Expand Down Expand Up @@ -122,6 +124,7 @@ install: | $(INST_DIRECTORIES)
tar c --mode=u+w,go+r-w,a-s -C $(DIR2021_SUSE) . | (cd $(SUSESTYLEDIR2021-NS); tar xp)
tar c --mode=u+w,go+r-w,a-s -C $(DIR2022_SUSE) . | (cd $(SUSESTYLEDIR2022-NS); tar xp)
tar c --mode=u+w,go+r-w,a-s -C $(DIRSBP) . | (cd $(SBPDIR); tar xp)
tar c --mode=u+w,go+r-w,a-s -C $(DIRTRD) . | (cd $(TRDDIR); tar xp)
for SDIR in $(INST_STYLEDIRS); do \
sed "s/@@#version@@/$(VERSION)/" $$SDIR/VERSION.xsl > $$SDIR/VERSION.xsl.0; \
mv $$SDIR/VERSION.xsl.0 $$SDIR/VERSION.xsl; \
Expand Down
3 changes: 1 addition & 2 deletions sbp/fo/article.titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@

<!-- Tools -->
<fo:block>
<fo:external-graphic content-width="100%"
src="{$styleroot}/images/sbp-tools-title.svg" />
<fo:external-graphic content-width="100%" src="{$titlepage.logo.image}" />
</fo:block>

<!-- Platform specific -->
Expand Down
3 changes: 2 additions & 1 deletion sbp/fo/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
<xsl:import href="../../suse2022-ns/fo/docbook.xsl"/>

<xsl:include href="../VERSION.xsl"/>
<xsl:include href="article.titlepage.templates.xsl"/>
<xsl:include href="param.xsl"/>
<xsl:include href="../../suse2022-ns/fo/article.titlepage.templates.xsl"/>
</xsl:stylesheet>
20 changes: 20 additions & 0 deletions sbp/fo/param.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Purpose:
Contains all parameters for SBP
See Also:
* http://docbook.sourceforge.net/release/xsl-ns/current/doc/fo/index.html
Copyright: 2022 Thomas Schraitle
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="d">


<xsl:param name="titlepage.logo.image"><xsl:value-of select="$styleroot"/>images/sbp-tools-title.svg</xsl:param>
</xsl:stylesheet>
20 changes: 18 additions & 2 deletions sbp/xhtml/titlepage.templates.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
</div>
</xsl:template>

<xsl:template match="d:info/d:abstract" mode="article.titlepage.recto.auto.mode">
<xsl:message>d:info/d:abstract</xsl:message>
<div class="abstract">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode"/>
</div>
</xsl:template>
<xsl:template match="d:info/d:abstract/d:title" mode="article.titlepage.recto.auto.mode">
<xsl:message>d:info/d:abstract/d:title</xsl:message>
<div class="title">
<xsl:apply-templates/>
</div>
</xsl:template>


<xsl:template match="d:author[d:personname]|d:editor[d:personname]|d:othercredit[d:personname]" mode="authorgroup">
<xsl:param name="withlabel" select="1"/>
<!--<xsl:message>d:<xsl:value-of select="local-name(.)"/>[d:personname]</xsl:message> -->
Expand Down Expand Up @@ -183,7 +197,7 @@
</xsl:template>


<xsl:template match="d:meta[@name='category']" mode="article.titlepage.recto.auto.mode">
<xsl:template match="d:meta[@name='category' or @name='type']" mode="article.titlepage.recto.auto.mode">
<xsl:apply-templates select="."/>
</xsl:template>

Expand All @@ -200,6 +214,7 @@

<!-- XHTML titlepage -->
<xsl:template name="article.titlepage.recto">
<!-- TITLE -->
<xsl:choose>
<xsl:when test="d:articleinfo/d:title">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:articleinfo/d:title"/>
Expand All @@ -218,6 +233,7 @@
</xsl:otherwise>
</xsl:choose>

<!-- SUBTITLE -->
<xsl:choose>
<xsl:when test="d:articleinfo/d:subtitle">
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:articleinfo/d:subtitle"/>
Expand All @@ -236,7 +252,7 @@
<div class="series-category">
<xsl:comment/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:meta[@name='series']"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:meta[@name='category']"/>
<xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="d:info/d:meta[@name='category' or @name='type']"/>
</div>

<!-- Moved authors and authorgroups here: -->
Expand Down
4 changes: 4 additions & 0 deletions source-assets/styles2022/sass/custom/content-inline.sass
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ p
margin: 10px 0 0
text-align: left

.abstract
.title
font-weight: bold
font-size: 12pt

.abstract,
.highlights
Expand Down
4 changes: 4 additions & 0 deletions suse2022-ns/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2644,6 +2644,10 @@ p {
margin: 10px 0 0;
text-align: left; }

.abstract .title {
font-weight: bold;
font-size: 12pt; }

.abstract,
.highlights {
font-size: 18px;
Expand Down
9 changes: 9 additions & 0 deletions trd/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="STYLE.NAME" select="'SUSE XSL Stylesheets'"/>
<xsl:param name="STYLE.ID" select="'trd'"/>
<xsl:param name="STYLE.VERSION" select="'@@#version@@'"/>

</xsl:stylesheet>
1 change: 1 addition & 0 deletions trd/VERSION.xsl
Loading

0 comments on commit 7eb306f

Please sign in to comment.