Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.19.0
To v0.20.0
2025-03-07
| | |
16:48 |
|
...
(check-in: f0f37f254c user: stern tags: trunk)
|
16:06 |
|
...
(check-in: 674f1fe89d user: stern tags: trunk, release, v0.20.0)
|
10:41 |
|
...
(check-in: b138cefd04 user: stern tags: trunk)
|
2024-12-13
| | |
14:01 |
|
...
(check-in: 8d481c1e92 user: stern tags: trunk)
|
13:26 |
|
...
(check-in: bb751329ab user: stern tags: trunk, release, v0.19.0)
|
12:36 |
|
...
(check-in: 5ed6d8e8e3 user: stern tags: trunk)
|
| | |
Changes to VERSION.
Changes to ast/ast.go.
︙ | | |
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
|
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
|
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
|
// Package ast provides the abstract syntax tree for parsed zettel content.
package ast
import (
"net/url"
"zettelstore.de/z/zettel"
"zettelstore.de/z/zettel/id"
"zettelstore.de/z/zettel/meta"
"t73f.de/r/zsc/domain/id"
"t73f.de/r/zsc/domain/meta"
"zettelstore.de/z/zettel"
)
// ZettelNode is the root node of the abstract syntax tree.
// It is *not* part of the visitor pattern.
type ZettelNode struct {
Meta *meta.Meta // Original metadata
Content zettel.Content // Original content
Zid id.Zid // Zettel identification.
InhMeta *meta.Meta // Metadata of the zettel, with inherited values.
Ast BlockSlice // Zettel abstract syntax tree is a sequence of block nodes.
Syntax string // Syntax / parser that produced the Ast
Meta *meta.Meta // Original metadata
Content zettel.Content // Original content
Zid id.Zid // Zettel identification.
InhMeta *meta.Meta // Metadata of the zettel, with inherited values.
BlocksAST BlockSlice // Zettel abstract syntax tree is a sequence of block nodes.
Syntax string // Syntax / parser that produced the Ast
}
// Node is the interface, all nodes must implement.
type Node interface {
WalkChildren(v Visitor)
}
|
︙ | | |
Changes to ast/block.go.
︙ | | |
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
-
+
|
// VerbatimKind specifies the format that is applied to code inline nodes.
type VerbatimKind int
// Constants for VerbatimCode
const (
_ VerbatimKind = iota
VerbatimZettel // Zettel content
VerbatimProg // Program code
VerbatimCode // Program code
VerbatimEval // Code to be externally interpreted. Syntax is stored in default attribute.
VerbatimComment // Block comment
VerbatimHTML // Block HTML, e.g. for Markdown
VerbatimMath // Block math mode
)
func (*VerbatimNode) blockNode() { /* Just a marker */ }
|
︙ | | |
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
|
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
|
-
+
+
+
+
+
+
-
-
+
+
+
-
-
+
+
|
func (*TableNode) blockNode() { /* Just a marker */ }
// WalkChildren walks down to the cells.
func (tn *TableNode) WalkChildren(v Visitor) {
if header := tn.Header; header != nil {
for i := range header {
Walk(v, &header[i].Inlines) // Otherwise changes will not go back
Walk(v, header[i]) // Otherwise changes will not go back
}
}
if rows := tn.Rows; rows != nil {
for _, row := range rows {
for i := range row {
Walk(v, &row[i].Inlines) // Otherwise changes will not go back
}
}
}
}
// WalkChildren walks the list of inline elements.
func (cell *TableCell) WalkChildren(v Visitor) {
Walk(v, &cell.Inlines) // Otherwise changes will not go back
}
//--------------------------------------------------------------------------
// TranscludeNode specifies block content from other zettel to embedded in
// current zettel
type TranscludeNode struct {
Attrs attrs.Attributes
Ref *Reference
Attrs attrs.Attributes
Ref *Reference
Inlines InlineSlice // Optional text.
}
func (*TranscludeNode) blockNode() { /* Just a marker */ }
// WalkChildren does nothing.
func (*TranscludeNode) WalkChildren(Visitor) { /* No children*/ }
// WalkChildren walks the associated text.
func (tn *TranscludeNode) WalkChildren(v Visitor) { Walk(v, &tn.Inlines) }
//--------------------------------------------------------------------------
// BLOBNode contains just binary data that must be interpreted according to
// a syntax.
type BLOBNode struct {
Description InlineSlice
|
︙ | | |
Changes to ast/inline.go.
︙ | | |
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
+
-
-
+
+
+
|
// InlineSlice is a list of BlockNodes.
type InlineSlice []InlineNode
func (*InlineSlice) inlineNode() { /* Just a marker */ }
// WalkChildren walks down to the list.
func (is *InlineSlice) WalkChildren(v Visitor) {
if is != nil {
for _, in := range *is {
Walk(v, in)
for _, in := range *is {
Walk(v, in)
}
}
}
// --------------------------------------------------------------------------
// TextNode just contains some text.
type TextNode struct {
|
︙ | | |
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
-
-
+
-
|
// LiteralKind specifies the format that is applied to code inline nodes.
type LiteralKind int
// Constants for LiteralCode
const (
_ LiteralKind = iota
LiteralZettel // Zettel content
LiteralProg // Inline program code
LiteralCode // Inline program code
LiteralInput // Computer input, e.g. Keyboard strokes
LiteralOutput // Computer output
LiteralComment // Inline comment
LiteralHTML // Inline HTML, e.g. for Markdown
LiteralMath // Inline math mode
)
func (*LiteralNode) inlineNode() { /* Just a marker */ }
// WalkChildren does nothing.
func (*LiteralNode) WalkChildren(Visitor) { /* No children*/ }
|
Changes to ast/ref.go.
︙ | | |
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
-
+
|
package ast
import (
"net/url"
"strings"
"t73f.de/r/zsc/api"
"zettelstore.de/z/zettel/id"
"t73f.de/r/zsc/domain/id"
)
// QueryPrefix is the prefix that denotes a query expression.
const QueryPrefix = api.QueryPrefix
// ParseReference parses a string and returns a reference.
func ParseReference(s string) *Reference {
|
︙ | | |
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
+
+
+
-
-
-
|
return RefStateHosted, path[1] == '/'
}
return RefStateInvalid, false
}
// String returns the string representation of a reference.
func (r Reference) String() string {
if r.State == RefStateQuery {
return QueryPrefix + r.Value
}
if r.URL != nil {
return r.URL.String()
}
if r.State == RefStateQuery {
return QueryPrefix + r.Value
}
return r.Value
}
// IsValid returns true if reference is valid
func (r *Reference) IsValid() bool { return r.State != RefStateInvalid }
// IsZettel returns true if it is a referencen to a local zettel.
|
︙ | | |
Added ast/sztrans/sztrans.go.