JCite With Plain Text Files

This document shows how JCite can cite examples from plain text files.

Citing Line-delimited Blocks

Using JCite, you can cite entire blocks, delimited by (usually) comment lines:

java -cp "$cp:$CLASSPATH" ch.arrenbrecht.jcite.JCite "$@"

This was produced by the following JCite instruction in the source HTML document:

[text:plain.sh:# ---- sample]

The part plain.sh tells JCite which file to cite from. The part # ---- sample tells it what fragment to cite. You surround citable fragments with special comments in the text file:

# ---- sample
java -cp "$cp:$CLASSPATH" ch.arrenbrecht.jcite.JCite "$@"
# ---- sample

The part # ---- sample is freely choosable. It must simply match the respective comment in the source file.

Citing from XML/HTML

We can similarly cite from an XML file. However, including the XML comment symbols in HTML sources can be cumbersome, so JCite offers a simplification:

<p>This is just some <b>demo</b> text.</p>

This was produced by the following JCite instruction in the source HTML document:

[text:plain.xml:xml! sample ]

The part xml! sample tells JCite to look for an XML comment with sample in it, so:

<!-- sample -->
<p>This is just some <b>demo</b> text.</p>
<!-- sample -->