Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support task Element #406

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions suse2013/common/l10n/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<l:gentext key="GlossSeeAlso" text="See also"/>
<l:gentext key="glossseealso" text="See also"/>

<l:gentext key="tasksummary" text="Summary"/>
<l:gentext key="taskprerequisites" text="Requirements"/>
<l:gentext key="taskrelated" text="Related"/>

<!-- In most cases, this has to be empty -->
<l:dingbat key="guimenustartquote" text=""/>
Expand Down Expand Up @@ -73,6 +76,8 @@
<l:template name="procedure-title" text="%t"/>
<l:template name="table-label" text="Table&#160;%n:"/>
<l:template name="table-title" text="%t"/>
<l:template name="task-label" text="Task&#160;%n:"/>
<l:template name="task-title" text="%t"/>
<l:template name="variablelist-label" text=""/>
<l:template name="variablelist-title" text="%t"/>
<l:template name="itemizedlist-label" text=""/>
Expand Down Expand Up @@ -102,6 +107,7 @@
<l:template name="intra-preface" text="Preface “%t”"/>
<l:template name="intra-figure" text="Figure&#160;%n “%t”"/>
<l:template name="intra-table" text="Table&#160;%n “%t”"/>
<l:template name="intra-task" text="Task&#160;%n “%t”"/>
<l:template name="intra-example" text="Example&#160;%n “%t”"/>
<l:template name="intra-procedure" text="Procedure&#160;%n “%t”"/>

Expand Down Expand Up @@ -134,6 +140,7 @@
<l:template name="section" style="nonumber" text="Section “%t”"/>
<l:template name="simplesect" style="nonumber" text="the section called “%t”"/>
<l:template name="table" style="nonumber" text="Table “%t”"/>
<l:template name="task" style="nonumber" text="Task “%t”"/>
</l:context>

<l:context name="xep-bookmark-title">
Expand Down
33 changes: 32 additions & 1 deletion suse2013/common/labels.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,36 @@

<xsl:template match="refsect1/title|refnamediv" mode="label.markup"/>


<xsl:template match="task" mode="label.markup">
<xsl:variable name="pchap"
select="ancestor::chapter
|ancestor::appendix
|ancestor::article[ancestor::book]"/>
<xsl:variable name="prefix">
<xsl:if test="count($pchap) &gt; 0">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="count($pchap)>0">
<xsl:if test="$prefix != ''">
<xsl:apply-templates select="$pchap" mode="label.markup"/>
<xsl:apply-templates select="$pchap" mode="intralabel.punctuation">
<xsl:with-param name="object" select="."/>
</xsl:apply-templates>
</xsl:if>
<xsl:number count="task[title|blockinfo/title|info/title]" format="1"
from="chapter|appendix" level="any"/>
</xsl:when>
<xsl:otherwise>
<xsl:number count="task[title|blockinfo/title|info/title]" format="1"
from="book|article" level="any"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
29 changes: 29 additions & 0 deletions suse2013/fo/attributesets.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,35 @@ are overridden somewhere. Probably because of the original stylesheets. -->
<xsl:attribute name="text-align">start</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="task.properties">
<!--<xsl:attribute name="space-before">1em</xsl:attribute>
<xsl:attribute name="space-after">1em</xsl:attribute>-->
</xsl:attribute-set>

<xsl:attribute-set name="task.title.spacing">
<!-- <xsl:attribute name="space-before.optimum"><xsl:value-of select="&gutterfragment; div 4"/>mm</xsl:attribute>
<xsl:attribute name="space-before.minimum"><xsl:value-of select="&gutterfragment; div 5"/>mm</xsl:attribute>
<xsl:attribute name="space-before.maximum"><xsl:value-of select="&gutterfragment; div 2"/>mm</xsl:attribute>-->
</xsl:attribute-set>

<xsl:attribute-set name="tasksummary.properties"/>


<xsl:attribute-set name="task.children.title.properties"
use-attribute-sets="dark-green sans.bold.noreplacement task.children.title.spacing">
<xsl:attribute name="font-family"><xsl:value-of select="$sans.font.family"/></xsl:attribute>
<xsl:attribute name="font-size"><xsl:value-of select="&small; * $sans-fontsize-adjust"/>pt</xsl:attribute>
<xsl:attribute name="text-transform">uppercase</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="text-align">start</xsl:attribute>
</xsl:attribute-set>

<xsl:attribute-set name="task.children.title.spacing">
<xsl:attribute name="space-before.minimum">1.2em</xsl:attribute>
<xsl:attribute name="space-before.optimum">1.5em</xsl:attribute>
<xsl:attribute name="space-before.maximum">2em</xsl:attribute>
</xsl:attribute-set>

<!-- 22. Profiling ============================================== -->


