Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.6.0 To v0.5.0
2022-08-22
| ||
09:31 | Version 0.6.1 ... (check-in: d953a740f6 user: stern tags: release, release-0.6, v0.6.1) | |
2022-08-12
| ||
09:31 | Increase version to 0.7.0-dev to begin next development cycle ... (check-in: 12f09c3193 user: stern tags: trunk) | |
2022-08-11
| ||
17:09 | Version 0.6.0 ... (check-in: d495df0b57 user: stern tags: trunk, release, v0.6.0) | |
17:03 | Upgrade to newest client ... (check-in: 9673c31db1 user: stern tags: trunk) | |
2022-08-02
| ||
08:33 | Create new branch named "release-0.5" ... (check-in: 2ccbcee00f user: stern tags: release-0.5) | |
2022-08-01
| ||
11:47 | Increase version to 0.6.0-dev to begin next development cycle ... (check-in: e61bb9ce88 user: stern tags: trunk) | |
2022-07-29
| ||
14:21 | Version 0.5.0 ... (check-in: 7138adfeb5 user: stern tags: trunk, release, v0.5.0) | |
14:05 | Adapt to new client version ... (check-in: 26b3fdba14 user: stern tags: trunk) | |
Changes to README.md.
︙ | |||
19 20 21 22 23 24 25 | 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). |
Changes to VERSION.
| 1 | - + |
|
Changes to ast/ast.go.
︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 | - | RefStateInvalid RefState = iota // Invalid Reference RefStateZettel // Reference to an internal zettel RefStateSelf // Reference to same zettel with a fragment RefStateFound // Reference to an existing internal zettel, URL is ajusted RefStateBroken // Reference to a non-existing internal zettel RefStateHosted // Reference to local hosted non-Zettel, without URL change RefStateBased // Reference to local non-Zettel, to be prefixed |
Changes to ast/ref.go.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - - - - + - + - - - | // under this license. //----------------------------------------------------------------------------- package ast import ( "net/url" |
︙ | |||
69 70 71 72 73 74 75 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - - - | } // String returns the string representation of a reference. func (r Reference) String() string { if r.URL != nil { return r.URL.String() } |
︙ |
Changes to box/box.go.
︙ | |||
246 247 248 249 250 251 252 | 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 | - + + + + - + + + - + + | } func (err *ErrNotAllowed) Error() string { if err.User == nil { if err.Zid.IsValid() { return fmt.Sprintf( "operation %q on zettel %v not allowed for not authorized user", |
︙ |
Changes to box/constbox/base.css.
︙ | |||
99 100 101 102 103 104 105 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - - - + - + + + | blockquote p { margin-bottom: .5rem } blockquote cite { font-style: normal } table { border-collapse: collapse; border-spacing: 0; max-width: 100%; } |
︙ | |||
195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | - - - + + + | padding: .5rem 1rem; } .zs-error { background-color: lightpink; border-style: none !important; font-weight: bold; } |
︙ |
Changes to box/constbox/info.mustache.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - - - - - - - - | <ul> {{#LocLinks}} {{#Valid}}<li><a href="{{{Zid}}}">{{Zid}}</a></li>{{/Valid}} {{^Valid}}<li>{{Zid}}</li>{{/Valid}} {{/LocLinks}} </ul> {{/HasLocLinks}} |
︙ |
Changes to box/constbox/listzettel.mustache.
1 2 3 | 1 2 3 4 5 6 | - - - | <header> <h1>{{Title}}</h1> </header> |
Changes to cmd/cmd_run.go.
︙ | |||
61 62 63 64 65 66 67 68 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | + - | ucAuthenticate := usecase.NewAuthenticate(authLog, authManager, authManager, boxManager) ucIsAuth := usecase.NewIsAuthenticated(ucLog, webSrv, authManager) ucCreateZettel := usecase.NewCreateZettel(ucLog, rtConfig, protectedBoxManager) ucGetMeta := usecase.NewGetMeta(protectedBoxManager) ucGetAllMeta := usecase.NewGetAllMeta(protectedBoxManager) ucGetZettel := usecase.NewGetZettel(protectedBoxManager) ucParseZettel := usecase.NewParseZettel(rtConfig, ucGetZettel) ucEvaluate := usecase.NewEvaluate(rtConfig, ucGetZettel, ucGetMeta) ucListMeta := usecase.NewListMeta(protectedBoxManager) |
︙ |
Added cmd/fd_limit.go.
|
Added cmd/fd_limit_raise.go.
|
Changes to cmd/main.go.
︙ | |||
204 205 206 207 208 209 210 211 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | + - + | ok = setConfigValue(ok, kernel.AuthService, kernel.AuthOwner, cfg.GetDefault(keyOwner, "")) ok = setConfigValue(ok, kernel.AuthService, kernel.AuthReadonly, cfg.GetBool(keyReadOnly)) ok = setConfigValue( ok, kernel.BoxService, kernel.BoxDefaultDirType, cfg.GetDefault(keyDefaultDirBoxType, kernel.BoxDirTypeNotify)) ok = setConfigValue(ok, kernel.BoxService, kernel.BoxURIs+"1", "dir:./zettel") format := kernel.BoxURIs + "%v" for i := 1; ; i++ { |
︙ | |||
261 262 263 264 265 266 267 268 269 270 271 272 273 274 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | + + + + + + + | fmt.Fprintf(os.Stderr, "%s: %v\n", name, err) return 2 } kern := kernel.Main var createManager kernel.CreateBoxManagerFunc if command.Boxes { err := raiseFdLimit() if err != nil { logger := kern.GetKernelLogger() logger.IfErr(err).Msg("Raising some limitions did not work") logger.Error().Msg("Prepare to encounter errors. Most of them can be mitigated. See the manual for details") kern.SetConfig(kernel.BoxService, kernel.BoxDefaultDirType, kernel.BoxDirTypeSimple) } createManager = func(boxURIs []*url.URL, authManager auth.Manager, rtConfig config.Config) (box.Manager, error) { compbox.Setup(cfg) return manager.New(boxURIs, authManager, rtConfig) } } else { createManager = func([]*url.URL, auth.Manager, config.Config) (box.Manager, error) { return nil, nil } } |
︙ | |||
299 300 301 302 303 304 305 | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | - + | fmt.Fprintf(os.Stderr, "%s: %v\n", name, err) } kern.Shutdown(true) return exitCode } // runSimple is called, when the user just starts the software via a double click |
︙ |
Changes to docs/development/20210916194900.zettel.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - - | id: 20210916194900 title: Checklist for Release role: zettel syntax: zmk modified: 20220309105459 # Sync with the official repository #* ``fossil sync -u`` |
︙ | |||
30 31 32 33 34 35 36 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + - | # On every platform (esp. macOS), the box with 10.000 zettel must run properly: #* ``./zettelstore -d DIR`` # Update files in directory ''www'' #* index.wiki #* download.wiki #* changes.wiki #* plan.wiki |
︙ |
Changes to docs/manual/00001000000000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + - | id: 00001000000000 title: Zettelstore Manual role: manual tags: #manual #zettelstore syntax: zmk |
Changes to docs/manual/00001004050000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001004050000 title: Command line parameters role: manual tags: #command #configuration #manual #zettelstore syntax: zmk |
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 | - - | === Sub-commands * [[``zettelstore help``|00001004050200]] lists all available sub-commands. * [[``zettelstore version``|00001004050400]] to display version information of Zettelstore. * [[``zettelstore run``|00001004051000]] to start the Zettelstore service. * [[``zettelstore run-simple``|00001004051100]] is typically called, when you start Zettelstore by a double.click in your GUI. * [[``zettelstore file``|00001004051200]] to render files manually without activated/running Zettelstore services. * [[``zettelstore password``|00001004051400]] to calculate data for [[user authentication|00001010040200]]. |
Changes to docs/manual/00001006020000.zettel.
1 2 3 4 5 | 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 | - + - + - - | id: 00001006020000 title: Supported Metadata Keys role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001007000000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001007000000 title: Zettelmarkup role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 | - - + - | However, the Zettelstore supports CommonMark as a zettel syntax, so you can mix both Zettelmarkup zettel and CommonMark zettel in one store to get the best of both worlds. * [[General principles|00001007010000]] * [[Basic definitions|00001007020000]] * [[Block-structured elements|00001007030000]] * [[Inline-structured element|00001007040000]] * [[Attributes|00001007050000]] |
Changes to docs/manual/00001007031100.zettel.
1 2 3 4 5 | 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 | - + - + - + + - - - - - + + + + + + + + + + + + + + + + + + - - - + + + + + | id: 00001007031100 title: Zettelmarkup: Transclusion role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
Deleted docs/manual/00001007031110.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007031140.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001007040000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001007040000 title: Zettelmarkup: Inline-Structured Elements role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 | + + + | Since some Unicode character are used quite often, a special notation is introduced for them: * Two consecutive hyphen-minus characters result in an __en-dash__ character. It is typically used in numeric ranges. ``pages 4--7`` will be rendered in HTML as: ::pages 4--7::{=example}. Alternative specifications are: ``–``, ``&x8211``, and ``–``. * Three consecutive full stop characters (""''.''"", U+002E) after a space result in an horizontal ellipsis character. ``to be continued ... later`` will be rendered in HTML as: ::to be continued, ... later::{=example}. Alternative specifications are: ``…``, ``&x8230``, and ``…``. |
Changes to docs/manual/00001007040310.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + - - - - - - - + - - - - - + + - - + - - | id: 00001007040310 title: Zettelmarkup: Links role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
Changes to docs/manual/00001007040320.zettel.
1 2 3 4 5 | 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 | - + - - + | id: 00001007040320 title: Zettelmarkup: Inline Embedding / Transclusion role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
Added docs/manual/00001007060000.zettel.
|
Deleted docs/manual/00001007700000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007702000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007705000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007706000.zettel.
| - - - - - - - - - - |
|
Deleted docs/manual/00001007780000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007790000.zettel.
| - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007800000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007900000.zettel.
| - - - - - - - - - |
|
Deleted docs/manual/00001007903000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007906000.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001010070200.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001010070200 title: Visibility rules for zettel role: manual tags: #authorization #configuration #manual #security #zettelstore syntax: zmk |
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 | - - - - - + + + + + | In this case, the [[runtime configuration zettel|00001004020000]] is shown (its visibility is ""owner""). The [[startup configuration|00001004010000]] is not shown, because the associated computed zettel with identifier ''00000000000096'' is stored with the visibility ""expert"". If you want to show such a zettel, you must set ''expert-mode'' to true. === Examples Similar to the [[API|00001012051810]], you can easily create a zettel list based on the ''visibility'' metadata key: |
Changes to docs/manual/00001012000000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012000000 title: API role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + | * [[Provide an access token|00001012050600]] when doing an API call === Zettel lists * [[List metadata of all zettel|00001012051200]] * [[Shape the list of zettel metadata|00001012051800]] ** [[Selection of zettel|00001012051810]] ** [[Limit the list length|00001012051830]] |
︙ |
Changes to docs/manual/00001012051800.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + - + | id: 00001012051800 title: API: Shape the list of zettel metadata role: manual tags: #api #manual #zettelstore syntax: zmk |
Changes to docs/manual/00001012051810.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012051810 title: API: Select zettel based on their metadata role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 | - - - | ```sh # curl 'http://127.0.0.1:23123/z?title=API' 00001012921000 API: JSON structure of an access token 00001012920500 Formats available by the API 00001012920000 Endpoints used by the API ... ``` |
Changes to docs/manual/00001012051840.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | - + - + - + + + - + + + - + | id: 00001012051840 |
Changes to docs/manual/00001012051890.zettel.
1 | 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 | - + - + - + - - - + + - + - - - - | id: 00001012051890 |
Changes to docs/manual/00001012053900.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012053900 title: API: Retrieve unlinked references to an existing zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
50 51 52 53 54 55 56 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - + - | you can specify the title phase to be searched for as a query parameter ''_phrase'': ```` # curl 'http://127.0.0.1:23123/u/00001007000000?phrase=markdown' {"id": "00001007000000","meta": {...},"list": [{"id": "00001008010000","meta": {...},"rights":62},{"id": "00001004020000","meta": {...},"rights":62}]} ```` |
︙ |
Changes to docs/manual/00001012070500.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - + | id: 00001012070500 title: Retrieve administrative data |
︙ |
Changes to docs/manual/00001012080100.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - + | id: 00001012080100 title: API: Execute commands |
︙ |
Changes to docs/manual/00001012080200.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - + | id: 00001012080200 title: API: Check for authentication |
︙ |
Changes to docs/manual/00001012080500.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - + | id: 00001012080500 title: API: Refresh internal data |
︙ |
Deleted docs/manual/00001017000000.zettel.
| - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001018000000.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + - + | id: 00001018000000 title: Troubleshooting |
︙ |
Changes to domain/meta/meta_test.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + - + | } } } func TestTitleHeader(t *testing.T) { t.Parallel() m := New(testID) |
︙ |
Changes to domain/meta/parse.go.
︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | + + + + | switch key { case "", api.KeyID: // Empty key and 'id' key will be ignored return } switch Type(key) { case TypeString, TypeZettelmarkup: if v != "" { addData(m, key, v) } case TypeTagSet: addSet(m, key, strings.ToLower(v), func(s string) bool { return s[0] == '#' }) case TypeWord: m.Set(key, strings.ToLower(v)) case TypeWordSet: addSet(m, key, strings.ToLower(v), func(s string) bool { return true }) case TypeID: |
︙ |
Changes to domain/meta/parse_test.go.
︙ | |||
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 | 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 | + + + + + - | for i, tc := range td { m := parseMetaStr(tc.s) if got, ok := m.Get(api.KeyTitle); !ok || got != tc.e { t.Log(m) t.Errorf("TC=%d: expected %q, got %q", i, tc.e, got) } } m := parseMetaStr(api.KeyTitle + ": ") if title, ok := m.Get(api.KeyTitle); ok { t.Errorf("Expected a missing title key, but got %q (meta=%v)", title, m) } } func TestNewFromInput(t *testing.T) { t.Parallel() testcases := []struct { input string exp []meta.Pair }{ {"", []meta.Pair{}}, {" a:b", []meta.Pair{{"a", "b"}}}, {"%a:b", []meta.Pair{}}, {"a:b\r\n\r\nc:d", []meta.Pair{{"a", "b"}}}, {"a:b\r\n%c:d", []meta.Pair{{"a", "b"}}}, {"% a:b\r\n c:d", []meta.Pair{{"c", "d"}}}, {"---\r\na:b\r\n", []meta.Pair{{"a", "b"}}}, {"---\r\na:b\r\n--\r\nc:d", []meta.Pair{{"a", "b"}, {"c", "d"}}}, {"---\r\na:b\r\n---\r\nc:d", []meta.Pair{{"a", "b"}}}, {"---\r\na:b\r\n----\r\nc:d", []meta.Pair{{"a", "b"}}}, |
︙ |
Changes to encoder/encoder_inline_test.go.
︙ | |||
122 123 124 125 126 127 128 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - + | }, }, { descr: "Quotes formatting (german)", zmk: `""quotes""{lang=de}`, expect: expectMap{ encoderZJSON: `[{"":"Quote","a":{"lang":"de"},"i":[{"":"Text","s":"quotes"}]}]`, |
︙ | |||
166 167 168 169 170 171 172 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - + | }, }, { descr: "HTML in Code formatting", zmk: "``<script `` abc", expect: expectMap{ encoderZJSON: `[{"":"Code","s":"<script "},{"":"Space"},{"":"Text","s":"abc"}]`, |
︙ | |||
433 434 435 436 437 438 439 | 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | - - - - - - - - - - - - - - - - - - - - - - | descr: "Relative link", zmk: `[[R|../relative]]`, expect: expectMap{ encoderZJSON: `[{"":"Link","q":"local","s":"../relative","i":[{"":"Text","s":"R"}]}]`, encoderHTML: `<a href="../relative">R</a>`, encoderSexpr: `((LINK-HOSTED () "../relative" (TEXT "R")))`, encoderText: `R`, |
︙ |
Changes to encoder/sexprenc/transform.go.
︙ | |||
303 304 305 306 307 308 309 | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | - | ast.RefStateInvalid: sexpr.SymLinkInvalid, ast.RefStateZettel: sexpr.SymLinkZettel, ast.RefStateSelf: sexpr.SymLinkSelf, ast.RefStateFound: sexpr.SymLinkFound, ast.RefStateBroken: sexpr.SymLinkBroken, ast.RefStateHosted: sexpr.SymLinkHosted, ast.RefStateBased: sexpr.SymLinkBased, |
︙ | |||
395 396 397 398 399 400 401 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | - | ast.RefStateInvalid: sexpr.SymRefStateInvalid, ast.RefStateZettel: sexpr.SymRefStateZettel, ast.RefStateSelf: sexpr.SymRefStateSelf, ast.RefStateFound: sexpr.SymRefStateFound, ast.RefStateBroken: sexpr.SymRefStateBroken, ast.RefStateHosted: sexpr.SymRefStateHosted, ast.RefStateBased: sexpr.SymRefStateBased, |
︙ | |||
455 456 457 458 459 460 461 | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | - + | } func mapGetS[T comparable](m map[T]*sxpf.Symbol, k T) *sxpf.Symbol { if result, found := m[k]; found { return result } log.Println("MISS", k, m) |
︙ |
Changes to encoder/zjsonenc/zjsonenc.go.
︙ | |||
136 137 138 139 140 141 142 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | + - + + + + + + + + + | case *ast.BreakNode: if n.Hard { v.writeNodeStart(zjson.TypeBreakHard) } else { v.writeNodeStart(zjson.TypeBreakSoft) } case *ast.LinkNode: v.writeNodeStart(zjson.TypeLink) |
︙ | |||
353 354 355 356 357 358 359 | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | - - - - - - - - - - - - - - - - - - | ast.RefStateInvalid: zjson.RefStateInvalid, ast.RefStateZettel: zjson.RefStateZettel, ast.RefStateSelf: zjson.RefStateSelf, ast.RefStateFound: zjson.RefStateFound, ast.RefStateBroken: zjson.RefStateBroken, ast.RefStateHosted: zjson.RefStateHosted, ast.RefStateBased: zjson.RefStateBased, |
︙ |
Changes to evaluator/evaluator.go.
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - - | "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/input" "zettelstore.de/z/parser" "zettelstore.de/z/parser/cleaner" "zettelstore.de/z/parser/draw" |
︙ | |||
115 116 117 118 119 120 121 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - - - - | } func transcludeNode(bln *ast.BlockSlice, i int, bn ast.BlockNode) int { if ln, ok := bn.(*ast.BlockSlice); ok { *bln = replaceWithBlockNodes(*bln, i, *ln) return len(*ln) - 1 } |
︙ | |||
189 190 191 192 193 194 195 | 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 | - + - + - - - - + - + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | return makeBlockNode(errText) } switch ref.State { case ast.RefStateZettel: // Only zettel references will be evaluated. case ast.RefStateInvalid, ast.RefStateBroken: e.transcludeCount++ |
︙ | |||
300 301 302 303 304 305 306 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | - - - - | } func embedNode(is *ast.InlineSlice, i int, in ast.InlineNode) int { if ln, ok := in.(*ast.InlineSlice); ok { *is = replaceWithInlineNodes(*is, i, *ln) return len(*ln) - 1 } |
︙ | |||
375 376 377 378 379 380 381 | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | - + - + - - - - + - + | case ast.RefStateZettel: // Only zettel references will be evaluated. case ast.RefStateInvalid, ast.RefStateBroken: e.transcludeCount++ return createInlineErrorImage(en) case ast.RefStateSelf: e.transcludeCount++ |
︙ |
Changes to go.mod.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + - + - + | module zettelstore.de/z |
Changes to go.sum.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - - + + - - + + | codeberg.org/t73fde/sxpf v0.0.0-20220719090054-749a39d0a7a0 h1:viya/OgeF16+i8caBPJmcLQhGpZodPh+/nxtJzSSO1s= codeberg.org/t73fde/sxpf v0.0.0-20220719090054-749a39d0a7a0/go.mod h1:4fAHEF3VH+ofbZkF6NzqiItTNy2X11tVCnZX99jXouA= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/pascaldekloe/jwt v1.12.0 h1:imQSkPOtAIBAXoKKjL9ZVJuF/rVqJ+ntiLGpLyeqMUQ= github.com/pascaldekloe/jwt v1.12.0/go.mod h1:LiIl7EwaglmH1hWThd/AmydNCnHf/mmfluBlNqHbk8U= github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
Changes to input/input.go.
︙ | |||
34 35 36 37 38 39 40 | 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 | - - - + + + - - - - - - - - - - - - + + + + + + + + + + + | inp.Next() return inp } // EOS = End of source const EOS = rune(-1) |
︙ | |||
74 75 76 77 78 79 80 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - - - - - - - - - - - - - - - - - - - | return ' ' } return r } return EOS } |
︙ | |||
118 119 120 121 122 123 124 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - - - + + - | case '\n': inp.Next() } } // SetPos allows to reset the read position. func (inp *Input) SetPos(pos int) { |
︙ |
Changes to input/input_test.go.
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 | - - - - - - - - - - - - - - - - - - - - - - - - - - | got, ok := inp.ScanEntity() if ok { t.Errorf("%d: scanning %q was unexpected successful, got %q", i, tc, got) continue } } } |
Changes to input/runes.go.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - - - - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 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. //----------------------------------------------------------------------------- package input |
Changes to kernel/impl/box.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + - + - | //----------------------------------------------------------------------------- |
︙ | |||
64 65 66 67 68 69 70 71 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | + - + | } } func (ps *boxService) GetLogger() *logger.Logger { return ps.logger } func (ps *boxService) Start(kern *myKernel) error { boxURIs := make([]*url.URL, 0, 4) format := kernel.BoxURIs + "%d" for i := 1; ; i++ { |
︙ | |||
111 112 113 114 115 116 117 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - - - - + + + + - - - - + + + + | func (ps *boxService) GetStatistics() []kernel.KeyValue { var st box.Stats ps.mxService.RLock() ps.manager.ReadStats(&st) ps.mxService.RUnlock() return []kernel.KeyValue{ |
︙ |
Changes to kernel/impl/cfg.go.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + | // under this license. //----------------------------------------------------------------------------- package impl import ( "context" "fmt" "strings" "sync" "zettelstore.de/c/api" "zettelstore.de/z/box" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" |
︙ | |||
95 96 97 98 99 100 101 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + | } func (cs *configService) GetLogger() *logger.Logger { return cs.logger } func (cs *configService) Start(*myKernel) error { cs.logger.Info().Msg("Start Service") data := meta.New(id.ConfigurationZid) for _, kv := range cs.GetNextConfigList() { |
︙ |
Changes to kernel/impl/cmd.go.
︙ | |||
484 485 486 487 488 489 490 | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | - + | descr = descr[:pos] } value := samples[i].Value i++ var sVal string switch value.Kind() { case metrics.KindUint64: |
︙ |
Changes to kernel/impl/config.go.
︙ | |||
81 82 83 84 85 86 87 88 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + - + | defer cfg.mxConfig.Unlock() descr, ok := cfg.descr[key] if !ok { d, baseKey, num := cfg.getListDescription(key) if num < 0 { return false } format := baseKey + "%d" for i := num + 1; ; i++ { |
︙ | |||
179 180 181 182 183 184 185 186 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | + - + | keys := make([]string, 0, len(cfg.descr)) for k, descr := range cfg.descr { if all || descr.canList { if !strings.HasSuffix(k, "-") { keys = append(keys, k) continue } format := k + "%d" for i := 1; ; i++ { |
︙ |
Changes to kernel/impl/web.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 | + | //----------------------------------------------------------------------------- // Copyright (c) 2021-2022 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. //----------------------------------------------------------------------------- package impl import ( "fmt" "net" "strconv" "strings" "sync" "time" "zettelstore.de/z/kernel" |
︙ | |||
128 129 130 131 132 133 134 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | - + | ws.mxService.Unlock() if kern.cfg.GetConfig(kernel.ConfigSimpleMode).(bool) { listenAddr := ws.GetNextConfig(kernel.WebListenAddress).(string) if idx := strings.LastIndexByte(listenAddr, ':'); idx >= 0 { ws.logger.Mandatory().Msg(strings.Repeat("--------------------", 3)) ws.logger.Mandatory().Msg("Open your browser and enter the following URL:") |
︙ |
Changes to logger/message.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + - + - | //----------------------------------------------------------------------------- |
︙ | |||
119 120 121 122 123 124 125 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - - - - - - - - - - - | } } } } return m } |
︙ |
Changes to parser/cleaner/cleaner.go.
︙ | |||
76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + + + + + + + | } func (cv *cleanVisitor) visitMark(mn *ast.MarkNode) { if !cv.doMark { cv.hasMark = true return } // if mn.Mark == "" && len(mn.Inlines) > 0 { // var buf bytes.Buffer // _, err := cv.textEnc.WriteInlines(&buf, &mn.Inlines) // if err == nil { // mn.Mark = buf.String() // } // } if mn.Mark == "" { mn.Slug = "" mn.Fragment = cv.addIdentifier("*", mn) return } if mn.Slug == "" { mn.Slug = strfun.Slugify(mn.Mark) |
︙ | |||
105 106 107 108 109 110 111 | 112 113 114 115 116 117 118 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | return newID } } } cv.ids[id] = node return id } |
Changes to parser/markdown/markdown.go.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - | // Package markdown provides a parser for markdown. package markdown import ( "bytes" "fmt" |
︙ | |||
176 177 178 179 180 181 182 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | - + | func (p *mdP) acceptList(node *gmAst.List) ast.ItemNode { kind := ast.NestedListUnordered var a attrs.Attributes if node.IsOrdered() { kind = ast.NestedListOrdered if node.Start != 1 { |
︙ |
Changes to parser/parser.go.
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - - - - - - - - | // ParseMetadata parses a string as Zettelmarkup, resulting in an inline slice. // Typically used to parse the title or other metadata of type Zettelmarkup. func ParseMetadata(value string) ast.InlineSlice { return ParseInlines(input.NewInput([]byte(value)), api.ValueSyntaxZmk) } |
︙ |
Changes to parser/zettelmark/block.go.
︙ | |||
636 637 638 639 640 641 642 | 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 | - + - - - - | return nil, false } inp := cp.inp posA, posE := inp.Pos, 0 loop: for { switch inp.Ch { |
︙ |
Changes to parser/zettelmark/inline.go.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - | //----------------------------------------------------------------------------- package zettelmark import ( "bytes" "fmt" |
︙ | |||
162 163 164 165 166 167 168 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | - - - - | Attrs: attrs, }, true } } return nil, false } |
︙ | |||
189 190 191 192 193 194 195 | 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 | - + - - - + + - + | if in == nil { break } is = append(is, in) } cp.inp = inp inp.Next() |
︙ | |||
251 252 253 254 255 256 257 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | - - + - - - - | } inp.Next() } } func (cp *zmkP) readReferenceToClose(closeCh rune) bool { inp := cp.inp |
︙ |
Changes to parser/zettelmark/post-processor.go.
︙ | |||
355 356 357 358 359 360 361 362 363 364 365 366 367 368 | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | + | ast.Walk(pp, in) } pp.processInlineSliceHead(is) toPos := pp.processInlineSliceCopy(is) toPos = pp.processInlineSliceTail(is, toPos) *is = (*is)[:toPos:toPos] pp.processInlineSliceInplace(is) } // processInlineSliceHead removes leading spaces and empty text. func (pp *postProcessor) processInlineSliceHead(is *ast.InlineSlice) { ins := *is for i, in := range ins { switch in := in.(type) { |
︙ | |||
470 471 472 473 474 475 476 | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | + + + + + + + + + + + + | return toPos } toPos-- ins[toPos] = nil // Kill node to enable garbage collection } return toPos } func (*postProcessor) processInlineSliceInplace(is *ast.InlineSlice) { for _, in := range *is { if n, ok := in.(*ast.TextNode); ok { if n.Text == "..." { n.Text = "\u2026" } else if len(n.Text) == 4 && strings.IndexByte(",;:!?", n.Text[3]) >= 0 && n.Text[:3] == "..." { n.Text = "\u2026" + n.Text[3:] } } } } |
Changes to parser/zettelmark/zettelmark_test.go.
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + + + - + | {"\\\r\n", ""}, {"\\\r\ndef", "(PARA HB def)"}, {"\\a", "(PARA a)"}, {"\\aa", "(PARA aa)"}, {"a\\a", "(PARA aa)"}, {"\\+", "(PARA +)"}, {"\\ ", "(PARA \u00a0)"}, {"...", "(PARA \u2026)"}, {"...,", "(PARA \u2026,)"}, {"...;", "(PARA \u2026;)"}, {"...:", "(PARA \u2026:)"}, {"...!", "(PARA \u2026!)"}, {"...?", "(PARA \u2026?)"}, {"...-", "(PARA ...-)"}, {"a...b", "(PARA a...b)"}, |
︙ | |||
160 161 162 163 164 165 166 | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - - - | {"[[\\]]]", "(PARA (LINK %5C%5D))"}, {"[[\\]|a]]", "(PARA (LINK a ]))"}, {"[[b\\]|a]]", "(PARA (LINK a b]))"}, {"[[\\]\\||a]]", "(PARA (LINK a ]|))"}, {"[[http://a]]", "(PARA (LINK http://a))"}, {"[[http://a|http://a]]", "(PARA (LINK http://a http://a))"}, {"[[[[a]]]]", "(PARA (LINK [[a) ]])"}, |
︙ |
Deleted search/parser.go.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted search/parser_test.go.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to search/print.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ | |||
22 23 24 25 26 27 28 | 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 | - + - - + - + + - + + - - - - - - - + - - + - - - + + - - + - - - - - - - + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + - - - - - - - + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + - - - + + + - - - + + + - - - + | func (s *Search) String() string { var sb strings.Builder s.Print(&sb) return sb.String() } |
Changes to search/search.go.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - | // under this license. //----------------------------------------------------------------------------- // Package search provides a zettel search. package search import ( |
︙ | |||
58 59 60 61 62 63 64 | 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 | - - - + + + + - - - - - - - - - - - - - - - + + | // Fields to be used for selecting preMatch MetaMatchFunc // Match that must be true mvals expMetaValues // Expected values for a meta datum search []expValue // Search string negate bool // Negate the result of the whole selecting process // Fields to be used for sorting |
︙ | |||
149 150 151 152 153 154 155 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | - - - - - + | func (s *Search) AddExpr(key, value string) *Search { val := parseOp(strings.TrimSpace(value)) if s == nil { s = new(Search) } s.mx.Lock() defer s.mx.Unlock() |
︙ | |||
216 217 218 219 220 221 222 | 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 | + - + + + - + + + - + + - - + + - - + - - + - + - + + | return expValue{value: s[1:], op: cmpContains, negate: negate} } return expValue{value: s, op: cmpDefault, negate: negate} } // SetNegate changes the search to reverse its selection. func (s *Search) SetNegate() *Search { if s == nil { |
︙ | |||
278 279 280 281 282 283 284 | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | + - + + | s.mx.RLock() defer s.mx.RUnlock() return s.offset } // SetLimit sets the given limit of the search object. func (s *Search) SetLimit(limit int) *Search { if s == nil { |
︙ | |||
311 312 313 314 315 316 317 | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - - + - - - - | s.mx.RLock() defer s.mx.RUnlock() for key := range s.mvals { if meta.IsComputed(key) { return true } } |
︙ | |||
422 423 424 425 426 427 428 | 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + - + - + | } if s == nil { sort.Slice(metaList, func(i, j int) bool { return metaList[i].Zid > metaList[j].Zid }) return metaList } |
︙ |
Changes to template/mustache.go.
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | - + + + | } type parseError struct { line int message string } |
︙ |
Changes to tests/client/client_test.go.
︙ | |||
70 71 72 73 74 75 76 | 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 | - + - - - - + - + - - - - | t.Parallel() c := getClient() query := url.Values{api.QueryKeyEncoding: {api.EncodingHTML}} // Client must remove "html" for i, tc := range testdata { t.Run(fmt.Sprintf("User %d/%q", i, tc.user), func(tt *testing.T) { c.SetAuth(tc.user, tc.user) |
︙ |
Changes to tests/client/embed_test.go.
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + | } content, err = c.GetEvaluatedZettel(context.Background(), abc10000Zid, api.EncoderHTML) if err != nil { t.Error(err) return } |
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | - + - - | } content, err := c.GetEvaluatedZettel(context.Background(), abc10Zid, api.EncoderHTML) if err != nil { t.Error(err) return } |
︙ | |||
131 132 133 134 135 136 137 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | - + | for zid, errZid := range recursiveZettel { content, err := c.GetEvaluatedZettel(context.Background(), zid, api.EncoderHTML) if err != nil { t.Error(err) continue } sContent := string(content) |
︙ | |||
165 166 167 168 169 170 171 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | - + | const selfEmbedZid = api.ZettelID("20211020185400") content, err := c.GetEvaluatedZettel(context.Background(), selfEmbedZid, api.EncoderHTML) if err != nil { t.Error(err) return } |
Changes to usecase/authenticate.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + - | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
46 47 48 49 50 51 52 | 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 | - - - - + - + - + - + | token: token, port: port, ucGetUser: NewGetUser(authz, port), } } // Run executes the use case. |
︙ |
Changes to usecase/evaluate.go.
︙ | |||
16 17 18 19 20 21 22 | 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 | - - - + - | "zettelstore.de/z/ast" "zettelstore.de/z/config" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/evaluator" "zettelstore.de/z/parser" |
︙ | |||
59 60 61 62 63 64 65 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - - - - - - - - - - - - | // RunMetadata executes the use case for a metadata value. func (uc *Evaluate) RunMetadata(ctx context.Context, value string) ast.InlineSlice { is := parser.ParseMetadata(value) evaluator.EvaluateInline(ctx, uc, uc.rtConfig, &is) return is } |
Changes to web/adapter/api/get_parsed_zettel.go.
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + | func (a *API) writeEncodedZettelPart( w http.ResponseWriter, zn *ast.ZettelNode, evalMeta encoder.EvalMetaFunc, enc api.EncodingEnum, encStr string, part partType, ) { encdr := encoder.Create(enc) if encdr == nil { |
︙ |
Changes to web/adapter/api/get_zettel_list.go.
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - | Rights: a.getRights(ctx, m), }) } var buf bytes.Buffer err = encodeJSONData(&buf, api.ZettelListJSON{ Query: s.String(), |
︙ |
Changes to web/adapter/api/login.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + | err := a.writeJSONToken(w, "freeaccess", 24*366*10*time.Hour) a.log.IfErr(err).Msg("Login/free") return } var token []byte if ident, cred := retrieveIdentCred(r); ident != "" { var err error |
︙ |
Changes to web/adapter/request.go.
︙ | |||
48 49 50 51 52 53 54 | 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 | - - - - + + | } } return 0, false } // GetSearch retrieves the specified search and sorting options from a query. func GetSearch(q url.Values) (s *search.Search) { |
︙ |
Changes to web/adapter/webui/create_zettel.go.
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + | m := origZettel.Meta title := parser.ParseMetadata(m.GetTitle()) textTitle, err2 := encodeInlinesText(&title, wui.gentext) if err2 != nil { wui.reportError(ctx, w, err2) return } |
︙ |
Changes to web/adapter/webui/get_info.go.
︙ | |||
74 75 76 77 78 79 80 | 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 | - + - - - - - - + | func(val string) ast.InlineSlice { return evaluate.RunMetadata(ctx, val) }, enc) metaData[i] = metaDataInfo{p.Key, buf.String()} } summary := collect.References(zn) |
︙ | |||
123 124 125 126 127 128 129 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - - | CanRename bool RenameURL string CanDelete bool DeleteURL string MetaData []metaDataInfo HasLocLinks bool LocLinks []localLink |
︙ | |||
153 154 155 156 157 158 159 | 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 | - - - + - + - + - + - - + | CanRename: wui.canRename(ctx, user, zn.Meta), RenameURL: wui.NewURLBuilder('b').SetZid(apiZid).String(), CanDelete: wui.canDelete(ctx, user, zn.Meta), DeleteURL: wui.NewURLBuilder('d').SetZid(apiZid).String(), MetaData: metaData, HasLocLinks: len(locLinks) > 0, LocLinks: locLinks, |
︙ |
Changes to web/adapter/webui/get_zettel.go.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - + - + - - + | if err != nil { wui.reportError(ctx, w, err) return } enc := wui.createZettelEncoder() |
︙ |
Changes to web/adapter/webui/htmlgen.go.
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - | "zettelstore.de/c/html" "zettelstore.de/c/sexpr" "zettelstore.de/z/ast" "zettelstore.de/z/domain/meta" "zettelstore.de/z/encoder" "zettelstore.de/z/encoder/sexprenc" "zettelstore.de/z/encoder/textenc" |
︙ | |||
51 52 53 54 55 56 57 | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - | env: env, } env.Builtins.Set(sexpr.SymTag, sxpf.NewBuiltin("tag", true, 0, -1, gen.generateTag)) env.Builtins.Set(sexpr.SymLinkZettel, sxpf.NewBuiltin("linkZ", true, 2, -1, gen.generateLinkZettel)) env.Builtins.Set(sexpr.SymLinkFound, sxpf.NewBuiltin("linkZ", true, 2, -1, gen.generateLinkZettel)) env.Builtins.Set(sexpr.SymLinkBased, sxpf.NewBuiltin("linkB", true, 2, -1, gen.generateLinkBased)) |
︙ | |||
130 131 132 133 134 135 136 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - + - + | g.env.WriteEndnotes() } g.env.ReplaceWriter(nil) return buf.String(), g.env.GetError() } // InlinesString writes an inline slice to the writer |
︙ | |||
170 171 172 173 174 175 176 | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | - - - - - - - - - - | return nil, nil } func (g *htmlGenerator) generateLinkBased(senv sxpf.Environment, args *sxpf.Pair, _ int) (sxpf.Value, error) { env := senv.(*html.EncEnvironment) if a, refValue, ok := html.PrepareLink(env, args); ok { u := g.builder.NewURLBuilder('/').SetRawLocal(refValue) |
︙ |
Changes to web/adapter/webui/htmlmeta.go.
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | case meta.TypeURL: writeURL(w, value) case meta.TypeWord: wui.writeWord(w, key, value) case meta.TypeWordSet: wui.writeWordSet(w, key, meta.ListFromValue(value)) case meta.TypeZettelmarkup: |
︙ | |||
167 168 169 170 171 172 173 174 175 | 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 | + + + + + + + + + + + + + - + - + - + | return "", -1 } return "", 0 } return wui.encodeTitleAsText(ctx, m, evaluate), 1 } } func encodeTitleAsHTML( ctx context.Context, m *meta.Meta, evaluate *usecase.Evaluate, gen *htmlGenerator, noLink bool, ) string { plainTitle := m.GetTitle() return encodeZmkMetadata( plainTitle, func(val string) ast.InlineSlice { return evaluate.RunMetadata(ctx, val) }, gen, noLink) } func (wui *WebUI) encodeTitleAsText(ctx context.Context, m *meta.Meta, evaluate *usecase.Evaluate) string { plainTitle := m.GetTitle() |
Changes to web/adapter/webui/lists.go.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + - | // under this license. //----------------------------------------------------------------------------- package webui import ( "bytes" "context" "net/http" "net/url" "sort" "strconv" "zettelstore.de/c/api" |
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | 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 | + + - + - - + - - - + - + - - - - + | func (wui *WebUI) renderZettelList( w http.ResponseWriter, r *http.Request, listMeta usecase.ListMeta, evaluate *usecase.Evaluate, ) { query := r.URL.Query() s := adapter.GetSearch(query) ctx := r.Context() title := wui.listTitleSearch(s) if !s.EnrichNeeded() { ctx = box.NoEnrichContext(ctx) } metaList, err := listMeta.Run(ctx, s) if err != nil { wui.reportError(ctx, w, err) return } user := wui.getUser(ctx) |
︙ | |||
201 202 203 204 205 206 207 | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | - + | limit := getIntParameter(q, api.QueryKeyLimit, 200) metaList, err := getContext.Run(ctx, zid, dir, depth, limit) if err != nil { wui.reportError(ctx, w, err) return } apiZid := api.ZettelID(zid.String()) |
︙ | |||
249 250 251 252 253 254 255 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | - + - + - + | } func (wui *WebUI) listTitleSearch(s *search.Search) string { if s == nil { return wui.rtConfig.GetSiteName() } var buf bytes.Buffer |
Changes to web/adapter/webui/login.go.
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + | } ctx := r.Context() ident, cred, ok := adapter.GetCredentialsViaForm(r) if !ok { wui.reportError(ctx, w, adapter.NewErrBadRequest("Unable to read login form")) return } |
︙ |
Changes to web/adapter/webui/webui.go.
︙ | |||
332 333 334 335 336 337 338 | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - - + + | if err2 != nil { continue } if !wui.policy.CanRead(user, m) { continue } title := m.GetTitle() |
︙ |
Changes to web/server/impl/router.go.
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - + - + | rt.mux.Handle(pattern, handler) } func (rt *httpRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Something may panic. Ensure a kernel log. defer func() { if reco := recover(); reco != nil { |
︙ | |||
173 174 175 176 177 178 179 | 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 | - + - + - + - + + + + + + + + | if rt.ur == nil { // No auth needed return r } k := auth.KindJSON t := getHeaderToken(r) if len(t) == 0 { |
︙ |
Changes to www/changes.wiki.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <title>Change Log</title> |
︙ |
Changes to www/download.wiki.
1 2 3 4 5 6 7 8 9 10 11 | 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 | - + - - - - - + + + + + - + | <title>Download</title> <h1>Download of Zettelstore Software</h1> <h2>Foreword</h2> * Zettelstore is free/libre open source software, licensed under EUPL-1.2-or-later. * The software is provided as-is. * There is no guarantee that it will not damage your system. * However, it is in use by the main developer since March 2020 without any damage. * It may be useful for you. It is useful for me. * Take a look at the [https://zettelstore.de/manual/|manual] to know how to start and use it. <h2>ZIP-ped Executables</h2> |
Changes to www/index.wiki.
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + - + - - - - - + + + + + | [https://zettelstore.de/client|Zettelstore Client] provides client software to access Zettelstore via its API more easily, [https://zettelstore.de/contrib|Zettelstore Contrib] contains contributed software, which often connects to Zettelstore via its API. Some of the software packages may be experimental. |
︙ |
Changes to www/plan.wiki.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + | <title>Limitations and planned improvements</title> Here is a list of some shortcomings of Zettelstore. They are planned to be solved. <h3>Serious limitations</h3> * Content with binary data (e.g. a GIF, PNG, or JPG file) cannot be created nor modified via the standard web interface. As a workaround, you should put your file into the directory where your zettel are stored. Make sure that the file name starts with unique 14 digits that make up the zettel identifier. * Automatic lists are not supported in Zettelmarkup. * … <h3>Smaller limitations</h3> * Quoted attribute values are not yet supported in Zettelmarkup: <code>{key="value with space"}</code>. * The horizontal tab character (<tt>U+0009</tt>) is not supported. * Missing support for citation keys. |
︙ |