This repository has been archived by the owner on Jul 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.go
297 lines (280 loc) · 10.9 KB
/
const.go
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
//-----------------------------------------------------------------------------
// Copyright (c) 2022-present Detlef Stern
//
// This file is part of zettelstore-client.
//
// Zettelstore client is licensed under the latest version of the EUPL
// (European Union Public License). Please see file LICENSE.txt for your rights
// and obligations under this license.
//-----------------------------------------------------------------------------
package sz
import "zettelstore.de/sx.fossil/sxpf"
// Various constants for Zettel data. Some of them are technically variables.
const (
// Symbols for Metanodes
NameSymBlock = "BLOCK"
NameSymInline = "INLINE"
NameSymList = "list"
NameSymMeta = "META"
NameSymQuote = "quote"
// Symbols for Zettel node types.
NameSymBLOB = "BLOB"
NameSymCell = "CELL"
NameSymCellCenter = "CELL-CENTER"
NameSymCellLeft = "CELL-LEFT"
NameSymCellRight = "CELL-RIGHT"
NameSymCite = "CITE"
NameSymDescription = "DESCRIPTION"
NameSymEmbed = "EMBED"
NameSymEmbedBLOB = "EMBED-BLOB"
NameSymEndnote = "ENDNOTE"
NameSymFormatEmph = "FORMAT-EMPH"
NameSymFormatDelete = "FORMAT-DELETE"
NameSymFormatInsert = "FORMAT-INSERT"
NameSymFormatQuote = "FORMAT-QUOTE"
NameSymFormatSpan = "FORMAT-SPAN"
NameSymFormatSub = "FORMAT-SUB"
NameSymFormatSuper = "FORMAT-SUPER"
NameSymFormatStrong = "FORMAT-STRONG"
NameSymHard = "HARD"
NameSymHeading = "HEADING"
NameSymLinkInvalid = "LINK-INVALID"
NameSymLinkZettel = "LINK-ZETTEL"
NameSymLinkSelf = "LINK-SELF"
NameSymLinkFound = "LINK-FOUND"
NameSymLinkBroken = "LINK-BROKEN"
NameSymLinkHosted = "LINK-HOSTED"
NameSymLinkBased = "LINK-BASED"
NameSymLinkQuery = "LINK-QUERY"
NameSymLinkExternal = "LINK-EXTERNAL"
NameSymListOrdered = "ORDERED"
NameSymListUnordered = "UNORDERED"
NameSymListQuote = "QUOTATION"
NameSymLiteralProg = "LITERAL-CODE"
NameSymLiteralComment = "LITERAL-COMMENT"
NameSymLiteralHTML = "LITERAL-HTML"
NameSymLiteralInput = "LITERAL-INPUT"
NameSymLiteralMath = "LITERAL-MATH"
NameSymLiteralOutput = "LITERAL-OUTPUT"
NameSymLiteralZettel = "LITERAL-ZETTEL"
NameSymMark = "MARK"
NameSymPara = "PARA"
NameSymRegionBlock = "REGION-BLOCK"
NameSymRegionQuote = "REGION-QUOTE"
NameSymRegionVerse = "REGION-VERSE"
NameSymSoft = "SOFT"
NameSymSpace = "SPACE"
NameSymTable = "TABLE"
NameSymText = "TEXT"
NameSymThematic = "THEMATIC"
NameSymTransclude = "TRANSCLUDE"
NameSymUnknown = "UNKNOWN-NODE"
NameSymVerbatimComment = "VERBATIM-COMMENT"
NameSymVerbatimEval = "VERBATIM-EVAL"
NameSymVerbatimHTML = "VERBATIM-HTML"
NameSymVerbatimMath = "VERBATIM-MATH"
NameSymVerbatimProg = "VERBATIM-CODE"
NameSymVerbatimZettel = "VERBATIM-ZETTEL"
// Constant symbols for reference states.
NameSymRefStateInvalid = "INVALID"
NameSymRefStateZettel = "ZETTEL"
NameSymRefStateSelf = "SELF"
NameSymRefStateFound = "FOUND"
NameSymRefStateBroken = "BROKEN"
NameSymRefStateHosted = "HOSTED"
NameSymRefStateBased = "BASED"
NameSymRefStateQuery = "QUERY"
NameSymRefStateExternal = "EXTERNAL"
// Symbols for metadata types.
NameSymTypeCredential = "CREDENTIAL"
NameSymTypeEmpty = "EMPTY-STRING"
NameSymTypeID = "ZID"
NameSymTypeIDSet = "ZID-SET"
NameSymTypeNumber = "NUMBER"
NameSymTypeString = "STRING"
NameSymTypeTagSet = "TAG-SET"
NameSymTypeTimestamp = "TIMESTAMP"
NameSymTypeURL = "URL"
NameSymTypeWord = "WORD"
NameSymTypeWordSet = "WORD-SET"
NameSymTypeZettelmarkup = "ZETTELMARKUP"
)
// ZettelSymbols collect all symbols needed to represent zettel data.
type ZettelSymbols struct {
// Symbols for Metanodes
SymBlock *sxpf.Symbol
SymInline *sxpf.Symbol
SymList *sxpf.Symbol
SymMeta *sxpf.Symbol
SymQuote *sxpf.Symbol
// Symbols for Zettel node types.
SymBLOB *sxpf.Symbol
SymCell *sxpf.Symbol
SymCellCenter *sxpf.Symbol
SymCellLeft *sxpf.Symbol
SymCellRight *sxpf.Symbol
SymCite *sxpf.Symbol
SymDescription *sxpf.Symbol
SymEmbed *sxpf.Symbol
SymEmbedBLOB *sxpf.Symbol
SymEndnote *sxpf.Symbol
SymFormatEmph *sxpf.Symbol
SymFormatDelete *sxpf.Symbol
SymFormatInsert *sxpf.Symbol
SymFormatQuote *sxpf.Symbol
SymFormatSpan *sxpf.Symbol
SymFormatSub *sxpf.Symbol
SymFormatSuper *sxpf.Symbol
SymFormatStrong *sxpf.Symbol
SymHard *sxpf.Symbol
SymHeading *sxpf.Symbol
SymLinkInvalid *sxpf.Symbol
SymLinkZettel *sxpf.Symbol
SymLinkSelf *sxpf.Symbol
SymLinkFound *sxpf.Symbol
SymLinkBroken *sxpf.Symbol
SymLinkHosted *sxpf.Symbol
SymLinkBased *sxpf.Symbol
SymLinkQuery *sxpf.Symbol
SymLinkExternal *sxpf.Symbol
SymListOrdered *sxpf.Symbol
SymListUnordered *sxpf.Symbol
SymListQuote *sxpf.Symbol
SymLiteralProg *sxpf.Symbol
SymLiteralComment *sxpf.Symbol
SymLiteralHTML *sxpf.Symbol
SymLiteralInput *sxpf.Symbol
SymLiteralMath *sxpf.Symbol
SymLiteralOutput *sxpf.Symbol
SymLiteralZettel *sxpf.Symbol
SymMark *sxpf.Symbol
SymPara *sxpf.Symbol
SymRegionBlock *sxpf.Symbol
SymRegionQuote *sxpf.Symbol
SymRegionVerse *sxpf.Symbol
SymSoft *sxpf.Symbol
SymSpace *sxpf.Symbol
SymTable *sxpf.Symbol
SymText *sxpf.Symbol
SymThematic *sxpf.Symbol
SymTransclude *sxpf.Symbol
SymUnknown *sxpf.Symbol
SymVerbatimComment *sxpf.Symbol
SymVerbatimEval *sxpf.Symbol
SymVerbatimHTML *sxpf.Symbol
SymVerbatimMath *sxpf.Symbol
SymVerbatimProg *sxpf.Symbol
SymVerbatimZettel *sxpf.Symbol
// Constant symbols for reference states.
SymRefStateInvalid *sxpf.Symbol
SymRefStateZettel *sxpf.Symbol
SymRefStateSelf *sxpf.Symbol
SymRefStateFound *sxpf.Symbol
SymRefStateBroken *sxpf.Symbol
SymRefStateHosted *sxpf.Symbol
SymRefStateBased *sxpf.Symbol
SymRefStateQuery *sxpf.Symbol
SymRefStateExternal *sxpf.Symbol
// Symbols for metadata types
SymTypeCredential *sxpf.Symbol
SymTypeEmpty *sxpf.Symbol
SymTypeID *sxpf.Symbol
SymTypeIDSet *sxpf.Symbol
SymTypeNumber *sxpf.Symbol
SymTypeString *sxpf.Symbol
SymTypeTagSet *sxpf.Symbol
SymTypeTimestamp *sxpf.Symbol
SymTypeURL *sxpf.Symbol
SymTypeWord *sxpf.Symbol
SymTypeWordSet *sxpf.Symbol
SymTypeZettelmarkup *sxpf.Symbol
}
func (zs *ZettelSymbols) InitializeZettelSymbols(sf sxpf.SymbolFactory) {
// Symbols for Metanodes
zs.SymBlock = sf.MustMake(NameSymBlock)
zs.SymInline = sf.MustMake(NameSymInline)
zs.SymList = sf.MustMake(NameSymList)
zs.SymMeta = sf.MustMake(NameSymMeta)
zs.SymQuote = sf.MustMake(NameSymQuote)
// Symbols for Zettel node types.
zs.SymBLOB = sf.MustMake(NameSymBLOB)
zs.SymCell = sf.MustMake(NameSymCell)
zs.SymCellCenter = sf.MustMake(NameSymCellCenter)
zs.SymCellLeft = sf.MustMake(NameSymCellLeft)
zs.SymCellRight = sf.MustMake(NameSymCellRight)
zs.SymCite = sf.MustMake(NameSymCite)
zs.SymDescription = sf.MustMake(NameSymDescription)
zs.SymEmbed = sf.MustMake(NameSymEmbed)
zs.SymEmbedBLOB = sf.MustMake(NameSymEmbedBLOB)
zs.SymEndnote = sf.MustMake(NameSymEndnote)
zs.SymFormatEmph = sf.MustMake(NameSymFormatEmph)
zs.SymFormatDelete = sf.MustMake(NameSymFormatDelete)
zs.SymFormatInsert = sf.MustMake(NameSymFormatInsert)
zs.SymFormatQuote = sf.MustMake(NameSymFormatQuote)
zs.SymFormatSpan = sf.MustMake(NameSymFormatSpan)
zs.SymFormatSub = sf.MustMake(NameSymFormatSub)
zs.SymFormatSuper = sf.MustMake(NameSymFormatSuper)
zs.SymFormatStrong = sf.MustMake(NameSymFormatStrong)
zs.SymHard = sf.MustMake(NameSymHard)
zs.SymHeading = sf.MustMake(NameSymHeading)
zs.SymLinkInvalid = sf.MustMake(NameSymLinkInvalid)
zs.SymLinkZettel = sf.MustMake(NameSymLinkZettel)
zs.SymLinkSelf = sf.MustMake(NameSymLinkSelf)
zs.SymLinkFound = sf.MustMake(NameSymLinkFound)
zs.SymLinkBroken = sf.MustMake(NameSymLinkBroken)
zs.SymLinkHosted = sf.MustMake(NameSymLinkHosted)
zs.SymLinkBased = sf.MustMake(NameSymLinkBased)
zs.SymLinkQuery = sf.MustMake(NameSymLinkQuery)
zs.SymLinkExternal = sf.MustMake(NameSymLinkExternal)
zs.SymListOrdered = sf.MustMake(NameSymListOrdered)
zs.SymListUnordered = sf.MustMake(NameSymListUnordered)
zs.SymListQuote = sf.MustMake(NameSymListQuote)
zs.SymLiteralProg = sf.MustMake(NameSymLiteralProg)
zs.SymLiteralComment = sf.MustMake(NameSymLiteralComment)
zs.SymLiteralHTML = sf.MustMake(NameSymLiteralHTML)
zs.SymLiteralInput = sf.MustMake(NameSymLiteralInput)
zs.SymLiteralMath = sf.MustMake(NameSymLiteralMath)
zs.SymLiteralOutput = sf.MustMake(NameSymLiteralOutput)
zs.SymLiteralZettel = sf.MustMake(NameSymLiteralZettel)
zs.SymMark = sf.MustMake(NameSymMark)
zs.SymPara = sf.MustMake(NameSymPara)
zs.SymRegionBlock = sf.MustMake(NameSymRegionBlock)
zs.SymRegionQuote = sf.MustMake(NameSymRegionQuote)
zs.SymRegionVerse = sf.MustMake(NameSymRegionVerse)
zs.SymSoft = sf.MustMake(NameSymSoft)
zs.SymSpace = sf.MustMake(NameSymSpace)
zs.SymTable = sf.MustMake(NameSymTable)
zs.SymText = sf.MustMake(NameSymText)
zs.SymThematic = sf.MustMake(NameSymThematic)
zs.SymTransclude = sf.MustMake(NameSymTransclude)
zs.SymUnknown = sf.MustMake(NameSymUnknown)
zs.SymVerbatimComment = sf.MustMake(NameSymVerbatimComment)
zs.SymVerbatimEval = sf.MustMake(NameSymVerbatimEval)
zs.SymVerbatimHTML = sf.MustMake(NameSymVerbatimHTML)
zs.SymVerbatimMath = sf.MustMake(NameSymVerbatimMath)
zs.SymVerbatimProg = sf.MustMake(NameSymVerbatimProg)
zs.SymVerbatimZettel = sf.MustMake(NameSymVerbatimZettel)
// Constant symbols for reference states.
zs.SymRefStateInvalid = sf.MustMake(NameSymRefStateInvalid)
zs.SymRefStateZettel = sf.MustMake(NameSymRefStateZettel)
zs.SymRefStateSelf = sf.MustMake(NameSymRefStateSelf)
zs.SymRefStateFound = sf.MustMake(NameSymRefStateFound)
zs.SymRefStateBroken = sf.MustMake(NameSymRefStateBroken)
zs.SymRefStateHosted = sf.MustMake(NameSymRefStateHosted)
zs.SymRefStateBased = sf.MustMake(NameSymRefStateBased)
zs.SymRefStateQuery = sf.MustMake(NameSymRefStateQuery)
zs.SymRefStateExternal = sf.MustMake(NameSymRefStateExternal)
// Symbols for metadata types.
zs.SymTypeCredential = sf.MustMake(NameSymTypeCredential)
zs.SymTypeEmpty = sf.MustMake(NameSymTypeEmpty)
zs.SymTypeID = sf.MustMake(NameSymTypeID)
zs.SymTypeIDSet = sf.MustMake(NameSymTypeIDSet)
zs.SymTypeNumber = sf.MustMake(NameSymTypeNumber)
zs.SymTypeString = sf.MustMake(NameSymTypeString)
zs.SymTypeTagSet = sf.MustMake(NameSymTypeTagSet)
zs.SymTypeTimestamp = sf.MustMake(NameSymTypeTimestamp)
zs.SymTypeURL = sf.MustMake(NameSymTypeURL)
zs.SymTypeWord = sf.MustMake(NameSymTypeWord)
zs.SymTypeWordSet = sf.MustMake(NameSymTypeWordSet)
zs.SymTypeZettelmarkup = sf.MustMake(NameSymTypeZettelmarkup)
}