page-inf.mkiv /size: 3669 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=page-inf, % moved from page-ini
3
%D version=2011.12.07, % 2000.10.20,
4
%D title=\CONTEXT\ Page Macros,
5
%D subtitle=Tracing Info,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\writestatus
{
loading
}{
ConTeXt
Page
Macros
/
Tracing
Info
}
15 16
% This needs a real cleanup .. will be a more detailed list.
17 18
\unprotect
19 20
\installcorenamespace
{
layoutinfo
}
21 22
\newtoks
\everyresetversion
23
\newtoks
\everysetupversion
24 25
\let
\currentversioninfo
\empty
26
\let
\currentversiontext
\empty
27 28
\unexpanded
\def
\setupversion
29
{
\dosingleargument
\page_info_setup
}
30 31
\let
\version\setupversion
32 33
\let
\page_info_add_to_box
\gobbleoneargument
34 35
\def
\page_info_setup
[#
1
]
%
36
{
\the
\everyresetversion
37
\doifelseassignment
{
#
1
}
%
38
{
\getdummyparameters
[
\c!alternative
=
,
\c!text
=
,
#
1
]
%
39
\edef
\currentversioninfo
{
\dummyparameter
\c!alternative
}
%
40
\edef
\currentversiontext
{
\dummyparameter
\c!text
}}
%
41
{
\edef
\currentversioninfo
{
#
1
}
%
42
\let
\currentversiontext
\empty
}
%
43
\ifcsname
\??layoutinfo
\currentversioninfo
\endcsname
44
\let
\page_info_add_to_box
\page_info_add_to_box_indeed
45
\else
46
\let
\currentversioninfo
\empty
47
\let
\page_info_add_to_box
\gobbleoneargument
48
\fi
49
\the
\everysetupversion
}
50 51
\unexpanded
\def
\page_info_place_info
% at the bottom of the page
52
{
\begincsname
\??layoutinfo
\currentversioninfo
\endcsname
}
53 54
\unexpanded
\def
\installversioninfo
#
1
#
2
%
55
{
\setvalue
{
\??layoutinfo
#
1
}{
#
2
}}
56 57
\unexpanded
\def
\includeversioninfo
#
1
%
58
{
\begincsname
\??layoutinfo
#
1
\endcsname
}
59 60
\installversioninfo
\v!final
61
{
\let
\currentversioninfo
\empty
62
\let
\page_info_add_to_box
\gobbleoneargument
}
63 64
\installversioninfo
\v!concept
65
{
\vskip
6
\points
66
\hbox
to
\makeupwidth
67
{
\infofont
68
\rlap
{
\v!concept
:
\space
\currentdate
}
%
69
\hss
70
\currentversiontext
71
\hss
72
\llap
{
\page_adapts_status_info
}}}
73 74
\installversioninfo
\v!file
75
{
\vskip
6
\points
76
\hbox
to
\makeupwidth
77
{
\infofont
78
\getmessage
\m!system
{
2
7
}
:
\space
\currentdate\quad
79
\donefalse
80
\doif
\currentproject\currentproduct
{
\doif
\currentproduct\currentcomponent
\donetrue
}
%
81
\ifdone
82
\donefalse
83
\else
84
\ifx
\currentproject
\empty
\else
\space
\v!project
:
\space
\currentproject
\space
\donetrue
\fi
85
\ifx
\currentproduct
\empty
\else
\space
\v!product
:
\space
\currentproduct
\space
\donetrue
\fi
86
\ifx
\currentcomponent
\empty
\else
\space
\v!component
:
\space
\currentcomponent\space
\donetrue
\fi
87
\fi
88
\ifdone
\else
\space
\v!file
:
\space
\jobname
\space
\fi
89
\hss
90
\currentversiontext
91
\quad
92
\page_adapts_status_info
}}
93 94
\installversioninfo
\v!temporary
95
{
\includeversioninfo
\v!file
}
96 97
\appendtoks
98
\overfullrule
\zeropoint
99
\to
\everyresetversion
100 101
\appendtoks
102
\ifx
\currentversioninfo
\v!temporary
103
\overfullrule
5
\points
104
\fi
105
\to
\everysetupversion
106 107
\newbox
\b_page_versions
108 109
\def
\page_info_add_to_box_indeed
#
1
%
110
{
\scratchdimen
\wd
#
1
%
111
\setbox
\b_page_versions
\vpack
to
\ht
#
1
%
112
{
\vfill
113
\settexthoffset
114
\hsize\dimexpr
\scratchdimen
-
2
\texthoffset
\relax
115
\hkern
\texthoffset
% brrrr
116
\vbox
to
\zeropoint
{
\vss
\page_info_place_info
}
%
117
\vkern
\bodyfontsize
}
%
118
\dp
\b_page_versions
\zeropoint
119
\wd
\b_page_versions
\scratchdimen
120
\setbox
#
1
\hpack
{
\box
#
1
\hkern
-
\scratchdimen
\box
\b_page_versions
}}
121 122
\setupversion
% resets
123
[
\v!final
]
124 125
\let
\page_info_add_to_box
\gobbleoneargument
126 127
\protect
\endinput
128