Changed representation of code blocks to use <screen> and

escaped characters rather than <programlisting> and CDATA.
Reason:  XML source more easily editable and readable.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@393 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2007-01-01 22:07:19 +00:00
parent ae869a092a
commit 2716943855
2 changed files with 26 additions and 12 deletions

View file

@ -158,7 +158,7 @@ blockToDocbook options (Para lst) =
blockToDocbook options (BlockQuote blocks) = blockToDocbook options (BlockQuote blocks) =
indentedInTags options "blockquote" (blocksToDocbook options blocks) indentedInTags options "blockquote" (blocksToDocbook options blocks)
blockToDocbook options (CodeBlock str) = blockToDocbook options (CodeBlock str) =
text "<programlisting>" <> (cdata str) <> text "</programlisting>" text "<screen>\n" <> text (codeStringToXML str) <> text "\n</screen>"
blockToDocbook options (BulletList lst) = blockToDocbook options (BulletList lst) =
indentedInTags options "itemizedlist" $ listItemsToDocbook options lst indentedInTags options "itemizedlist" $ listItemsToDocbook options lst
blockToDocbook options (OrderedList lst) = blockToDocbook options (OrderedList lst) =

View file

@ -87,9 +87,11 @@
<para> <para>
Code in a block quote: Code in a block quote:
</para> </para>
<programlisting><![CDATA[sub status { <screen>
sub status {
print "working"; print "working";
}]]></programlisting> }
</screen>
<para> <para>
A list: A list:
</para> </para>
@ -129,9 +131,11 @@
<para> <para>
Example: Example:
</para> </para>
<programlisting><![CDATA[sub status { <screen>
sub status {
print "working"; print "working";
}]]></programlisting> }
</screen>
</blockquote> </blockquote>
<blockquote> <blockquote>
<orderedlist> <orderedlist>
@ -169,19 +173,23 @@
<para> <para>
Code: Code:
</para> </para>
<programlisting><![CDATA[---- (should be four hyphens) <screen>
---- (should be four hyphens)
sub status { sub status {
print "working"; print "working";
} }
this code block is indented by one tab]]></programlisting> this code block is indented by one tab
</screen>
<para> <para>
And: And:
</para> </para>
<programlisting><![CDATA[ this code block is indented by two tabs <screen>
this code block is indented by two tabs
These should not be escaped: \$ \\ \> \[ \{]]></programlisting> These should not be escaped: \$ \\ \> \[ \{
</screen>
</section> </section>
<section> <section>
<title>Lists</title> <title>Lists</title>
@ -839,7 +847,9 @@ Cat &amp; 1 \\ \hline
<para> <para>
This should [not][] be a link. This should [not][] be a link.
</para> </para>
<programlisting><![CDATA[[not]: /url]]></programlisting> <screen>
[not]: /url
</screen>
<para> <para>
Foo <ulink url="/url/">bar</ulink>. Foo <ulink url="/url/">bar</ulink>.
</para> </para>
@ -901,7 +911,9 @@ Cat &amp; 1 \\ \hline
Auto-links should not occur here: Auto-links should not occur here:
<literal>&lt;http://example.com/></literal> <literal>&lt;http://example.com/></literal>
</para> </para>
<programlisting><![CDATA[or here: <http://example.com/>]]></programlisting> <screen>
or here: &lt;http://example.com/>
</screen>
</section> </section>
</section> </section>
<section> <section>
@ -950,7 +962,9 @@ Cat &amp; 1 \\ \hline
Subsequent blocks are indented to show that they belong to the Subsequent blocks are indented to show that they belong to the
footnote (as with list items). footnote (as with list items).
</para> </para>
<programlisting><![CDATA[ { <code> }]]></programlisting> <screen>
{ &lt;code> }
</screen>
<para> <para>
If you want, you can indent every line, but you can also be lazy If you want, you can indent every line, but you can also be lazy
and just indent the first line of each block. and just indent the first line of each block.