Skip to content

Commit

Permalink
Refactoring and adding tons of new parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-jung committed Jan 8, 2024
1 parent 2c30913 commit 65de848
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 6 deletions.
3 changes: 1 addition & 2 deletions framework/css/edit/style-slide.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@
/* @data-auto-animate */
*[class~='slide/slide'][data-auto-animate]:before(298) {
content:
oxy_label(text, "data-auto-animate", width, 10em, color, inherit)
oxy_textfield(edit, '@data-auto-animate', columns, 40);
oxy_label(text, "data-auto-animate activated", width, 10em, color, inherit);
}

/* @data-auto-animate-easing */
Expand Down
159 changes: 159 additions & 0 deletions rng/slideMod.rng
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
<define name="slide-pre">
<ref name="slide-pre.element"/>
</define>
<define name="slide-image">
<ref name="slide-image.element"/>
</define>
<define name="slide-p">
<ref name="slide-p.element"/>
</define>
</div>

<div>
Expand Down Expand Up @@ -110,6 +116,8 @@
<ref name="p"/>
<ref name="pre"/>
<ref name="slide-div"/>
<ref name="slide-p"/>
<ref name="slide-image"/>
<ref name="slide-pre"/>
<ref name="simpletable"/>
<ref name="sl"/>
Expand Down Expand Up @@ -151,6 +159,20 @@
<data type="string"/>
</attribute>
</optional>
<optional>
<attribute name="data-auto-animate-unmatched">
<choice>
<value>true</value>
<value>false</value>
<value>fade</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="data-auto-animate-duration">
<data type="float"/>
</attribute>
</optional>
<optional>
<attribute name="data-autoslide">
<data type="integer"/>
Expand Down Expand Up @@ -421,6 +443,132 @@
<ref name="slide-codeblock.attributes"/>
</define>
</div>
<div>
<a:documentation>LONG NAME: Slide Image Data</a:documentation>
<define name="slide-image.content">
<optional>
<ref name="alt"/>
</optional>
<optional>
<ref name="longdescref"/>
</optional>
</define>
<define name="slide-image.attributes">
<optional>
<attribute name="href"/>
</optional>
<optional>
<attribute name="scope">
<choice>
<value>external</value>
<value>local</value>
<value>peer</value>
<value>-dita-use-conref-target</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="keyref"/>
</optional>
<optional>
<attribute name="alt"/>
</optional>
<optional>
<attribute name="longdescref"/>
</optional>
<optional>
<attribute name="height">
<data type="NMTOKEN"/>
</attribute>
</optional>
<optional>
<attribute name="width">
<data type="NMTOKEN"/>
</attribute>
</optional>
<optional>
<attribute name="align"/>
</optional>
<optional>
<attribute name="scale">
<data type="NMTOKEN"/>
</attribute>
</optional>
<optional>
<attribute name="scalefit">
<choice>
<value>yes</value>
<value>no</value>
<value>-dita-use-conref-target</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="style">
<data type="string"/>
</attribute>
</optional>
<optional>
<attribute name="placement" a:defaultValue="inline">
<choice>
<value>break</value>
<value>inline</value>
<value>-dita-use-conref-target</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="format" dita:since="1.3 errata 02"/>
</optional>
<ref name="univ-atts"/>
<optional>
<attribute name="outputclass"/>
</optional>
</define>
<define name="slide-image.element">
<element name="slide-image" dita:longName="Slide Image Data">
<a:documentation>Include artwork or images in a DITA topic by using the &lt;slide-image> element. The &lt;image> element has optional attributes that indicate whether the placement of the
included graphic or artwork should be inline (like a button or icon) or on a separate line for a larger image. There are also optional attributes that indicate the size to which the
included graphic or artwork should be scaled. An href attribute is required on the image element, as this attribute creates a pointer to the image, and allows the output formatting
processor to bring the image into the text flow. To make the intent of the image more accessible for users using screen readers or text-only readers, always include a description of the
image's content in the alt element. Category: Body elements</a:documentation>
<ref name="slide-image.attlist"/>
<ref name="slide-image.content"/>
</element>
</define>
<define name="slide-image.attlist" combine="interleave">
<ref name="slide-image.attributes"/>
</define>

