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 -->
Citing Without Predefined Surrounding Markup
Normally, JCite removes the citation directive’s surrounding tag pair (normally a pre
pair), and replaces it with:
<pre class="j-text"><code>...</code></pre>
To avoid this, just use a textp:
prefix instead of text:
(where the “p” stands for plain). So:
<p>This is just some <b>demo</b> text.</p>
This was produced by the following JCite instruction in the source HTML document inside a blockquote
tag:
[textp:plain.xml:xml! sample ]
Citing Without Any Post-Processing
To cite directly into the HTML document markup, use textraw
(note, though, that you still need to enclose the citation instruction in a tag of its own). So:
This is just some demo text.
This was produced by the following JCite instruction in the source HTML document inside a blockquote
tag:
[textraw:plain.xml:xml! sample ]