1
<?xml version="1.0" encoding="utf-8"?>
2
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="mal_block_listing">
5
<link type="seealso" xref="mal_block_code"/>
6
<link type="seealso" xref="mal_block_figure"/>
8
<revision version="0.1" date="2009-05-19" status="review"/>
10
<credit type="author">
11
<name>Shaun McCance</name>
12
<email>shaunm@gnome.org</email>
13
<years>2008-2009</years>
16
<include xmlns="http://www.w3.org/2001/XInclude" href="legal.xml"/>
18
<desc>Provide a name and description for a code block or other content.</desc>
21
<title>Listings</title>
23
<synopsis><code mime="application/relax-ng-compact-syntax">
24
mal_block_listing = element listing {
25
attribute style { xsd:NMTOKENS } ?,
26
attribute * - (mal:* | local:*) { text } *,
28
<link xref="mal_block_title">mal_block_title</link> ?,
29
<link xref="mal_block_desc">mal_block_desc</link> ?,
30
<link xref="mal_block">mal_block</link> +
34
<p>Use the <code>listing</code> element to create named listing of file contents
35
or other content. Listings are usually used with <link xref="mal_block_code">code
36
blocks</link> to provide a name for the file to enter the content into. They may
37
also be used to provide a name for an <link xref="mal_block_screen">interactive
38
shell session</link> or any other type of content. To provide a title for images
39
or other multimedia objects, use the <link xref="mal_block_figure">figure</link>
46
<item><p>The <code>listing</code> element contains an optional
47
<link xref="mal_block_title">title</link> element, an optional
48
<link xref="mal_block_desc">desc</link> element, and any
49
<link xref="mal_block">general block content</link>.</p></item>
51
<item><p>The <code>listing</code> element can occur in any
52
general block context, including inside
53
<link xref="mal_page">pages</link>, <link xref="mal_section">sections</link>,
54
and certain <link xref="mal_block">block elements</link>.</p></item>
56
<item><p>The <code>style</code> attribute takes a space-separated list of
57
style hints. Processing tools should adjust their behavior according to
58
those style hints they understand.</p></item>
60
<item><p>The <code>listing</code> element can have attributes from external
61
namespaces. See <link xref="mal_external"/> for more information
62
on external-namespace attributes.</p></item>
68
<!-- BEGIN examples -->
69
<section id="examples">
70
<title>Ejemplos</title>
72
<p>Use <code>listing</code> to provide a file name and description for a
78
<title><file>index.page</file></title>
79
<desc>A first Mallard page</desc>
81
<page xmlns="http://projectmallard.org/1.0/"
84
<!-- Content goes here -->
85
</page>]]]>]><![CDATA[</code>
88
<title><file>index.page</file></title>
89
<desc>A first Mallard page</desc>
91
<page xmlns="http://projectmallard.org/1.0/"
94
<!-- Content goes here -->
102
<!-- BEGIN processing -->
103
<section id="processing">
104
<title>Processing Expectations</title>
106
<p>Listings are displayed as block elements, with each of their child elements
107
being interpreted as block elements. When present, the title and description
108
should be displayed in a way that makes their respective roles clear.</p>
110
<!-- END processing -->
113
<!-- BEGIN comparison -->
115
No direct analog in DocBook. I'm sure people accomplish the same thing somehow,
116
but my brain isn't working right now. Also check DITA.
117
<section id="comparison">
118
<title>Comparison to Other Formats</title>
121
<!-- END comparison -->