Based on: The Basic CNXML by Ricardo Radaelli-Sanchez, Brent Hendricks
Summary: This document introduces simple CNXML tags that are easy to use in Edit-in-Place.
To create the bare bones of content in Connexions, the author interface provides a variety of creation tools: the Document Importer, Edit-In-Place, and even a full-source editor. However, a basic knowledge of our markup language can help make small edits into tremendous enhancements to your material!
Connexions uses the Connexions Markup Language (CNXML) as its primary language for marking up and storing documents. CNXML is lightweight XML for marking up educational content. Unlike the well-known HTML, the goal of CNXML is to convey the content of the material and not a particular presentation. For example, say you have the following sentence: I like cupcakes very much. However, you feel that you enthusiasm for cupcakes has not been fully expressed. In HTML, you would use bold, underline, italic, etc.; in CNXML, you would use the emphasis tag.
Inline tags, such as emphasis, are used to embed content and functionality inside the structural tags, such as paragraphs. Some of the more commonly used tags are discussed below.
As mentioned previously, the emphasis tag is used to
accent certain text. Note that this refers to semantic
emphasis and not a typeface. Different stylesheets
can render emphasis with different typefaces.
<para id='intro'>
Gardenias are my absolute <emphasis>favorite</emphasis>
flower. Their petals are soft, and their bloom has an
absolutely <emphasis>heavenly</emphasis> scent.
</para>
The above markup will display as:
Gardenias are my absolute favorite flower. Their petals are soft, and their bloom has an absolutely heavenly scent.
The term tag is used to mark
words or phrases which are being defined. However, its
use is confined to either a para or definition tag. The term tag has one optional
attribute: URL - a URL
specifying the source or definition of the
term.
<para id='gardenia'>
<term url="http://en.wikipedia.org/wiki/Gardenia">Gardenias
</term> can be tricky to maintain. The soil around the
roots of a <term>gardenia</term> must remain moist always,
but too much water can damage the plant. Also,
<term>gardenias</term> enjoy the sun, but if the
<emphasis>foliage</emphasis> gets wet to bring the gardenia
into the shade.
</para> The above markup will display as:
Gardenias can be tricky to maintain. The soil around the roots of a gardenia must remain moist always, but too much water can damage the plant. Also, gardenias enjoy the sun, but if the foliage gets wet to bring the gardenia into the shade.
The note tag creates an "out
of line" note to the reader. The type of note is specified
by an optional type attribute. If a type is not specified, the default is Note. The type attribute can contain any of the following values:
<para id='pollen'>
Receiving flowers is, on the whole, a wonderful thing.
However, sometimes pollen from the flowers can cause
problems. In particular, the clean up of a bit of
pollen can be tricky. <note type="Important">Do not
use water when cleaning up pollen! This can lead to
counter-top and clothing stains!</note> Your best bet
is to use a dry method of cleaning with a paper-towel.
</para> The above markup will display as:
Receiving flowers is, on the whole, a wonderful thing. However, sometimes pollen from the flowers can cause problems. In particular, the clean up of a bit of pollen can be tricky.
The link tag is the tag in CNXML
used for linking to other Connexions modules or collections as well as external links.
The target and document attributes can be used
together or alone. If both are used then you will link
to a particular tag in another document. If only document is used, you will link to
another document. If only target is used, you will link to a
particular tag within the current document.
The cite tag is used to refer
to non-electronic materials within a document, and primarily
contains the title, the author, and/or a page number of a work.
Finally, a good resource is the <cite>Garden Lover's
Cookbook -- William M. Rice; Paperback</cite>.
The above markup will display as:
Finally, a good resource is the Garden Lover's Cookbook -- William M. Rice; Paperback.
The quote tag is used to
denote that some text directly quotes another
source. The quote tag has a display attribute which denotes
whether the quote is inline
or block.
<para id='plantquote'>
Every plant needs a different amount of water in order to
grow well. <quote display="inline">"If you water each plant the same, you
will always water too much and too little."</quote> Also,
remember the words of Lou Erickson:
<quote id="quote_example" display='block'>"Gardening requires lots of water -
most of it in the form of perspiration."</quote>
</para>"Gardening requires lots of water - most of it in the form of perspiration."
The foreign tag is used to
denote that a word or phrase foreign to the language of the document is being used.
<para id='plantquote2'>
All flowers have a scientific name, often derived from
Latin. <foreign>Gardenia augusta</foreign> is the name
of a type of gardenia found in Japan.
</para>The code tag is used to insert example computer
output/input as either inline text within a paragraph or as a
block of text. The code tag has a display
attribute with two possible values:
inline (default) - used to specify code that
is inline. block - used to specify code that should be
in a separate block of text.For now, take a look at what the inline code looks like:
<para id='copy'>
In a unix terminal the command to copy a file is
<code display='inline'>cp original copy</code>.
</para>
In a unix terminal the command to copy a file is cp original copy
You will see more about code blocks in Advanced CNXML using Edit-In-Place.
"If you are ready to start creating new materials in Connexions, or adapting and reusing existing materials, this guide and tutorial will help you get started. Questions are always welcome to […]"