Skip to content

Commit

Permalink
Course updates
Browse files Browse the repository at this point in the history
Edits, new conref push content for housekeeping.
  • Loading branch information
simonbate committed Dec 2, 2016
1 parent 5adeadc commit 327b6ff
Show file tree
Hide file tree
Showing 32 changed files with 133 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
</lcAnswerOption>
<lcAnswerOption>
<lcAnswerContent>The element to be pushed must have the attribute
<tt>conaction="pushbefore"</tt></lcAnswerContent>
<tt>conaction="pushbefore".</tt></lcAnswerContent>
<lcCorrectResponse/>
</lcAnswerOption>
<lcAnswerOption>
<lcAnswerContent>The element with <tt>conaction="pushbefore"</tt> must come before the element
with <tt>conaction="mark"</tt>
</lcAnswerContent>
with <tt>conaction="mark"</tt>. </lcAnswerContent>
<lcCorrectResponse/>
</lcAnswerOption>
<lcAnswerOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<learningAssessmentbody>
<lcInteraction id="lcInteraction_gxk_v14_vx">
<lcTrueFalse id="lcTrueFalse_rlv_w14_vx">
<lcQuestion>This is the correct way to use a key for a file path: <tt>&lt;topicref
<lcQuestion>This is a correct way to use a key for a file path: &#10;<tt>&lt;topicref
keyref="product_intro"/></tt>. (True or False?)</lcQuestion>
<lcAnswerOptionGroup id="lcAnswerOptionGroup_slv_w14_vx">
<lcAnswerOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Advanced conrefs</title>
<topicref href="../topics/lc_advanced_conrefs.dita">
<topicmeta lockmeta="yes">
<data name="lesson_id" value="10786"/>
<data name="lesson_id" value="10837"/>
</topicmeta>
<topicref href="../topics/lc_conref_basic_review.dita"/>
<topicref href="../topics/lc_conkeyrefs.dita"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Using conditions</title>
<topicref href="../topics/lc_using_conditions.dita">
<topicmeta lockmeta="yes">
<data name="lesson_id" value="10784"/>
<data name="lesson_id" value="10835"/>
</topicmeta>
<topicref href="../../shared/topics/lc_general_housekeeping.dita"/>
<topicref href="../topics/lc_review_basic_reuse.dita"/>
Expand Down
2 changes: 1 addition & 1 deletion en-us/course07-reuse_advanced/maps/m_using_keys.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Using keys</title>
<topicref href="../topics/lc_using_keys.dita">
<topicmeta lockmeta="yes">
<data name="lesson_id" value="10785"/>
<data name="lesson_id" value="10836"/>
</topicmeta>
<topicref href="../topics/lc_key.dita"/>
<topicref href="../topics/lc_using_keys_paths.dita"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- This file is part of the DITA Training project hosted on github.com. See the accompanying LICENSE file for applicable licenses.-->
<map>
<title>Keys for reusing elements advanced</title>
<keydef keys="sample_file" href="http://www.learningdita.com/wp-content/uploads/2016/11/reuse_advanced_samples.zip" format="zip" scope="external">
<keydef keys="sample_file" href="http://www.learningdita.com/wp-content/uploads/2016/12/reuse_advanced_samples.zip" format="zip" scope="external">
<topicmeta>
<linktext>reuse_advanced_samples.zip</linktext>
</topicmeta>
Expand Down
34 changes: 34 additions & 0 deletions en-us/course07-reuse_advanced/samples/c_conrefpush_sources.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="c_conrefp_source">
<title>Conref push sources</title>
<conbody>
<!--
This sample demonstrates all three forms of conref push.
Comment out the conref push elements that you're not using.
Or experiment.
You can use multiple conref push operations on the same target element.
-->

<!-- This p element does a conref push replace. -->
<!--
<p conref="c_conrefpush_target.dita#c_install/install_intro" conaction="pushreplace">
To install the Duck Data base on Windows, follow these instructions.
</p>
-->

<!-- These two p elements perform a conref push before. -->
<p conaction="pushbefore">
Make sure you have performed the pre-configuration steps. </p>
<p conref="c_conrefpush_target.dita#c_install/install_intro" conaction="mark"/>