Expand Down
1 change: 1 addition & 0 deletions suse2013/fo/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<xsl:include href="admon.xsl"/>
<xsl:include href="component.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="task.xsl"/>
<xsl:include href="qandaset.xsl"/>
<xsl:include href="hyphenate-url.xsl"/>
<xsl:include href="titlepage.xsl"/>
Expand Down
4 changes: 2 additions & 2 deletions suse2013/fo/formal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@
</xsl:template>

<xsl:template
match="procedure|example|table|figure|glosslist|variablelist|itemizedlist|orderedlist"
match="procedure|example|table|task|figure|glosslist|variablelist|itemizedlist|orderedlist"
mode="object.label.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'styles'"/>
<xsl:with-param name="name" select="concat( local-name(),'-label')"/>
</xsl:call-template>
</xsl:template>

<xsl:template match="procedure|example|table|figure|glosslist|variablelist|itemizedlist|orderedlist"
<xsl:template match="procedure|example|table|task|figure|glosslist|variablelist|itemizedlist|orderedlist"
mode="object.title.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'styles'"/>
Expand Down
2 changes: 1 addition & 1 deletion suse2013/fo/lists.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</xsl:if>

<fo:block>
<xsl:if test="not(ancestor::procedure)">
<xsl:if test="not(ancestor::procedure or ancestor::task)">
<xsl:attribute name="border-{$start-border}">
<xsl:text>&mediumline;mm solid </xsl:text>
<xsl:choose>
Expand Down
81 changes: 81 additions & 0 deletions suse2013/fo/task.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Purpose:
Transform DocBook's task element and its children

Author: Thomas Schraitle <[email protected]>,
Stefan Knorr <[email protected]>
Copyright: 2017

-->

