summaryrefslogtreecommitdiff
path: root/web/glasgow/lit2x-0.16/literate/lit-2text.lprl
blob: 54406e686c939f6a45476e3b4b6fa6166dbd94e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\section[lit2text_only]{Code used only in extracting text}

Whereas \tr{lit2pgm} saves the code from a document (usually to feed
to a compiler), \tr{lit2text} saves the raw text from a document
(usually to feed to a spelling checker, or something similar).

\begin{code}
# still probably too simplistic
sub spit_out_raw_text {

    foreach ($S = 0; $S <= $#Sec_depth; $S++) {
        print "\\section$Sec_depth[$S]\[$Sec_nodespec[$S]\]\{$Sec_title[$S]\}\n";

        foreach ($B = $Sec_first_blk[$S]; $B <= $Sec_last_blk[$S]; $B++) {

	    print $Blk_txt[$B] if $Blk_type[$B] ne 'code';
	}
    }
}

# this keeps 'do'ing happy
1;
\end{code}