forked from nvim-neorg/norg-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdlib.norg
61 lines (54 loc) · 1.29 KB
/
stdlib.norg
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
|comment
This document is a real implementation of the Norg standard library.
This includes all carryover tags, ranged tags and their behaviours.
|end
== color color next
#eval
@code nip
%TODO: This is inconsistent with the `attribute-limits` code.
There should be a different way to apply "attributes" to nodes.%
{
inherit color,
} @next
@end
==
== name name next
#eval
@code nip
{
inherit name,
} @next
@end
==
%See: {:1.0-specification:**** Limits}%
== attribute-limits ...limits next
#eval
@code nip
# If assertion fails then don't evaluate to anything
if attribute in next => (attribute == .(attribute)) do
# Ensure that every attribute given to the `attribute-limits` tag is one of the values in the
# list.
assert limit in limits => ([ "none", "verbatim", "non-verbatim", "math", "variables", "links" ] <- limit:type);
# Assign the limits to the attribute
{
inherit limits,
} @next;
else
{
none: .(_),
verbatim: .(verbatim),
non-verbatim: .(!(verbatim)),
math: .(inline-math),
variables: .(inline-variable),
links: .(links),
} @map;
assert-any (limit in limits => (map:(limit) == next));
{
inherit limits,
} @next;
end
@end
==
%Yup, this is the implementation of `comment`%
== comment ...
==