| 1 |
.TH "cexcerpt" 1 "@SSDK_DATE@" "SSDK @SSDK_VERSION@" "SSDK" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
.TP |
| 5 |
cexcerpt - extract tagged code chunks for verbatim inclusion in documentation |
| 6 |
|
| 7 |
|
| 8 |
.SH SYNOPSIS |
| 9 |
.B cexcerpt |
| 10 |
.I file.c |
| 11 |
.I dir |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
.SH DESCRIPTION |
| 16 |
|
| 17 |
.I cexcerpt |
| 18 |
processes a C source file |
| 19 |
.I file.c, |
| 20 |
extracts tagged excerpts, |
| 21 |
and puts these excerpts in a file in directory |
| 22 |
.I dir. |
| 23 |
|
| 24 |
.PP |
| 25 |
An excerpt is marked with special comments in the C file, as in |
| 26 |
this example: |
| 27 |
|
| 28 |
.nf |
| 29 |
/*::cexcerpt::my_example::begin::*/ |
| 30 |
while (esl_sq_Read(sqfp, sq) == eslOK) |
| 31 |
{ n++; } |
| 32 |
/*::cexcerpt::my_example::end::*/ |
| 33 |
.fi |
| 34 |
|
| 35 |
.PP |
| 36 |
The tag's format is "::cexcerpt::<tag>::begin::" (or end). |
| 37 |
The tag is used to construct the file name, as |
| 38 |
.I <tag>.tex. |
| 39 |
In the example, the tag my_example creates a file |
| 40 |
.I my_example.tex |
| 41 |
in |
| 42 |
.I dir. |
| 43 |
|
| 44 |
.PP |
| 45 |
All the text between the cexcerpt tags is put in the file. |
| 46 |
In addition, this text is wrapped in a {cchunk} environment. |
| 47 |
So in the example above, |
| 48 |
.I my_example.tex |
| 49 |
will contain: |
| 50 |
|
| 51 |
.nf |
| 52 |
\\begin{cchunk} |
| 53 |
while (esl_sq_Read(sqfp, sq) == eslOK) |
| 54 |
{ n++; } |
| 55 |
\\end{cchunk} |
| 56 |
.fi |
| 57 |
|
| 58 |
.PP |
| 59 |
This file can then be included in a LaTeX file, with |
| 60 |
\\input{<dir>/<tag>}. |
| 61 |
|
| 62 |
.PP |
| 63 |
For best results, the C source should be free of TAB characters. |
| 64 |
"M-x untabify" on the region to clean them out. |
| 65 |
|
| 66 |
.PP |
| 67 |
Cexcerpts can't overlap or nest in any way in the C file; only |
| 68 |
one can be active at any given time. |
| 69 |
|
| 70 |
.SH OPTIONS |
| 71 |
|
| 72 |
Currently none. |
| 73 |
|