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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
%D \module
%D [ file=x-dir-01,
%D version=2003.05.10, % around that time -)
%D title=\CONTEXT\ Directory Handling,
%D subtitle=Overview (1),
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\setuppapersize
[S6][S6]
\setuplayout
[width=middle,
height=middle,
backspace=12pt,
topspace=12pt,
bottomspace=32pt,
header=0pt,
footer=0pt,
bottomdistance=9pt,
bottom=18pt]
\setupinteractionmenu
[bottom]
[state=start,
frame=off,
rightoffset=-3pt,
background=color,
backgroundcolor=TextColor,
middle=\hskip4pt,
left=\hfill]
\startinteractionmenu[bottom]
\but [PreviousJump] Previous Jump \\
\but [previouspage] Previous Page \\
\but [nextpage] Next Page \\
\stopinteractionmenu
\setupbackgrounds
[page]
[backgroundoffset=3pt,
background=color,
backgroundcolor=PageColor]
\setupbackgrounds
[text]
[background=color,
backgroundcolor=TextColor]
\definecolor [PageColor] [r=.6,g=.7,b=.8]
\definecolor [TextColor] [r=.7,g=.8,b=.9]
\definecolor [DoneColor] [s=.5]
\startmode[colorscheme-red]
\definecolor [PageColor] [r=.9,g=.7,b=.6]
\definecolor [TextColor] [r=.9,g=.8,b=.7]
\stopmode
\startmode[colorscheme-green]
\definecolor [PageColor] [r=.6,g=.8,b=.7]
\definecolor [TextColor] [r=.7,g=.9,b=.8]
\stopmode
\setupcolors
[state=start]
\setupinteraction
[state=start,
menu=on,
color=,
display=new,
contrastcolor=DoneColor,
style=]
\definehead
[directory]
[subject]
\setuphead
[directory]
[style=\tfc]
\setupbodyfont
[tt]
\defineXMLenvironment [files] [url=]
{\doifelsenothing{\XMLop{url}}
{\xdef\XMLDIRurl{}}
{\xdef\XMLDIRurl{\XMLop{url}/}}
\startXMLignore}
{\stopXMLignore}
\newcounter\NOfEntries
\startsetups[xmldir:file]
\doglobal\increment\NOfEntries
\goto {\hbox to \hsize \bgroup
\XMLflush{base}
\hss
\hbox to 2em{\XMLflush{type}\hss}
\quad
\quad
\hbox to 5em{\hss\XMLflush{size}}
\quad
\quad
\XMLflush{date}
\egroup} [url(\XMLDIRurl\XMLop{name})]% [program(\XMLDIRurl\XMLop{name})]
\stopsetups
\defineXMLenvironment [directory] [name=]
{\directory{Path \XMLop{name}}}
{}
\defineXMLenvironment [file] [name=]
{\bgroup}
{\setups[xmldir:file]
\endgraf
\egroup}
\defineXMLsave[base]
\defineXMLsave[type]
\defineXMLsave[size]
\defineXMLsave[date]
\starttext
\processXMLfilegrouped{\inputfilename}
\ifnum\NOfEntries=0 There are no files found that match the pattern. \fi
\stoptext
|