<!DOCTYPE xsl:stylesheet
[
<!ENTITY % fonts SYSTEM "fonts.ent">
<!ENTITY % colors SYSTEM "colors.ent">
<!ENTITY % metrics SYSTEM "metrics.ent">
%fonts;
%colors;
%metrics;
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="task">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:variable name="preamble"
select="*[not(self::title or self::titleabbrev)]"/>

<fo:block id="{$id}" xsl:use-attribute-sets="task.properties">
<xsl:if test="(title or info/title)">
<fo:block xsl:use-attribute-sets="task.title.spacing" keep-with-next.within-column="always">
<xsl:call-template name="formal.object.heading"/>
</fo:block>
</xsl:if>
<fo:block>
<xsl:attribute name="margin-{$start-border}"><xsl:value-of select="&mediumline;"/>mm</xsl:attribute>
<xsl:attribute name="padding-{$start-border}"><xsl:value-of select="2* &mediumline;"/>mm</xsl:attribute>
<xsl:attribute name="border-{$start-border}">
<xsl:text>&mediumline;mm solid </xsl:text>
<xsl:choose>
<xsl:when test="$format.print != 0">
<xsl:text>&dark-gray;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&dark-green;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="$preamble"/>
</fo:block>
</fo:block>
</xsl:template>

<xsl:template match="tasksummary">
<fo:block xsl:use-attribute-sets="tasksummary.properties">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="taskprerequisites|taskrelated">
<fo:block>
<fo:block xsl:use-attribute-sets="task.children.title.properties" keep-with-next.within-column="always">
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="local-name(.)"/>
</xsl:call-template>
</fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>


<!-- <xsl:template match="tasksummary/para[1]|taskprerequisites/para[1]|taskrelated/para[1]">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template>-->

</xsl:stylesheet>
39 changes: 31 additions & 8 deletions suse2013/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1742,13 +1742,13 @@ p, .simplelist td {
}

.title .xref, .subtitle .xref, .table-title .xref, .example-title .xref,
.figure-title .xref, .procedure-title .xref, .orderedlist-title .xref,
.figure-title .xref, .procedure-title .xref, .task-title .xref, .orderedlist-title .xref,
.itemizedlist-title .xref, .variablelist-title .xref, .qandadiv-title .xref,
.title .link, .subtitle .link, .table-title .link, .example-title .link,
.figure-title .link, .procedure-title .link, .orderedlist-title .link,
.figure-title .link, .procedure-title .link, .task-title .link, .orderedlist-title .link,
.itemizedlist-title .link, .variablelist-title .link, .qandadiv-title .link,
.title .ulink, .subtitle .ulink, .table-title .ulink, .example-title .ulink,
.figure-title .ulink, .procedure-title .ulink, .orderedlist-title .ulink,
.figure-title .ulink, .procedure-title .ulink, .task-title .ulink, .orderedlist-title .ulink,
.itemizedlist-title .ulink, .variablelist-title .ulink, .qandadiv-title .ulink {
text-decoration: underline;
}
Expand Down Expand Up @@ -1783,6 +1783,7 @@ p, .simplelist td {
.figure-title .xref:hover, .figure-title .xref:focus, .figure-title .xref:active,
.example-title .xref:hover, .example-title .xref:focus, .example-title .xref:active,
.procedure-title .xref:hover, .procedure-title .xref:focus, .procedure-title .xref:active,
.task-title .xref:hover, .task-title .xref:focus, .task-title .xref:active,
.orderedlist-title .xref:hover, .orderedlist-title .xref:focus, .orderedlist-title .xref:active,
.itemizedlist-title .xref:hover, .itemizedlist-title .xref:focus, .itemizedlist-title .xref:active,
.variablelist-title .xref:hover, .variablelist-title .xref:focus, .variablelist-title .xref:active,
Expand Down Expand Up @@ -2019,6 +2020,7 @@ catch those. */

.list-of-figures dl, .list-of-tables dl,
.list-of-examples dl, .list-of-procedures dl,
.list-of-tasks dl,
.list-of-equations dl {
margin: 5px 0 17px 0;
padding: 0 0 0 30px;
Expand Down Expand Up @@ -2125,7 +2127,7 @@ a:hover .package, a:focus .package, a:active .package {
color: #666;
}

.procedure-title, .table-title, .example-title,
.procedure-title, .table-title, .example-title, .task-title,
.figure-title, .orderedlist-title, .variablelist-title,
.itemizedlist-title, .qandadiv-title {
font-size: 14px;
Expand Down Expand Up @@ -2194,7 +2196,7 @@ a:hover .package, a:focus .package, a:active .package {
text-transform: none;
}

.procedure-contents {
.procedure-contents, .task-contents {
border-left: 3px solid #9CC897;
font-weight: normal;
margin: 17px 0 17px;
Expand All @@ -2205,11 +2207,29 @@ a:hover .package, a:focus .package, a:active .package {
display: block;
}

.procedure-title-wrap + .procedure-contents {
.task-title-wrap {
margin-top: 1.5em;
}

.taskprerequisites {
margin-top: 1.2em;
}

.tasksummary {
margin-top: -0.5em;
}

.task-contents .procedure-contents {
border-left: none;
}

.procedure-title-wrap + .procedure-contents,
.task-title-wrap + .task-contents {
margin: 10px 0 24px;
}

.procedure-contents > p:first-child,
.task-contents > p:first-child,
.procedure-contents > ol:first-child > li:first-child > p:first-child {
margin-top: 0;
}
Expand All @@ -2218,8 +2238,10 @@ a:hover .package, a:focus .package, a:active .package {
margin-top: 4px;
}

.procedure-contents > p, .procedure-contents > .informalfigure,
.procedure-contents > .admonition {
.procedure-contents > p,
.procedure-contents > .informalfigure,
.procedure-contents > .admonition,
.task-contents > * {
margin-left: 12px;
margin-right: 17px;
}
Expand Down Expand Up @@ -3107,6 +3129,7 @@ p.ds-message {
.sect4 > .verbatim-wrap, .sect5 > .verbatim-wrap, .sect6 > .verbatim-wrap,
.sect > .verbatim-wrap, .chapter > .verbatim-wrap, .article > .verbatim-wrap,
.procedure-contents, .procedure-title-wrap + .procedure-contents,
.task-contents, .task-title-wrap + .task-contents,
div.figure, .complex-example .example-contents {
margin-left: -10px;
margin-right: -10px;
Expand Down
1 change: 1 addition & 0 deletions suse2013/xhtml/docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<xsl:include href="admon.xsl"/>
<xsl:include href="graphics.xsl"/>
<xsl:include href="block.xsl"/>
<xsl:include href="task.xsl"/>
<xsl:include href="qandaset.xsl"/>
<xsl:include href="titlepage.xsl"/>
<xsl:include href="titlepage.templates.xsl"/>
Expand Down
4 changes: 2 additions & 2 deletions suse2013/xhtml/formal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@


<xsl:template
match="procedure|example|table|figure|glosslist|variablelist|itemizedlist|orderedlist"
match="procedure|example|table|task|figure|glosslist|variablelist|itemizedlist|orderedlist"
mode="object.label.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'styles'"/>
<xsl:with-param name="name" select="concat( local-name(),'-label')"/>
</xsl:call-template>
</xsl:template>

<xsl:template match="procedure|example|table|figure|glosslist|variablelist|itemizedlist|orderedlist"
<xsl:template match="procedure|example|table|task|figure|glosslist|variablelist|itemizedlist|orderedlist"
mode="object.title.template">
<xsl:call-template name="gentext.template">
<xsl:with-param name="context" select="'styles'"/>
Expand Down
Loading