</div>
<div>
<a:documentation>LONG NAME: Slide Paragraph</a:documentation>
<define name="slide-p.content">
<zeroOrMore>
<ref name="para.cnt"/>
</zeroOrMore>
</define>
<define name="slide-p.attributes">
<ref name="univ-atts"/>
<optional>
<attribute name="style"/>
</optional>
<optional>
<attribute name="outputclass"/>
</optional>
</define>
<define name="slide-p.element">
<element name="slide-p" dita:longName="Slide Paragraph">
<a:documentation>A paragraph element (&lt;slide-p>) is a block of text containing a single main idea. Category: Body elements</a:documentation>
<ref name="slide-p.attlist"/>
<ref name="slide-p.content"/>
</element>
</define>
<define name="slide-p.attlist" combine="interleave">
<ref name="slide-p.attributes"/>
</define>

</div>
</div>

<div>
Expand Down Expand Up @@ -460,6 +608,17 @@
<attribute name="class" a:defaultValue="+ topic/pre pr-d/codeblock slide/slide-codeblock "/>
</optional>
</define>
<define name="slide-image.attlist" combine="interleave">
<ref name="global-atts"/>
<optional>
<attribute name="class" a:defaultValue="- topic/image slide/slide-image "/>
</optional>
</define>
<define name="slide-p.attlist" combine="interleave">
<optional>
<attribute name="class" a:defaultValue="- topic/p slide/slide-p "/>
</optional>
</define>
</div>

</grammar>
Binary file added samples/auto-animate/assets/image1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions samples/auto-animate/auto-animate.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<topicref href="slide01.dita"/>
<topicref href="slide02.dita"/>
</map>
15 changes: 11 additions & 4 deletions samples/auto-animate/slide01.dita
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:jung:dita:rng:slide.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="urn:jung:dita:rng:slide.rng" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<slide id="ui_xtb_wmj_11c" data-auto-animate=" " data-background-size=" " data-autoslide=" 0"
data-transition="slide" data-background-repeat=" ">
<title>Title of slide</title>
<slideBody/>
<slide id="ui_xtb_wmj_11c" data-auto-animate="" data-auto-animate-unmatched="fade">
<title>Auto-Animate Example</title>
<slideBody>
<p>This will fade out</p>
<image href="assets/image1.png"/>
<slide-pre data-id="code"><slide-codeblock data-line-numbers="" outputclass="hljs" data-trim="">
function Example() {
const [count, setCount] = useState(0);
}
</slide-codeblock></slide-pre>
</slideBody>
</slide>
9 changes: 9 additions & 0 deletions samples/auto-animate/slide02.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:jung:dita:rng:slide.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="urn:jung:dita:rng:slide.rng" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<slide id="ui_igx_54q_11c" data-auto-animate="" data-auto-animate-unmatched="fade">
<title>Title of slide</title>
<slideBody>
<p></p>
</slideBody>
</slide>
2 changes: 2 additions & 0 deletions samples/sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<output href="./auto-animate"/>
<publication transtype="reveal">
<param name="reveal.theme" value="black"/>
<param name="reveal.hash" value="true"/>
<param name="reveal.center" value="true"/>
</publication>
</deliverable>

Expand Down
18 changes: 18 additions & 0 deletions xsl/reveal.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@
</xsl:if>-->
<xsl:copy-of select="
@data-auto-animate
| @data-auto-animate-duration
| @data-auto-animate-easing
| @data-auto-animate-unmatched
| @data-background
| @data-background-color
| @data-background-gradient
Expand Down Expand Up @@ -311,7 +313,9 @@
</xsl:if>-->
<xsl:copy-of select="
@data-auto-animate
| @data-auto-animate-duration
| @data-auto-animate-easing
| @data-auto-animate-unmatched
| @data-background
| @data-background-color
| @data-background-gradient
Expand Down Expand Up @@ -463,6 +467,20 @@
</pre>
</xsl:template>

<xsl:template match="*[contains(@class, ' slide/slide-image ')]">
<img>
<xsl:copy-of select="@style"/>
<xsl:apply-templates/>
</img>
</xsl:template>

<xsl:template match="*[contains(@class, ' slide/slide-p ')]">
<p>
<xsl:copy-of select="@style"/>
<xsl:apply-templates/>
</p>
</xsl:template>

<!--<xsl:template match="*[contains(@class,' pr-d/codeblock ')][contains(@outputclass, 'language-')]">
<pre>
<code>
Expand Down

0 comments on commit 65de848

Please sign in to comment.