summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/nicetext/run/fdtxttex.tex
blob: 0c17662f5d8efae62c57739905e1bea93eaec3dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\ProvidesFile{fdtxttex.tex}[2011/09/13 txt to TeX by dialogue (UL)]
\RequirePackage{fddial0g}
%   \errorcontextlines=4
\MakeSet{job-name}{\JobName}
\MakeSet{in-ext}  {\InputExtension}
\MakeSet{out-ext} {\OutputExtension}
\MakeSet{corr-f}  {\CorrectionFile}
\MakeSet{f-head}  {\FileHeader}
\MakeSet{f-foot}  {\FileFooter}
\newif\ifShowLines
\MakeSet{show-l}  {\ShowLines}
\TryDialogueCFG{fdtxttex}{%
    \JobName{sample}
    \InputExtension{txt}
    \OutputExtension{tex}
    \CorrectionFile{mdoccorr.cfg}
    \FileHeader{\protect\WriteProvides}
    \FileFooter{}
    \ShowLines{false}
}
% \DebugShowVar{cfg-f}
\Announce{ *fdtxttex.tex* txt to TeX by dialogue^^J
          (apply \string\MakeDocCorrectHook)^^J}
\newcommand*{\VarShowSettings}{%
    \ShowSet{job-name}\LBrk\Spaces{15}
    \ShowSet{in-ext} \space
    \ShowSet{out-ext}\LBrk
    \ShowSet{corr-f}
    (define \BackslashChar MakeDocCorrectHook)\LBrk
    \ShowSet{f-head}\LBrk
    \ShowSet{f-foot}\LBrk
    \Spaces{15}
    \ShowSet{show-l}
}%
\newcommand*{\VarRunSettings}{%
    \input{\UseSet{corr-f}}%
    \typeout{`fdtxttex.tex' generating 
             `\UseSet{job-name}.\UseSet{out-ext}'.}%
    \UseResultFile{\UseSet{job-name}.\UseSet{out-ext}}%
    \IfEmptySet{f-head}{}{\UseSet{f-head}}%
    \EvalBooleanSet{show-l}%
    \ProcessFileWith{\UseSet{job-name}.\UseSet{in-ext}}{%
        \WriteResult{\CorrectedInputLine}%
        \ifShowLines
            \typeout{\CorrectedInputLine}%
        \else
            \message{.}%
        \fi}%
    \IfEmptySet{f-foot}{}{\UseSet{f-foot}}%
} 

\DialogueLoop

\stop