Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.10.1
To trunk
2024-03-18
| | |
11:06 |
|
...
(Leaf
check-in: 726c56c5ed user: stern tags: trunk)
|
11:01 |
|
...
(check-in: 20c2401591 user: stern tags: trunk)
|
2023-01-30
| | |
12:49 |
|
...
(check-in: ed2d3ce05d user: stern tags: trunk)
|
12:40 |
|
...
(Leaf
check-in: 70b0cdc454 user: stern tags: release, release-0.10, v0.10.1)
|
2023-01-24
| | |
21:47 |
|
...
(check-in: b6301cf091 user: stern tags: trunk, release, v0.10.0)
|
| | |
Changes to .fossil-settings/ignore-glob.
1
2
3
|
1
2
|
-
|
bin/*
releases/*
parser/pikchr/*.out
|
Changes to LICENSE.txt.
1
2
3
4
5
6
7
8
|
1
2
3
4
5
6
7
8
|
-
+
|
Copyright (c) 2020-2023 Detlef Stern
Copyright (c) 2020-present Detlef Stern
Licensed under the EUPL
Zettelstore is licensed under the European Union Public License, version 1.2 or
later (EUPL v. 1.2). The license is available in the official languages of the
EU. The English version is included here. Please see
https://joinup.ec.europa.eu/community/eupl/og_page/eupl for official
|
︙ | | |
Changes to Makefile.
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
|
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
|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
|
## Copyright (c) 2020-2022 Detlef Stern
## Copyright (c) 2020-present Detlef Stern
##
## This file is part of Zettelstore.
##
## Zettelstore 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.
.PHONY: check relcheck api build release clean
.PHONY: check relcheck api version build release clean
check:
go run tools/build.go check
go run tools/check/check.go
relcheck:
go run tools/build.go relcheck
go run tools/check/check.go -r
api:
go run tools/build.go testapi
go run tools/testapi/testapi.go
version:
@echo $(shell go run tools/build.go version)
@echo $(shell go run tools/build/build.go version)
build:
go run tools/build.go build
go run tools/build/build.go build
release:
go run tools/build.go release
go run tools/build/build.go release
clean:
go run tools/build.go clean
go run tools/clean/clean.go
|
Changes to README.md.
︙ | | |
19
20
21
22
23
24
25
26
27
|
19
20
21
22
23
24
25
26
|
-
-
+
|
often connects to Zettelstore via its API. Some of the software packages may be
experimental.
The software, including the manual, is licensed
under the [European Union Public License 1.2 (or
later)](https://zettelstore.de/home/file?name=LICENSE.txt&ci=trunk).
[Stay](https://twitter.com/zettelstore)
<a rel="me" href="https://nerdculture.de/@zettelstore">tuned</a> …
[Stay tuned](https://mastodon.social/tags/Zettelstore) …
|
Changes to VERSION.
1
|
1
|
-
+
|
0.10.1
0.18.0-dev
|
Changes to ast/ast.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
|
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
|
-
+
+
+
+
-
-
-
+
+
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
// Package ast provides the abstract syntax tree for parsed zettel content.
package ast
import (
"net/url"
"zettelstore.de/z/domain"
"zettelstore.de/z/domain/id"
"zettelstore.de/z/domain/meta"
"zettelstore.de/z/zettel"
"zettelstore.de/z/zettel/id"
"zettelstore.de/z/zettel/meta"
)
// 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 domain.Content // Original content
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
}
// Node is the interface, all nodes must implement.
|
︙ | | |
Changes to ast/block.go.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
-
+
+
+
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2023 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
package ast
import "zettelstore.de/c/attrs"
import "zettelstore.de/client.fossil/attrs"
// Definition of Block nodes.
// BlockSlice is a slice of BlockNodes.
type BlockSlice []BlockNode
func (*BlockSlice) blockNode() { /* Just a marker */ }
|
︙ | | |
Changes to ast/inline.go.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
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
|
-
+
+
+
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
package ast
import (
"unicode/utf8"
"zettelstore.de/c/attrs"
"zettelstore.de/client.fossil/attrs"
)
// Definitions of inline nodes.
// InlineSlice is a list of BlockNodes.
type InlineSlice []InlineNode
|
︙ | | |
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
|
// FormatKind specifies the format that is applied to the inline nodes.
type FormatKind int
// Constants for FormatCode
const (
_ FormatKind = iota
FormatEmph // Emphasized text.
FormatStrong // Strongly emphasized text.
FormatInsert // Inserted text.
FormatDelete // Deleted text.
FormatSuper // Superscripted text.
FormatSub // SubscriptedText.
FormatQuote // Quoted text.
FormatSpan // Generic inline container.
FormatEmph // Emphasized text
FormatStrong // Strongly emphasized text
FormatInsert // Inserted text
FormatDelete // Deleted text
FormatSuper // Superscripted text
FormatSub // SubscriptedText
FormatQuote // Quoted text
FormatMark // Marked text
FormatSpan // Generic inline container
)
func (*FormatNode) inlineNode() { /* Just a marker */ }
// WalkChildren walks to the formatted text.
func (fn *FormatNode) WalkChildren(v Visitor) { Walk(v, &fn.Inlines) }
|
︙ | | |
Changes to ast/ref.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
|
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
|
-
+
+
+
+
+
-
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
package ast
import (
"net/url"
"strings"
"zettelstore.de/client.fossil/api"
"zettelstore.de/z/domain/id"
"zettelstore.de/z/zettel/id"
)
// QueryPrefix is the prefix that denotes a query expression.
const QueryPrefix = "query:"
const QueryPrefix = api.QueryPrefix
// ParseReference parses a string and returns a reference.
func ParseReference(s string) *Reference {
if invalidReference(s) {
return &Reference{URL: nil, Value: s, State: RefStateInvalid}
}
if strings.HasPrefix(s, QueryPrefix) {
|
︙ | | |
Changes to ast/ref_test.go.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
+
+
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
package ast_test
import (
"testing"
|
︙ | | |
Changes to ast/walk.go.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
-
+
+
+
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2021-2022 Detlef Stern
// Copyright (c) 2021-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2021-present Detlef Stern
//-----------------------------------------------------------------------------
package ast
// Visitor is a visitor for walking the AST.
type Visitor interface {
Visit(node Node) Visitor
|
︙ | | |
Changes to ast/walk_test.go.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
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
|
-
+
+
+
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2021-2022 Detlef Stern
// Copyright (c) 2021-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2021-present Detlef Stern
//-----------------------------------------------------------------------------
package ast_test
import (
"testing"
"zettelstore.de/c/attrs"
"zettelstore.de/client.fossil/attrs"
"zettelstore.de/z/ast"
)
func BenchmarkWalk(b *testing.B) {
root := ast.BlockSlice{
&ast.HeadingNode{
Inlines: ast.CreateInlineSliceFromWords("A", "Simple", "Heading"),
|
︙ | | |
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
-
+
|
Ref: &ast.Reference{Value: "http://zettelstore.de"},
Inlines: ast.CreateInlineSliceFromWords("URL", "text."),
},
),
}
v := benchVisitor{}
b.ResetTimer()
for n := 0; n < b.N; n++ {
for range b.N {
ast.Walk(&v, &root)
}
}
type benchVisitor struct{}
func (bv *benchVisitor) Visit(ast.Node) ast.Visitor { return bv }
|
Changes to auth/auth.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
|
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
|
-
+
+
+
+
-
-
+
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2021-2022 Detlef Stern
// Copyright (c) 2021-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2021-present Detlef Stern
//-----------------------------------------------------------------------------
// Package auth provides services for authentification / authorization.
package auth
import (
"time"
"zettelstore.de/z/box"
"zettelstore.de/z/config"
"zettelstore.de/z/domain/id"
"zettelstore.de/z/domain/meta"
"zettelstore.de/z/zettel/id"
"zettelstore.de/z/zettel/meta"
)
// BaseManager allows to check some base auth modes.
type BaseManager interface {
// IsReadonly returns true, if the systems is configured to run in read-only-mode.
IsReadonly() bool
}
|
︙ | | |
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
-
-
+
+
|
// TokenKind specifies for which application / usage a token is/was requested.
type TokenKind int
// Allowed values of token kind
const (
_ TokenKind = iota
KindJSON
KindHTML
KindAPI
KindwebUI
)
// TokenData contains some important elements from a token.
type TokenData struct {
Token []byte
Now time.Time
Issued time.Time
|
︙ | | |
Changes to auth/cred/cred.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
|
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
|
-
+
+
+
+
-
+
|
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
// Copyright (c) 2020-present Detlef Stern
//
// This file is part of Zettelstore.
//
// Zettelstore 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.
//
// SPDX-License-Identifier: EUPL-1.2
// SPDX-FileCopyrightText: 2020-present Detlef Stern
//-----------------------------------------------------------------------------
// Package cred provides some function for handling credentials.
package cred
import (
"bytes"
"golang.org/x/crypto/bcrypt"
"zettelstore.de/z/domain/id"
"zettelstore.de/z/zettel/id"
)
// HashCredential returns a hashed vesion of the given credential
func HashCredential(zid id.Zid, ident, credential string) (string, error) {
fullCredential := createFullCredential(zid, ident, credential)
res, err := bcrypt.GenerateFromPassword(fullCredential, bcrypt.DefaultCost)
if err != nil {
|
︙ | | |
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
-
+
|
return false, nil
}
return false, err
}
func createFullCredential(zid id.Zid, ident, credential string) []byte {
var buf bytes.Buffer
buf.WriteString(zid.String())
buf.Write(zid.Bytes())
buf.WriteByte(' ')
buf.WriteString(ident)
buf.WriteByte(' ')
buf.WriteString(credential)
return buf.Bytes()
}
|
Added auth/impl/digest.go.