<!-- These two p elements perform a conref push after. -->
<p conref="c_conrefpush_target.dita#c_install/install_intro" conaction="mark"/>
<!--
<p conaction="pushafter">
To install on Ubuntu, see the subsequent section.
</p>
-->

</conbody>
</concept>
Binary file not shown.
20 changes: 0 additions & 20 deletions en-us/course07-reuse_advanced/sources/c_conrefpush_sources.dita

This file was deleted.

7 changes: 2 additions & 5 deletions en-us/course07-reuse_advanced/topics/lc_advanced_keys.dita
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@
<p>If you reference this key in a cross-reference (&lt;xref> element), the link will
target init_ddb.dita and the text for the link will be “Initializing the Duck
Database”:<pre>&lt;xref keyref="initing_ddb"/></pre></p>
<p>In addition, you can use the key if you just need to refer to the linktext:</p>
<pre>For more information, see &lt;cite keyref="initing_ddb"/>. </pre>
<p>When this is processed, the &lt;linktext> content will be used in the &lt;cite>
element: </p>
<lq>For more information, see <i>Initializing the Duck Database</i>. </lq>
<!--The following works fine in Oxygen, but DOES NOT WORK in the OT. -->
<!--<p>In addition, you can use the key if you just need to refer to the linktext:</p><pre>For more information, see &lt;cite keyref="initing_ddb"/>. </pre><p>When this is processed, the &lt;linktext> content will be used in the &lt;cite> element: </p><lq>For more information, see <i>Initializing the Duck Database</i>. </lq>-->
<p><b>Key references with fall-backs</b></p>
<p>If you use both a keyref and an href attribute in an element, a DITA output generator
will attempt to resolve the keyref first. If the key is not defined, the href target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<p>There are two areas where you need to exercise some caution in filtering: inline
elements and elements that have required children.</p>
<p>It is not a good idea to filter inline elements. This is mostly a localization
concern. The previous course (<cite keyref="reuse_basic_url"/>) covered this to some
degree: what makes sense in one language when it is filtered out might not make good
concern. The previous course (<xref keyref="reuse_basic_url"/>) covered this to some
degree: what makes sense in one language when it is filtered out might not make
sense (or translate well) when it is presented in another language.</p>
<p>You need to be careful when filtering elements that have required children, otherwise
this might result in an invalid structure. If filtering removes required elements,
Expand Down
15 changes: 9 additions & 6 deletions en-us/course07-reuse_advanced/topics/lc_conditions_ditaval.dita
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
attributes with what values to filter out of your content. (Some output generators
do not use ditaval files; they use filtering mechanisms of their own design, but the
principles are still the same.)</p><p>The ditaval file is an XML file, but it is not
a DITA file (that is, it does not use the DITA doctypes or elements). In DITA 1.2,
a DITA file; that is, it does not use the DITA doctypes or elements. In DITA 1.2,
the ditaval file is not included in DITA maps; the file path to your ditaval file is
passed to output generators using a command argument. (In DITA 1.3, you can use the
&lt;ditavalref> element to include a ditaval file in a DITA map.) </p><p>The name of
passed to output generators using a command argument. In DITA 1.3, you can use the
&lt;ditavalref> element to include a ditaval file in a DITA map.</p><p>The name of
your ditaval file is up to you, although it’s a good idea to use a filename that
indicates the file’s purpose. Typically you store the ditaval file along with your
maps, although it can reside anywhere that is accessible to your output generator.
Expand All @@ -46,8 +46,11 @@
value is found. In this case, any element that contains
<tt>platform="iphone"</tt> is excluded from output (that is, it is hidden).
</li>
</ul><p><b>Conditional filtering example</b></p><p>In this example DITA topic, the
second &lt;p> element contains a sentence within a &lt;ph> (phrase) element. The
</ul><note>The DITA sources shown in the following examples are in the downloadable
samples file <xref keyref="sample_file"/>. The DITA file is
c_filtering_and_flagging.dita; the ditaval files is domestic.ditaval.
</note><p><b>Conditional filtering example</b></p><p>In this example DITA topic,
the second &lt;p> element contains a sentence within a &lt;ph> (phrase) element. The
product conditional attribute has the value
“wild_ducks":</p><pre id="feed_example">&lt;p>For the healthiest ducks, we recommend using our feeds.&lt;/p>
&lt;p>All our duck feeds are composed of cracked corn, oats, rice, and milo seed.
Expand All @@ -59,7 +62,7 @@
this:</p><image keyref="i_without_filtering" id="image_l15_qh4_cy" base="2016/11"
/><p>But if you use this ditaval file to filter out content where
product="wild_ducks":</p><pre>&lt;val>
&lt;prop action="exclude" att="product" val="wild_ducks" />
&lt;prop att="product" val="wild_ducks" action="exclude" />
&lt;/val></pre><p>The
output looks like this:</p><image keyref="i_with_filtering" id="image_ucd_c34_cy"
base="2016/12"/><p>For more information about ditaval files and how to use them for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
<dd>Content is specific to a custom aspect. </dd>
</dlentry>
</dl></p>
<p>The names of the attributes are defined in the DITA specification. They are a
suggestion about how you might use them, but you should not feel locked into using
them specifically for audience, platform, or product filtering; it’s up to you to
determine how you want to use each one. </p>
<p>For example, you might use the platform attribute to indicate whether content is
intended for iPhone or Android users: </p>
<pre>&lt;p platform="android">Visit Google Play for more information.&lt;/p>
Expand All @@ -55,6 +51,10 @@
elements where platform has the value “iphone” and hide elements where platform has
the value “android”. (How to hide and show content is described later in this
lesson.)</p>
<p>The names of the attributes are defined in the DITA specification. They are a
suggestion about how you might use them, but you should not feel locked into using
them specifically for audience, platform, or product filtering; it’s up to you to
determine how you want to use each one. </p>
<p>As with the attributes themselves, the values you use with each of the conditional
attributes are up to you to decide. You can use any characters you want for the
conditional attribute values, except for the space character. Case is important in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
<lcInstruction><p>In addition to filtering, you can use conditional attributes to flag (or
highlight) content that is intended for different readers or different products. You
can use any conditional attribute for flagging, and you can use the rev attribute to
indicate and flag a specific revision of your product or service. </p><p><b>Flagging
the conditional attributes</b></p><p>To use the conditional attributes for
flagging, you use the ditaval &lt;prop> element with the action="flag" attribute.
This allows you to flag text with color, background color, text styles, and images
(depending on what is supported in your transforms and the output generator). For
indicate and flag a specific revision of your product or service. </p><note>The DITA
sources shown in the following examples are in the downloadable samples file <xref
keyref="sample_file"/>. The DITA file is c_filtering_and_flagging.dita; the
ditaval files are wild.ditaval and show_rev.ditaval. </note><p><b>Flagging the
conditional attributes</b></p><p>To use the conditional attributes for flagging,
use the ditaval &lt;prop> element with the action="flag" attribute. This allows you
to flag text with color, background color, text styles, and images (depending on
what is supported in your transforms and the output generator). For
example:</p><pre>&lt;prop att="platform" val="android" action="flag" color="purple"/></pre><p>The
&lt;prop> element show here directs the output generator to use purple text on any
element in which the platform attribute contains the value “android”. </p><p>When
Expand Down
14 changes: 8 additions & 6 deletions en-us/course07-reuse_advanced/topics/lc_conkeyrefs.dita
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</prolog>
<learningContentbody>
<lcInstruction><p>A conkeyref is a content reference that uses a key instead of a file path.
As described in the <ph keyref="reuse_basic_url"/> course, a content reference to an
element in another file might look like this:
As described in the <xref keyref="reuse_basic_url"/> course, a content reference to
an element in another file might look like this:
</p><pre>&lt;ul conref="domestic_duck_warehouse.dita#domestic_warehouse/nesting_materials">
&lt;li/>
&lt;/ul></pre><p>This
Expand All @@ -42,10 +42,12 @@
example at the beginning of this topic shows a &lt;ul> element with a conref.
Replace the conref attribute with a conkeyref attribute that contains the key, a
slash ('/'), and the id of the element to be pulled:
</p><pre>&lt;ul conkeyref="duck_warehouse/nesting_materials"/></pre><note>When using
conkeyrefs you do not need to use the id of the topic that contains the referenced
element. </note><p>When the topic containing the conkeyref is processed, the key
duck_warehouse is replace with the current key definition, which is
</p><pre>&lt;ul conkeyref="duck_warehouse/nesting_materials">
&lt;li/>
&lt;/ul></pre><note>When
using conkeyrefs you do not need to use the id of the topic that contains the
referenced element. </note><p>When the topic containing the conkeyref is processed,
the key duck_warehouse is replace with the current key definition, which is
domestic_duck_warehouse.dita. </p><p>You can reuse the topic containing the
conkeyref in another DITA map, but you might need it to pull content from a file
that is specific to the new map. To do this, add a &lt;keydef> element to the new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</prolog>
<learningContentbody>
<lcInstruction>
<p>In the <cite keyref="reuse_basic_url"/> course you learned how to use the conref
<p>In the <xref keyref="reuse_basic_url"/> course you learned how to use the conref
attribute to reuse elements. The conref attribute allows you to pull content from
one element (possibly from a different topic) into another element. </p>
<p>To use a content reference: </p>
Expand Down
8 changes: 5 additions & 3 deletions en-us/course07-reuse_advanced/topics/lc_conrefend.dita
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
&lt;li conref="wh.dita#wh_elements/food_fish" conrefend="wh.dita#wh_elements/food_frogs"/>
...
&lt;/ul></pre><image
keyref="i_conrefend" id="image_ggs_r4d_dy"/><p>If you use conrefend, keep in mind
that:</p><ul id="ul_zvy_qnv_qx">
keyref="i_conrefend" id="image_ggs_r4d_dy" base="2016/12"/><p>If you use conrefend,
keep in mind that:</p><ul id="ul_zvy_qnv_qx">
<li>Both of the elements identified by the conref and conrefend attributes must be
the same element name as the referencing element. For instance, if the
referencing element is a &lt;p> element, the elements indicated by the conref
Expand All @@ -55,6 +55,8 @@
the content reference. </li>
</ul><p>You can also use conrefend with conkeyrefs. If conrefend is combined with a
conkeyref, the filename in the conrefend attribute is ignored and is replaced with
the filename used by the key specified in the conkeyref.</p></lcInstruction>
the filename used by the key specified in the conkeyref.</p><note>Not all CCMS
support the conrefend attribute. Test or check with your vendor before using this
attribute. </note></lcInstruction>
</learningContentbody>
</learningContent>
8 changes: 5 additions & 3 deletions en-us/course07-reuse_advanced/topics/lc_conrefpush.dita
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
element before, after, or in place of) has an id attribute. </p>
<p>For example, to push an element before, after, or in place of this
element, it must have an id: </p>
<pre>&lt;p id="install_intro">This chapter describes how to install and configure the Duck Database on
Windows and Macintosh.&lt;/p></pre>
<pre>&lt;p id="install_intro">This chapter describes how to install and configure the Duck Database on Windows and Macintosh.&lt;/p></pre>
</li>
<li>
<p>Create a DITA topic containing the element to be pushed.</p>
Expand Down Expand Up @@ -73,7 +72,10 @@
&lt;/concept>
</pre><p>Output
from this topic, without any conref push looks like this:</p><image
keyref="i_no_push" id="image_px1_dbv_cy" base="2016/11"/><p><b>Replacing the target
keyref="i_no_push" id="image_px1_dbv_cy" base="2016/11"/><note>The DITA sources
shown in these examples are in the downloadable samples file <xref
keyref="sample_file"/>. The target DITA file is c_conrefpush_target.dita; the
source DITA file is c_conrefpush_target.dita. </note><p><b>Replacing the target
element</b></p><p>To replace an element in the target topic, use the element’s
conref attribute to identify the element to replace, and set the conaction attribute
to
Expand Down
Loading

0 comments on commit 327b6ff

Please sign in to comment.