Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.5.1 To v0.4
2022-08-02
| ||
10:06 | Merge changes from release 0.5.1 ... (check-in: ad7c201f7e user: stern tags: trunk) | |
09:27 | Version 0.5.1 ... (Leaf check-in: e10f2a270d user: stern tags: release, v0.5.1, release-0.5) | |
09:09 | Add IP address when logging about some auth problems ... (check-in: b6687c0706 user: stern tags: release-0.5) | |
2022-03-10
| ||
13:20 | Increase version to 0.5-dev to begin next development cycle ... (check-in: 73f6c7eb13 user: stern tags: trunk) | |
2022-03-09
| ||
14:06 | Version 0.4 ... (check-in: 54ed47f372 user: stern tags: trunk, release, v0.4) | |
13:54 | Update release checklist ... (check-in: 711a670d7a user: stern tags: trunk) | |
Changes to VERSION.
| 1 | - + |
|
Changes to ast/ast.go.
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | + + + + + + + | type DescriptionSlice []DescriptionNode // InlineNode is the interface that all inline nodes must implement. type InlineNode interface { Node inlineNode() } // InlineEmbedNode is a node that specifies some embeddings in inline mode. // It is abstract, b/c there are different concrete type implementations. type InlineEmbedNode interface { InlineNode inlineEmbedNode() } // Reference is a reference to external or internal material. type Reference struct { URL *url.URL Value string State RefState } |
︙ |
Changes to ast/block.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 ast |
︙ | |||
51 52 53 54 55 56 57 58 | 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 | + + + - - + + + + - + + + - + - + - - - - - - - - + - + | Inlines InlineSlice } func (*ParaNode) blockNode() { /* Just a marker */ } func (*ParaNode) itemNode() { /* Just a marker */ } func (*ParaNode) descriptionNode() { /* Just a marker */ } // NewParaNode creates an empty ParaNode. func NewParaNode() *ParaNode { return &ParaNode{} } // CreateParaNode creates a parameter block from inline nodes. |
︙ | |||
126 127 128 129 130 131 132 | 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 | - + - + - + + + - + - + | } //-------------------------------------------------------------------------- // HeadingNode stores the heading text and level. type HeadingNode struct { Level int |
︙ |
Changes to ast/inline.go.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | //----------------------------------------------------------------------------- package ast import ( "unicode/utf8" |
︙ | |||
96 97 98 99 100 101 102 | 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 | - - + + - - + + - + + - + + + - + - + - + + - + + + - + - + + + | // WalkChildren does nothing. func (*BreakNode) WalkChildren(Visitor) { /* No children*/ } // -------------------------------------------------------------------------- // LinkNode contains the specified link. type LinkNode struct { |
︙ | |||
179 180 181 182 183 184 185 | 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 | - + - + + + - + - + - + + + - + - + - | } } // -------------------------------------------------------------------------- // FootnoteNode contains the specified footnote. type FootnoteNode struct { |
Changes to ast/ref.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ |
Changes to ast/ref_test.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ |
Changes to ast/walk.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ |
Changes to ast/walk_test.go.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | //----------------------------------------------------------------------------- package ast_test import ( "testing" |
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - + | }, &ast.ParaNode{ Inlines: ast.CreateInlineSliceFromWords("This", "is", "some", "intermediate", "text."), }, ast.CreateParaNode( &ast.FormatNode{ Kind: ast.FormatEmph, |
︙ |
Changes to auth/impl/impl.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ |
Changes to box/constbox/base.css.
︙ | |||
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | 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 | + + - + - + + - + | clear: both; visibility: hidden; } main form div { margin: .5em 0 0 0 } input { font-family: monospace } input[type="submit"],button,select { font: inherit } label { font-family: sans-serif; font-size:.9rem } label::after { content:":" } textarea { font-family: monospace; resize: vertical; width: 100%; } .zs-input { padding: .5em; display:block; border:none; border-bottom:1px solid #ccc; width:100%; } .zs-button { |
︙ |
Changes to box/constbox/base.mustache.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - - - - |
|
︙ | |||
56 57 58 59 60 61 62 | 52 53 54 55 56 57 58 59 60 61 62 63 | - + - - - + + + + | <form action="{{{SearchURL}}}"> <input type="text" placeholder="Search.." name="{{QueryKeySearch}}"> </form> </nav> <main class="content"> {{{Content}}} </main> |
Changes to box/constbox/constbox.go.
︙ | |||
291 292 293 294 295 296 297 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - - - - - - - - - + | constHeader{ api.KeyTitle: "Zettelstore User CSS", api.KeyRole: api.ValueRoleConfiguration, api.KeySyntax: "css", api.KeyVisibility: api.ValueVisibilityPublic, }, domain.NewContent([]byte("/* User-defined CSS */"))}, |
︙ |
Changes to box/constbox/delete.mustache.
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 | - + | {{/HasUselessFiles}} <dl> {{#MetaPairs}} <dt>{{Key}}:</dt><dd>{{Value}}</dd> {{/MetaPairs}} </dl> <form method="POST"> |
Changes to box/constbox/form.mustache.
1 2 3 4 5 6 | 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 | - - + + - - + + - - - - - - - - - + + - - + + - - + + - - - - - - - + - - + + - - + - - | <article> <header> <h1>{{Heading}}</h1> </header> <form method="POST"> <div> |
Changes to box/constbox/login.mustache.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - + - + | <article> <header> <h1>{{Title}}</h1> </header> {{#Retry}} <div class="zs-indication zs-error">Wrong user name / password. Try again.</div> {{/Retry}} <form method="POST" action=""> <div> |
Changes to box/constbox/rename.mustache.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + | {{/HasUselessFiles}} <form method="POST"> <div> <label for="newid">New zettel id</label> <input class="zs-input" type="text" id="newzid" name="newzid" placeholder="ZID.." value="{{Zid}}" autofocus> </div> <input type="hidden" id="curzid" name="curzid" value="{{Zid}}"> |
Changes to box/dirbox/dirbox.go.
︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + | "context" "errors" "net/url" "os" "path/filepath" "sync" "zettelstore.de/c/api" "zettelstore.de/z/box" "zettelstore.de/z/box/manager" "zettelstore.de/z/box/notify" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/kernel" |
︙ | |||
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 | 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 | + + | if !entry.IsValid() { return domain.Zettel{}, box.ErrNotFound } m, c, err := dp.srvGetMetaContent(ctx, entry, zid) if err != nil { return domain.Zettel{}, err } dp.cleanupMeta(m) zettel := domain.Zettel{Meta: m, Content: domain.NewContent(c)} dp.log.Trace().Zid(zid).Msg("GetZettel") return zettel, nil } func (dp *dirBox) GetMeta(ctx context.Context, zid id.Zid) (*meta.Meta, error) { m, err := dp.doGetMeta(ctx, zid) dp.log.Trace().Zid(zid).Err(err).Msg("GetMeta") return m, err } func (dp *dirBox) doGetMeta(ctx context.Context, zid id.Zid) (*meta.Meta, error) { entry := dp.dirSrv.GetDirEntry(zid) if !entry.IsValid() { return nil, box.ErrNotFound } m, err := dp.srvGetMeta(ctx, entry, zid) if err != nil { return nil, err } dp.cleanupMeta(m) return m, nil } func (dp *dirBox) ApplyZid(_ context.Context, handle box.ZidFunc, constraint search.RetrievePredicate) error { entries := dp.dirSrv.GetDirEntries(constraint) dp.log.Trace().Int("entries", int64(len(entries))).Msg("ApplyZid") for _, entry := range entries { |
︙ | |||
274 275 276 277 278 279 280 281 282 283 284 285 286 287 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | + | // The following loop could be parallelized if needed for performance. for _, entry := range entries { m, err := dp.srvGetMeta(ctx, entry, entry.Zid) if err != nil { dp.log.Trace().Err(err).Msg("ApplyMeta/getMeta") return err } dp.cleanupMeta(m) dp.cdata.Enricher.Enrich(ctx, m, dp.number) handle(m) } return nil } func (dp *dirBox) CanUpdateZettel(context.Context, domain.Zettel) bool { |
︙ | |||
393 394 395 396 397 398 399 | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | + + + + + + + + + | } func (dp *dirBox) ReadStats(st *box.ManagedBoxStats) { st.ReadOnly = dp.readonly st.Zettel = dp.dirSrv.NumDirEntries() dp.log.Trace().Int("zettel", int64(st.Zettel)).Msg("ReadStats") } func (dp *dirBox) cleanupMeta(m *meta.Meta) { if role, ok := m.Get(api.KeyRole); !ok || role == "" { m.Set(api.KeyRole, dp.cdata.Config.GetDefaultRole()) } if syntax, ok := m.Get(api.KeySyntax); !ok || syntax == "" { m.Set(api.KeySyntax, dp.cdata.Config.GetDefaultSyntax()) } } |
Changes to box/dirbox/service.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ |
Changes to box/filebox/filebox.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2021-2022 Detlef Stern // |
︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | 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 | + + + + + | } return ext } // CalcDefaultMeta returns metadata with default values for the given entry. func CalcDefaultMeta(zid id.Zid, ext string) *meta.Meta { m := meta.New(zid) m.Set(api.KeyTitle, zid.String()) m.Set(api.KeySyntax, calculateSyntax(ext)) return m } // CleanupMeta enhances the given metadata. func CleanupMeta(m *meta.Meta, zid id.Zid, ext string, inMeta bool, uselessFiles []string) { if title, ok := m.Get(api.KeyTitle); !ok || title == "" { m.Set(api.KeyTitle, zid.String()) } if inMeta { if syntax, ok := m.Get(api.KeySyntax); !ok || syntax == "" { dm := CalcDefaultMeta(zid, ext) syntax, ok = dm.Get(api.KeySyntax) if !ok { panic("Default meta must contain syntax") } |
︙ |
Changes to box/filebox/zipbox.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2021-2022 Detlef Stern // |
︙ |
Changes to box/manager/manager.go.
︙ | |||
11 12 13 14 15 16 17 18 19 20 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + - | // Package manager coordinates the various boxes and indexes of a Zettelstore. package manager import ( "context" "io" "net/url" "sort" "sync" "time" |
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + + + + + + + + | if _, ok := registry[scheme]; ok { panic(scheme) } registry[scheme] = create } // GetSchemes returns all registered scheme, ordered by scheme string. |
︙ |
Changes to box/manager/memstore/memstore.go.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - | "fmt" "io" "sort" "strings" "sync" "zettelstore.de/c/api" |
︙ | |||
587 588 589 590 591 592 593 | 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | + + + + + - + | } func dumpStringRefs(w io.Writer, title, preString, postString string, srefs stringRefs) { if len(srefs) == 0 { return } fmt.Fprintln(w, "====", title) slice := make([]string, 0, len(srefs)) for s := range srefs { slice = append(slice, s) } sort.Strings(slice) |
Changes to box/notify/directory_test.go.
︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | + | import ( "testing" "zettelstore.de/c/api" "zettelstore.de/z/domain/id" _ "zettelstore.de/z/parser/blob" // Allow to use BLOB parser. _ "zettelstore.de/z/parser/draw" // Allow to use draw parser. _ "zettelstore.de/z/parser/markdown" // Allow to use markdown parser. _ "zettelstore.de/z/parser/none" // Allow to use none parser. _ "zettelstore.de/z/parser/plain" // Allow to use plain parser. _ "zettelstore.de/z/parser/zettelmark" // Allow to use zettelmark parser. ) func TestSeekZid(t *testing.T) { |
︙ | |||
44 45 46 47 48 49 50 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - + | } } } func TestNewExtIsBetter(t *testing.T) { extVals := []string{ // Main Formats |
︙ |
Changes to box/notify/entry.go.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
95 96 97 98 99 100 101 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | - + | } func calcContentExt(syntax string, yamlSep bool, getZettelFileSyntax func() []string) string { if yamlSep { return extZettel } switch syntax { |
︙ |
Changes to cmd/cmd_file.go.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + + + | domain.Zettel{ Meta: m, Content: domain.NewContent(inp.Src[inp.Pos:]), }, m.GetDefault(api.KeySyntax, api.ValueSyntaxZmk), nil, ) |
︙ |
Changes to cmd/cmd_run.go.
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + | "zettelstore.de/z/web/adapter/webui" "zettelstore.de/z/web/server" ) // ---------- Subcommand: run ------------------------------------------------ func flgRun(fs *flag.FlagSet) { |
︙ | |||
63 64 65 66 67 68 69 | 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 | - - + - + - + - + + | 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) |
︙ |
Changes to cmd/command.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 | - + - + + - | //----------------------------------------------------------------------------- |
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - + + + + + + + + | // Get returns the command identified by the given name and a bool to signal success. func Get(name string) (Command, bool) { cmd, ok := commands[name] return cmd, ok } // List returns a sorted list of all registered command names. |
Changes to cmd/main.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 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 | - + - - + + + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
59 60 61 62 63 64 65 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | Func: runFunc, Boxes: true, Header: true, LineServer: true, SetFlags: flgRun, }) RegisterCommand(Command{ |
︙ | |||
83 84 85 86 87 88 89 | 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 | - + + - + - - - + - - - - - + + + - - - - - - - - - - - - - + | }) RegisterCommand(Command{ Name: "password", Func: cmdPassword, }) } |
︙ | |||
170 171 172 173 174 175 176 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - | const ( keyAdminPort = "admin-port" keyDebug = "debug-mode" keyDefaultDirBoxType = "default-dir-box-type" keyInsecureCookie = "insecure-cookie" keyListenAddr = "listen-addr" keyLogLevel = "log-level" |
︙ | |||
220 221 222 223 224 225 226 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | - - - | ok = setConfigValue( ok, kernel.WebService, kernel.WebListenAddress, cfg.GetDefault(keyListenAddr, "127.0.0.1:23123")) ok = setConfigValue(ok, kernel.WebService, kernel.WebURLPrefix, cfg.GetDefault(keyURLPrefix, "/")) ok = setConfigValue(ok, kernel.WebService, kernel.WebSecureCookie, !cfg.GetBool(keyInsecureCookie)) ok = setConfigValue(ok, kernel.WebService, kernel.WebPersistentCookie, cfg.GetBool(keyPersistentCookie)) |
︙ | |||
277 278 279 280 281 282 283 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - - - - - - - + | compbox.Setup(cfg) return manager.New(boxURIs, authManager, rtConfig) } } else { createManager = func([]*url.URL, auth.Manager, config.Config) (box.Manager, error) { return nil, nil } } |
︙ | |||
309 310 311 312 313 314 315 | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | - - - - + - - + - - - - - - - - - - - - - - - - - - - - - - | kern.Shutdown(true) return exitCode } // runSimple is called, when the user just starts the software via a double click // or via a simple call ``./zettelstore`` on the command line. func runSimple() int { |
Changes to cmd/register.go.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + + | import ( _ "zettelstore.de/z/box/compbox" // Allow to use computed box. _ "zettelstore.de/z/box/constbox" // Allow to use global internal box. _ "zettelstore.de/z/box/dirbox" // Allow to use directory box. _ "zettelstore.de/z/box/filebox" // Allow to use file box. _ "zettelstore.de/z/box/membox" // Allow to use in-memory box. _ "zettelstore.de/z/encoder/htmlenc" // Allow to use HTML encoder. |
Changes to config/config.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 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 | + + + + + + + + + + + + | // Config allows to retrieve all defined configuration values that can be changed during runtime. type Config interface { AuthConfig // AddDefaultValues enriches the given meta data with its default values. AddDefaultValues(m *meta.Meta) *meta.Meta // GetDefaultTitle returns the current value of the "default-title" key. GetDefaultTitle() string // GetDefaultRole returns the current value of the "default-role" key. GetDefaultRole() string // GetDefaultSyntax returns the current value of the "default-syntax" key. GetDefaultSyntax() string // GetDefaultLang returns the current value of the "default-lang" key. GetDefaultLang() string // GetSiteName returns the current value of the "site-name" key. GetSiteName() string // GetHomeZettel returns the value of the "home-zettel" key. GetHomeZettel() id.Zid // GetDefaultVisibility returns the default value for zettel visibility. GetDefaultVisibility() meta.Visibility // GetMaxTransclusions return the maximum number of indirect transclusions. GetMaxTransclusions() int // GetYAMLHeader returns the current value of the "yaml-header" key. GetYAMLHeader() bool |
︙ | |||
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | // GetExpertMode returns the current value of the "expert-mode" key. GetExpertMode() bool // GetVisibility returns the visibility value of the metadata. GetVisibility(m *meta.Meta) meta.Visibility } // GetTitle returns the value of the "title" key of the given meta. If there // is no such value, GetDefaultTitle is returned. func GetTitle(m *meta.Meta, cfg Config) string { if val, ok := m.Get(api.KeyTitle); ok { return val } if cfg != nil { return cfg.GetDefaultTitle() } return "Untitled" } // GetRole returns the value of the "role" key of the given meta. If there // is no such value, GetDefaultRole is returned. func GetRole(m *meta.Meta, cfg Config) string { if val, ok := m.Get(api.KeyRole); ok { return val } return cfg.GetDefaultRole() } // GetSyntax returns the value of the "syntax" key of the given meta. If there // is no such value, GetDefaultSyntax is returned. func GetSyntax(m *meta.Meta, cfg Config) string { if val, ok := m.Get(api.KeySyntax); ok { return val } return cfg.GetDefaultSyntax() } // GetLang returns the value of the "lang" key of the given meta. If there is // no such value, GetDefaultLang is returned. func GetLang(m *meta.Meta, cfg Config) string { if val, ok := m.Get(api.KeyLang); ok { return val } return cfg.GetDefaultLang() } |
Changes to docs/manual/00001003305000.zettel.
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + | All you have to do is to open your web browser, enter the appropriate URL, and there you go. On the negative side, you will not be notified when you enter the wrong data in the Task scheduler and Zettelstore fails to start. This can be mitigated by first using the command line prompt to start Zettelstore with the appropriate options. Once everything works, you can register Zettelstore to be automatically started by the task scheduler. There you should make sure that you have followed the first steps as described on the [[parent page|00001003300000]]. |
︙ |
Changes to docs/manual/00001003310000.zettel.
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + | === Launch Agent If you want to execute Zettelstore automatically and less visible, and if you know a little bit about working in the terminal application, then you could try to run Zettelstore under the control of the [[Launchd system|https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/Introduction.html]]. First, you have to create a description for ""Launchd"". This is a text file named ''zettelstore.plist'' with the following content. |
︙ |
Changes to docs/manual/00001004010000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001004010000 title: Zettelstore startup configuration role: manual tags: #configuration #manual #zettelstore syntax: zmk |
︙ | |||
57 58 59 60 61 62 63 | 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 | - - - - - - - - - - - - - | ; [!log-level|''log-level''] : Specify the global [[logging level|00001004059700]] for the whole application, overwriting the level ""debug"" set by configuration [[''debug-mode''|#debug-mode]]. Can be changed at runtime, even for specific internal services, with the ''log-level'' command of the [[administrator console|00001004101000#log-level]]. Default: ""info"". When you are familiar to operate the Zettelstore, you might set the level to ""warn"" or ""error"" to receive less noisy messages from the Zettelstore. |
︙ |
Changes to docs/manual/00001004011400.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 | - + - + | id: 00001004011400 title: Configure file directory boxes role: manual tags: #configuration #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001004020000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001004020000 title: Configure the running Zettelstore role: manual tags: #configuration #manual #zettelstore syntax: zmk |
︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 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 | + + + + + + + + + + + | This value is also used to specify the language for all non-zettel content, e.g. lists or search results. Use values according to the language definition of [[RFC-5646|https://tools.ietf.org/html/rfc5646]]. ; [!default-license|''default-license''] : License value to be used when rendering content. Can be overwritten in a zettel with [[meta key|00001006020000]] ''license''. Default: (the empty string). ; [!default-role|''default-role''] : Role to be used, if a zettel specifies no ''role'' [[meta key|00001006020000]]. Default: ""zettel"". ; [!default-syntax|''default-syntax''] : Syntax to be used, if a zettel specifies no ''syntax'' [[meta key|00001006020000]]. Default: ""zmk"" (""[[Zettelmarkup|00001007000000]]""). ; [!default-title|''default-title''] : Title to be used, if a zettel specifies no ''title'' [[meta key|00001006020000]]. Default: ""Untitled"". You can use all [[inline-structured elements|00001007040000]] of Zettelmarkup. ; [!default-visibility|''default-visibility''] : Visibility to be used, if zettel does not specify a value for the [[''visibility''|00001006020000#visibility]] metadata key. Default: ""login"". ; [!expert-mode|''expert-mode''] : If set to a [[boolean true value|00001006030500]], all zettel with [[visibility ""expert""|00001010070200]] will be shown (to the owner, if [[authentication is enabled|00001010040100]]; to all, otherwise). This affects most computed zettel. Default: ""False"". |
︙ |
Changes to docs/manual/00001004051000.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 | - + - + | id: 00001004051000 title: The ''run'' sub-command role: manual tags: #command #configuration #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001004051100.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 | - + - - - - - + | id: 00001004051100 title: The ''run-simple'' sub-command role: manual tags: #command #configuration #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001004051200.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: 00001004051200 title: The ''file'' sub-command role: manual tags: #command #configuration #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001004100000.zettel.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 | - + | In fact, the administrator console is __not__ a full telnet service. It is merely a simple line-oriented service where each input line is interpreted separately. Therefore, you can also use tools like [[netcat|https://nc110.sourceforge.io/]], [[socat|http://www.dest-unreach.org/socat/]], etc. After connecting to the administrator console, there is no further authentication. It is not needed because you must be logged in on the same computer where Zettelstore is running. You cannot connect to the administrator console if you are on a different computer. |
Changes to docs/manual/00001005000000.zettel.
︙ | |||
42 43 44 45 46 47 48 | 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 | - + - + | # the empty file extension is used, when the content must be stored in its own file, e.g. image data; in this case, the filename just the 14 digits of the zettel identifier, and optional characters except the period ''"."''. Other filename extensions are used to determine the ""syntax"" of a zettel. This allows to use other content within the Zettelstore, e.g. images or HTML templates. For example, you want to store an important figure in the Zettelstore that is encoded as a ''.png'' file. Since each zettel contains some metadata, e.g. the title of the figure, the question arises where these data should be stores. |
︙ |
Changes to docs/manual/00001005090000.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 38 39 40 41 42 43 | - + - + - | id: 00001005090000 title: List of predefined zettel role: manual tags: #manual #reference #zettelstore syntax: zmk |
Changes to docs/manual/00001006000000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001006000000 title: Layout of a Zettel role: manual tags: #design #manual #zettelstore syntax: zmk |
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 | - + - - - - - - - - - - - - - - - - - - - | The zettel content is your valuable content. Zettelstore contains some predefined parsers that interpret the zettel content to the syntax of the zettel. This includes markup languages, like [[Zettelmarkup|00001007000000]] and [[CommonMark|00001008010500]]. Other text formats are also supported, like CSS and HTML templates. Plain text content is always Unicode, encoded as UTF-8. Other character encodings are not supported and will never be[^This is not a real problem, since every modern software should support UTF-8 as an encoding.]. |
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 | - + - + | id: 00001006020000 title: Supported Metadata Keys role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ | |||
68 69 70 71 72 73 74 | 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 | - + - + - + | ; [!read-only|''read-only''] : Marks a zettel as read-only. The interpretation of [[supported values|00001006020400]] for this key depends, whether authentication is [[enabled|00001010040100]] or not. ; [!role|''role''] : Defines the role of the zettel. Can be used for selecting zettel. See [[supported zettel roles|00001006020100]]. |
︙ |
Changes to docs/manual/00001006020100.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + - + + | id: 00001006020100 title: Supported Zettel Roles role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001006036000.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 | - + - + | id: 00001006036000 title: WordSet Key Type role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
Changes to docs/manual/00001006055000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001006055000 title: Reserved zettel identifier role: manual tags: #design #manual #zettelstore syntax: zmk |
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 | - | | 00009000000000 | 0000999999999 | Reserved for applications This list may change in the future. ==== External Applications |= From | To | Description | 00009000001000 | 00009000001999 | [[Zettel Presenter|https://zettelstore.de/contrib]], an application to display zettel as a HTML-based slideshow |
Changes to docs/manual/00001007000000.zettel.
1 2 3 4 5 6 7 8 9 10 | 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: 00001007000000 title: Zettelmarkup role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk modified: 20220113185501 Zettelmarkup is a rich plain-text based markup language for writing zettel content. Besides the zettel content, Zettelmarkup is also used for specifying the title of a zettel, regardless of the syntax of a zettel. |
︙ |
Changes to docs/manual/00001007010000.zettel.
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + | Some inline elements do not follow the rule of two identical character, especially to specify [[footnotes|00001007040330]], [[citation keys|00001007040340]], and local marks. These elements begin with one opening square bracket (""``[``""), use a character for specifying the kind of the inline, typically allow to specify some content, and end with one closing square bracket (""``]``""). One inline element that does not begin with two characters is the ""entity"". It allows to specify any Unicode character. The specification of that character is put between an ampersand character and a semicolon: ``&...;``{=zmk}. |
︙ |
Changes to docs/manual/00001007030000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001007030000 title: Zettelmarkup: Block-Structured Elements role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - - | Additionally, all other blocks elements are allowed in line-range blocks. * [[Verbatim blocks|00001007030500]] do not interpret their content, * [[Quotation blocks|00001007030600]] specify a block-length quotations, * [[Verse blocks|00001007030700]] allow to enter poetry, lyrics and similar text, where line endings are important, * [[Region blocks|00001007030800]] just mark regions, e.g. for common formatting, * [[Comment blocks|00001007030900]] allow to enter text that will be ignored when rendered. |
︙ |
Changes to docs/manual/00001007030200.zettel.
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - + | *# A.3 * B * C ::: Please note that two lists cannot be separated by an empty line. |
︙ |
Changes to docs/manual/00001007030600.zettel.
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | - + | id: 00001007030600 title: Zettelmarkup: Quotation Blocks role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk modified: 20220218131806 A simple way to enter a quotation is to use the [[quotation list|00001007030200]]. A quotation list loosely follows the convention of quoting text within emails. |
︙ |
Changes to docs/manual/00001007030800.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 | - + - | id: 00001007030800 title: Zettelmarkup: Region Blocks role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ | |||
65 66 67 68 69 70 71 | 64 65 66 67 68 69 70 | - - - - - - - - - - - - - | Generic attributes that are result in a special HTML rendering are: * example * note * tip * important * caution * warning |
Changes to docs/manual/00001007030900.zettel.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | While the text entered inside a verbatim block will be processed somehow, text inside a comment block will be ignored[^Well, not completely ignored: text is read, but it will typically not rendered visible.]. Comment blocks are typically used to give some internal comments, e.g. the license of a text or some internal remarks. Comment blocks begin with at least three percent sign characters (""''%''"", U+0025) at the first position of a line. You can add some [[attributes|00001007050000]] on the beginning line of a comment block, following the initiating characters. The comment block supports the default attribute: when given, the text will be rendered, e.g. as an HTML comment. When rendered to JSON, the comment block will not be ignored but it will output some JSON text. |
︙ |
Changes to docs/manual/00001007031000.zettel.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + | id: 00001007031000 title: Zettelmarkup: Tables role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk modified: 20220218131107 |
︙ |
Changes to docs/manual/00001007031200.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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + + - - + + - + + + + + + + + + + + + + + + + + + | id: 00001007031200 title: Zettelmarkup: Inline-Zettel Block role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ |
Deleted docs/manual/00001007031300.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007031400.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001007040100.zettel.
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + - + | ** Example: ``abc __def__ ghi`` is rendered in HTML as: ::abc __def__ ghi::{=example}. * The asterisk character (""''*''"", U+002A) strongly emphasized its enclosed text. ** Example: ``abc **def** ghi`` is rendered in HTML as: ::abc **def** ghi::{=example}. * The greater-than sign character (""''>''"", U+003E) marks text as inserted. ** Example: ``abc >>def>> ghi`` is rendered in HTML as: ::abc >>def>> ghi::{=example}. * Similar, the tilde character (""''~''"", U+007E) marks deleted text. ** Example: ``abc ~~def~~ ghi`` is rendered in HTML as: ::abc ~~def~~ ghi::{=example}. |
Changes to docs/manual/00001007040200.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001007040200 title: Zettelmarkup: Literal-like formatting role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - + - - - - - - - - - - - - - - - - - - - | Attributes can be specified, the default attribute has the same semantic as for literal text. === Inline-zettel snippet To specify an inline snippet in a different [[syntax|00001008000000]], delimit your text with two at-sign characters (""''@''"", U+0040) on each side. You can add some [[attributes|00001007050000]] immediate after the two closing at-sign characters to specify the syntax to use. Either use the attribute key ""syntax"" or use the generic attribute to specify the syntax value. |
Changes to docs/manual/00001007040324.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | - + + | id: 00001007040324 title: Zettelmarkup: Inline-mode Transclusion role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001007040340.zettel.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + | id: 00001007040340 title: Zettelmarkup: Citation Key role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk modified: 20220218133447 |
Changes to docs/manual/00001007050000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001007050000 title: Zettelmarkup: Attributes role: manual tags: #manual #zettelmarkup #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 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 | + + - - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | The key ""''-''"" (just hyphen-minus) is special. It is called __default attribute__ and has a markup specific meaning. For example, when used for plain text, it replaces the non-visible space with a visible representation: * ''``Hello, world``{-}'' produces ==Hello, world=={-}. * ''``Hello, world``'' produces ==Hello, world==. For some [[block-structured elements|00001007030000]], there is a syntax variant if you only want to specify a generic attribute. For all line-range blocks you can specify the generic attributes directly in the first line, after the three (or more) block characters. |
Changes to docs/manual/00001007060000.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 38 39 40 41 42 | - + - - + + - + - + - + | id: 00001007060000 title: Zettelmarkup: Summary of Formatting Characters role: manual tags: #manual #reference #zettelmarkup #zettelstore syntax: zmk |
Changes to docs/manual/00001008000000.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 38 39 40 41 | - + - + + + - + - + - | id: 00001008000000 title: Other Markup Languages role: manual tags: #manual #zettelstore syntax: zmk |
︙ | |||
49 50 51 52 53 54 55 | 50 51 52 53 54 55 56 | - - - - - - - | : Just plain text that must not be interpreted further. ; [!zmk|''zmk''] : [[Zettelmarkup|00001007000000]]. The actual values are also listed in a zettel named [[Zettelstore Supported Parser|00000000000092]]. If you specify something else, your content will be interpreted as plain text. |
Changes to docs/manual/00001008010000.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 38 39 40 | - + - + - + | id: 00001008010000 title: Use Markdown within Zettelstore role: manual tags: #manual #markdown #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001008010500.zettel.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 | - - + + | But they provide proprietary extensions, which makes it harder to change to another CommonMark implementation if needed. Plus, they sometimes build on an older specification of CommonMark. Zettelstore supports the latest CommonMark [[specification version 0.30 (2021-06-19)|https://spec.commonmark.org/0.30/]]. If possible, Zettelstore will adapt to newer versions when they are available. To provide CommonMark support, Zettelstore uses currently the [[Goldmark|https://github.com/yuin/goldmark]] implementation, which passes all validation tests of CommonMark. |
Changes to docs/manual/00001008050000.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 | - + - + - - + - + - - - + + - + - + | id: 00001008050000 title: The ""draw"" language role: manual tags: #graphic #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001010000000.zettel.
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + | Or you want to allow them to create new zettel, or to change them. It is up to you. If someone is authenticated as the owner of the Zettelstore (hopefully you), no restrictions apply. But as an owner, you can create ""user zettel"" to allow others to access your Zettelstore in various ways. Even if you do not want to share your Zettelstore with other persons, creating user zettel can be useful if you plan to access your Zettelstore via the [[API|00001012000000]]. |
︙ |
Changes to docs/manual/00001010040100.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 | - - - | id: 00001010040100 title: Enable authentication role: manual tags: #authentication #configuration #manual #security #zettelstore syntax: zmk |
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 |
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + + | === Zettel lists * [[List metadata of all zettel|00001012051200]] * [[Shape the list of zettel metadata|00001012051800]] ** [[Selection of zettel|00001012051810]] ** [[Limit the list length|00001012051830]] ** [[Content search|00001012051840]] ** [[Sort the list of zettel metadata|00001012052000]] |
︙ |
Changes to docs/manual/00001012052400.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + - - - + - - - - - - + - - - - - - - - - - - - + - + | id: 00001012052400 |
Added docs/manual/00001012052600.zettel.
|
Changes to docs/manual/00001012053200.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012053200 title: API: Create a new zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | - + | Typically, text content is not encoded, and binary content is encoded via Base64. Other keys will be ignored. Even these three keys are just optional. The body of the HTTP POST request must not be empty and it must contain a JSON object. Therefore, a body containing just ''{}'' is perfectly valid. |
︙ |
Changes to docs/manual/00001012053300.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 | - + - + | id: 00001012053300 title: API: Retrieve metadata and content of an existing zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - | Other values will result in a HTTP response status code ''400''. ; ''"content"'' : Is a string value that contains the content of the zettel to be created. Typically, text content is not encoded, and binary content is encoded via Base64. ; ''"rights"'' : An integer number that describes the [[access rights|00001012921200]] for the zettel. |
︙ |
Changes to docs/manual/00001012053500.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012053500 title: API: Retrieve evaluated metadata and content of an existing zettel in various encodings role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | + + | <meta name="zs-backward" content="00001012000000"> <meta name="zs-box-number" content="1"> <meta name="copyright" content="(c) 2020-2021 by Detlef Stern <ds@zettelstore.de>"> <meta name="zs-forward" content="00001010040100 00001012050200 00001012920000 00001012920800"> <meta name="zs-lang" content="en"> <meta name="zs-published" content="00001012053500"> ``` The optional query parameter ''_embed'' will embed all images into the returned encoding. === HTTP Status codes ; ''200'' : Retrieval was successful, the body contains an appropriate JSON object. ; ''400'' : Request was not valid. There are several reasons for this. Maybe the zettel identifier did not consist of exactly 14 digits or ''_enc'' / ''_part'' contained illegal values. ; ''403'' : You are not allowed to retrieve data of the given zettel. ; ''404'' : Zettel not found. You probably used a zettel identifier that is not used in the Zettelstore. |
Changes to docs/manual/00001012920000.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 38 39 40 41 42 | - + - + + + | id: 00001012920000 title: Endpoints used by the API role: manual tags: #api #manual #reference #zettelstore syntax: zmk |
Changes to docs/manual/00001012920500.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + + - + - | id: 00001012920500 title: Encodings available via the [[API|00001012000000]] role: manual tags: #api #manual #reference #zettelstore syntax: zmk |
Changes to docs/manual/00001012920503.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - + - + | id: 00001012920503 title: ZJSON Encoding role: manual tags: #api #manual #reference #zettelstore syntax: zmk |
︙ |
Added docs/manual/00001012920513.zettel.
|
Deleted docs/manual/00001012920516.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001012920519.zettel.
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012920519 title: Text Encoding role: manual tags: #api #manual #reference #zettelstore syntax: zmk modified: 20210726193119 A zettel representation contains just all textual data of a zettel. Could be used for creating a search index. |
Changes to docs/manual/00001012921000.zettel.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | id: 00001012921000 title: API: JSON structure of an access token tags: #api #manual #reference #zettelstore syntax: zmk role: manual |
Changes to domain/id/id.go.
1 | 1 2 3 4 5 6 7 8 9 10 11 | - + - + | //----------------------------------------------------------------------------- |
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - | FormTemplateZid = MustParse(api.ZidFormTemplate) RenameTemplateZid = MustParse(api.ZidRenameTemplate) DeleteTemplateZid = MustParse(api.ZidDeleteTemplate) ContextTemplateZid = MustParse(api.ZidContextTemplate) RolesTemplateZid = MustParse(api.ZidRolesTemplate) TagsTemplateZid = MustParse(api.ZidTagsTemplate) ErrorTemplateZid = MustParse(api.ZidErrorTemplate) |
︙ |
Deleted domain/meta/collection.go.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to domain/meta/meta.go.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - | "regexp" "sort" "strings" "unicode" "unicode/utf8" "zettelstore.de/c/api" |
︙ | |||
103 104 105 106 107 108 109 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | + - - - + + + + + + | return *d } return DescriptionKey{Type: Type(name)} } // GetSortedKeyDescriptions delivers all metadata key descriptions as a slice, sorted by name. func GetSortedKeyDescriptions() []*DescriptionKey { names := make([]string, 0, len(registeredKeys)) |
︙ | |||
224 225 226 227 228 229 230 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - - - - - - - - - - | // Set stores the given string value under the given key. func (m *Meta) Set(key, value string) { if key != api.KeyID { m.pairs[key] = trimValue(value) } } |
︙ | |||
257 258 259 260 261 262 263 | 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | - - - - - - - - - | func (m *Meta) GetDefault(key, def string) string { if value, ok := m.Get(key); ok { return value } return def } |
︙ |
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.
︙ | |||
8 9 10 11 12 13 14 15 16 17 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | + - | // under this license. //----------------------------------------------------------------------------- // Package meta provides the domain specific type 'meta'. package meta import ( "sort" "strings" "zettelstore.de/c/api" |
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | + + + + + + - + | set := make(strfun.Set, len(newElems)+len(oldElems)) addToSet(set, newElems, useElem) if len(set) == 0 { // Nothing to add. Maybe because of rejected elements. return } addToSet(set, oldElems, useElem) resultList := make([]string, 0, len(set)) for tag := range set { resultList = append(resultList, tag) } sort.Strings(resultList) |
︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | + + + + | 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.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | //----------------------------------------------------------------------------- // Copyright (c) 2020-2022 Detlef Stern // |
︙ | |||
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 domain/meta/type.go.
︙ | |||
14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | + | import ( "strconv" "strings" "sync" "time" "zettelstore.de/c/api" "zettelstore.de/c/zjson" ) // DescriptionType is a description of a specific key type. type DescriptionType struct { Name string IsSet bool } |
︙ | |||
38 39 40 41 42 43 44 | 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 | - - - - - - - - - - - - + + + + + + + + + + + + | t := &DescriptionType{name, isSet} registeredTypes[name] = t return t } // Supported key types. var ( |
︙ |
Changes to encoder/encoder.go.
︙ | |||
41 42 43 44 45 46 47 | 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 | - - - + + + - - - - + + + + + + + + - + + + + + + + - + + + + - + | ErrNoWriteMeta = errors.New("method WriteMeta is not implemented") ErrNoWriteContent = errors.New("method WriteContent is not implemented") ErrNoWriteBlocks = errors.New("method WriteBlocks is not implemented") ErrNoWriteInlines = errors.New("method WriteInlines is not implemented") ) // Create builds a new encoder with the given options. |
Changes to encoder/encoder_blob_test.go.
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - - - - - + + + + + | 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b, 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x78, 0x9c, 0x63, 0x62, 0x00, 0x00, 0x00, 0x06, 0x00, 0x03, 0x36, 0x37, 0x7c, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }, expect: expectMap{ |
︙ |
Changes to encoder/encoder_block_test.go.
︙ | |||
11 12 13 14 15 16 17 | 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 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - + + + + + + + - - + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + + + - - - - + + + + + + - - - - + + + + + + + - - - - - + + + + + - - - - + + + + + - + - - + + - - + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + - + - - + + + + + + + + - - - - - - - - - - - - - - - - + + + + + | package encoder_test var tcsBlock = []zmkTestCase{ { descr: "Empty Zettelmarkup should produce near nothing", zmk: "", expect: expectMap{ |
Changes to encoder/encoder_inline_test.go.
︙ | |||
11 12 13 14 15 16 17 | 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 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 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 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - - + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + + + - - + + - - - + - - - - - - - - - - - + + - - - - - + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - - + + + + - + - - - - - + + + + + - + - - + + - - + - - - - - - - - - - - - + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + | package encoder_test var tcsInline = []zmkTestCase{ { descr: "Empty Zettelmarkup should produce near nothing (inline)", zmk: "", expect: expectMap{ |
Changes to encoder/encoder_test.go.
︙ | |||
11 12 13 14 15 16 17 | 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 | - - - - - - - + + + + + + - - - - - + + + + + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - | package encoder_test import ( "bytes" "fmt" "testing" |
︙ |
Added encoder/env.go.
|
Added encoder/htmlenc/block.go.