summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/typo-hid.mkxl
blob: 13d8f14ca6f70fab0a3afed4336e0d83a48f82ef (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
%D \module
%D   [       file=typo-hid,
%D        version=2021.03.15, % based on old code lying around
%D          title=\CONTEXT\ Typesetting Macros,
%D       subtitle=Hiding,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Typesetting Macros / Hiding}

\registerctxluafile{typo-hid}{autosuffix}

\definesystemattribute[hidecontent][public]

\unprotect

\newinteger\c_typo_hidden_level

\permanent\protected\def\starthiddencontent
  {\ifcase\c_typo_hidden_level
     \clf_enablehidecontent
     \let\clf_enablehidecontent\relax
     \attribute\hidecontentattribute\plusone
   \fi
   \advanceby\c_typo_hidden_level\plusone}

\permanent\protected\def\stophiddencontent
  {\advanceby\c_typo_hidden_level\minusone
   \ifcase\c_typo_hidden_level
     \attribute\hidecontentattribute\attributeunsetvalue
   \fi}

\protect \endinput