Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From version-0.0.15 To version-0.0.14
2021-09-23
| ||
18:03 | Increase version to 0.0.16-dev to begin next development cycle ... (check-in: 9748c52fdb user: stern tags: trunk) | |
2021-09-17
| ||
14:55 | Version 0.0.15 ... (check-in: 66498fc30a user: stern tags: trunk, release, version-0.0.15, v0.0.15) | |
2021-09-16
| ||
18:02 | Initial development zettel ... (check-in: 64e566f5db user: stern tags: trunk) | |
2021-07-23
| ||
16:43 | Increase version to 0.0.15-dev to begin next development cycle ... (check-in: ba65777850 user: stern tags: trunk) | |
11:02 | Version 0.0.14 ... (check-in: 6fe53d5db2 user: stern tags: trunk, release, version-0.0.14) | |
2021-07-22
| ||
13:50 | Add client API for retrieving zettel links ... (check-in: e43ff68174 user: stern tags: trunk) | |
Changes to VERSION.
| 1 | - + |
|
Changes to api/api.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 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 | - + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + | Token string `json:"token"` Type string `json:"token_type"` Expires int `json:"expires_in"` } // ZidJSON contains the identifier data of a zettel. type ZidJSON struct { |
︙ |
Changes to api/const.go.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - + + + - - - - + + + + - - - - + - - - + - - - - - + + + + + + + - - - - - - + + + + + + + + - + - - + + - - - + + + + + - + + | //----------------------------------------------------------------------------- // Copyright (c) 2021 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 api contains common definition used for client and server. package api |
Changes to ast/ast.go.
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 | 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 | + - + + + + - - - - - - - - - - - - + + + | "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" ) // ZettelNode is the root node of the abstract syntax tree. // It is *not* part of the visitor pattern. type ZettelNode struct { // Zettel domain.Zettel Meta *meta.Meta // Original metadata Content domain.Content // Original content Zid id.Zid // Zettel identification. InhMeta *meta.Meta // Metadata of the zettel, with inherited values. |
︙ |
Changes to ast/attr.go.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - - - | ) // Attributes store additional information about some node types. type Attributes struct { Attrs map[string]string } |
︙ | |||
78 79 80 81 82 83 84 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - - - | } // AddClass adds a value to the class attribute. func (a *Attributes) AddClass(class string) *Attributes { if a == nil { return &Attributes{map[string]string{"class": class}} } |
︙ |
Changes to ast/block.go.
︙ | |||
9 10 11 12 13 14 15 | 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 | - - - - - - - - - - - - - - - + - - - + + + - - - - + | //----------------------------------------------------------------------------- // Package ast provides the abstract syntax tree. package ast // Definition of Block nodes. |
︙ | |||
61 62 63 64 65 66 67 | 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 | - - + + - + - - + + - - + + - - + + - - - - + + - - - + + - - + + - + - - + + - + | const ( _ VerbatimKind = iota VerbatimProg // Program code. VerbatimComment // Block comment VerbatimHTML // Block HTML, e.g. for Markdown ) |
︙ | |||
151 152 153 154 155 156 157 | 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 | - - + + - + - + - + - - + + - + - + - + - + - + | const ( _ NestedListKind = iota NestedListOrdered // Ordered list. NestedListUnordered // Unordered list. NestedListQuote // Quote list. ) |
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 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - - - + + + - + - + - - - - - - - + + + + + + + - + - - - + + + - - - - - + + + - + - + - - - + - - - + - + - - + + - + - + - + | //----------------------------------------------------------------------------- // Package ast provides the abstract syntax tree. package ast // Definitions of inline nodes. |
︙ | |||
215 216 217 218 219 220 221 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - + - + | FormatQuote // Quoted text. FormatQuotation // Quotation text. FormatSmall // Smaller text. FormatSpan // Generic inline container. FormatMonospace // Monospaced text. ) |
︙ | |||
244 245 246 247 248 249 250 | 196 197 198 199 200 201 202 203 204 205 206 | - + - + | LiteralProg // Inline program code. LiteralKeyb // Keyboard strokes. LiteralOutput // Sample output. LiteralComment // Inline comment LiteralHTML // Inline HTML, e.g. for Markdown ) |
Deleted ast/material.go.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to ast/walk.go.
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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 | + + + + + + + + + + + + + + | func Walk(v Visitor, node Node) { if v = v.Visit(node); v == nil { return } node.WalkChildren(v) v.Visit(nil) } // WalkBlockSlice traverse a block slice. func WalkBlockSlice(v Visitor, bns BlockSlice) { for _, bn := range bns { Walk(v, bn) } } // WalkInlineSlice traverses an inline slice. func WalkInlineSlice(v Visitor, ins InlineSlice) { for _, in := range ins { Walk(v, in) } } // WalkItemSlice traverses an item slice. func WalkItemSlice(v Visitor, ins ItemSlice) { for _, in := range ins { Walk(v, in) } } |
︙ |
Changes to auth/policy/policy_test.go.
︙ | |||
41 42 43 44 45 46 47 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - - + + | readOnly: ts.readonly, withAuth: ts.withAuth, } pol := newPolicy(authzManager, &authConfig{ts.expert}) name := fmt.Sprintf("readonly=%v/withauth=%v/expert=%v", ts.readonly, ts.withAuth, ts.expert) t.Run(name, func(tt *testing.T) { |
︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - + | func (ac *authConfig) GetVisibility(m *meta.Meta) meta.Visibility { if vis, ok := m.Get(meta.KeyVisibility); ok { return meta.GetVisibility(vis) } return meta.VisibilityLogin } |
︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + | if tc.exp != got { tt.Errorf("exp=%v, but got=%v", tc.exp, got) } }) } } |
︙ |
Changes to box/box.go.
︙ | |||
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 | 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 | + + + - - - - - - - - - + - - + | CreateZettel(ctx context.Context, zettel domain.Zettel) (id.Zid, error) // GetZettel retrieves a specific zettel. GetZettel(ctx context.Context, zid id.Zid) (domain.Zettel, error) // GetMeta retrieves just the meta data of a specific zettel. GetMeta(ctx context.Context, zid id.Zid) (*meta.Meta, error) // FetchZids returns the set of all zettel identifer managed by the box. FetchZids(ctx context.Context) (id.Set, error) // CanUpdateZettel returns true, if box could possibly update the given zettel. CanUpdateZettel(ctx context.Context, zettel domain.Zettel) bool // UpdateZettel updates an existing zettel. UpdateZettel(ctx context.Context, zettel domain.Zettel) error // AllowRenameZettel returns true, if box will not disallow renaming the zettel. AllowRenameZettel(ctx context.Context, zid id.Zid) bool // RenameZettel changes the current Zid to a new Zid. RenameZettel(ctx context.Context, curZid, newZid id.Zid) error // CanDeleteZettel returns true, if box could possibly delete the given zettel. CanDeleteZettel(ctx context.Context, zid id.Zid) bool // DeleteZettel removes the zettel from the box. DeleteZettel(ctx context.Context, zid id.Zid) error } |
︙ | |||
101 102 103 104 105 106 107 | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - - - | Stop(ctx context.Context) error } // Box is to be used outside the box package and its descendants. type Box interface { BaseBox |
︙ |
Changes to box/compbox/compbox.go.
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + | "net/url" "zettelstore.de/z/box" "zettelstore.de/z/box/manager" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/search" ) func init() { manager.Register( " comp", func(u *url.URL, cdata *manager.ConnectData) (box.ManagedBox, error) { return getCompBox(cdata.Number, cdata.Enricher), nil |
︙ | |||
52 53 54 55 56 57 58 | 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 | - + - + + - + - + - + - + + - + - + - + - + + + - + - - - - - + + + + + + + + + - + - + - + - + | func getCompBox(boxNumber int, mf box.Enricher) box.ManagedBox { return &compBox{number: boxNumber, enricher: mf} } // Setup remembers important values. func Setup(cfg *meta.Meta) { myConfig = cfg.Clone() } |
︙ |
Changes to box/constbox/base.css.
︙ | |||
252 253 254 255 256 257 258 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | - - - | } .zs-meta a { color:#444; } h1+.zs-meta { margin-top:-1rem; } |
︙ |
Changes to box/constbox/base.mustache.
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + | {{#UserIsValid}} <a href="{{{UserZettelURL}}}">{{UserIdent}}</a> {{/UserIsValid}} {{^UserIsValid}} <a href="{{{LoginURL}}}">Login</a> {{/UserIsValid}} {{#UserIsValid}} |
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - + | {{#NewZettelLinks}} <a href="{{{URL}}}">{{Text}}</a> {{/NewZettelLinks}} </nav> </div> {{/HasNewZettelLinks}} <form action="{{{SearchURL}}}"> |
Changes to box/constbox/constbox.go.
︙ | |||
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 | 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 | + + + + + + + + + - - - + + + + + - + - + - + - + - + - + + - + - + - + - + - - - + + + + + - - - - - + + + + + + + + + - + - + - + | "net/url" "zettelstore.de/z/box" "zettelstore.de/z/box/manager" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/search" ) func init() { manager.Register( " const", func(u *url.URL, cdata *manager.ConnectData) (box.ManagedBox, error) { return &constBox{ number: cdata.Number, zettel: constZettelMap, enricher: cdata.Enricher, }, nil }) } type constHeader map[string]string func makeMeta(zid id.Zid, h constHeader) *meta.Meta { m := meta.New(zid) for k, v := range h { m.Set(k, v) } return m } type constZettel struct { header constHeader content domain.Content } type constBox struct { number int zettel map[id.Zid]constZettel enricher box.Enricher } |
︙ |
Changes to box/constbox/home.zettel.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + - + | === Thank you for using Zettelstore! You will find the lastest information about Zettelstore at [[https://zettelstore.de]]. Check that website regulary for [[upgrades|https://zettelstore.de/home/doc/trunk/www/download.wiki]] to the latest version. You should consult the [[change log|https://zettelstore.de/home/doc/trunk/www/changes.wiki]] before upgrading. Sometimes, you have to edit some of your Zettelstore-related zettel before upgrading. Since Zettelstore is currently in a development state, every upgrade might fix some of your problems. To check for versions, there is a zettel with the [[current version|00000000000001]] of your Zettelstore. If you have problems concerning Zettelstore, do not hesitate to get in [[contact with the main developer|mailto:ds@zettelstore.de]]. === Reporting errors If you have encountered an error, please include the content of the following zettel in your mail (if possible): |
︙ |
Changes to box/constbox/info.mustache.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - + - + - - + - + - - - - - - - - - - | <ul> {{#ExtLinks}} <li><a href="{{{.}}}"{{{ExtNewWindow}}}>{{.}}</a></li> {{/ExtLinks}} </ul> {{/HasExtLinks}} {{/HasLinks}} |
Changes to box/constbox/login.mustache.
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - + | <article> <header> <h1>{{Title}}</h1> </header> {{#Retry}} <div class="zs-indication zs-error">Wrong user name / password. Try again.</div> {{/Retry}} |
︙ |
Changes to box/constbox/zettel.mustache.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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 | + - - - - - - - - - - - - - - - + | <article> <header> <h1>{{{HTMLTitle}}}</h1> <div class="zs-meta"> {{#CanWrite}}<a href="{{{EditURL}}}">Edit</a> ·{{/CanWrite}} {{Zid}} · <a href="{{{InfoURL}}}">Info</a> · (<a href="{{{RoleURL}}}">{{RoleText}}</a>) {{#HasTags}}· {{#Tags}} <a href="{{{URL}}}">{{Text}}</a>{{/Tags}}{{/HasTags}} {{#CanCopy}}· <a href="{{{CopyURL}}}">Copy</a>{{/CanCopy}} {{#CanFolge}}· <a href="{{{FolgeURL}}}">Folge</a>{{/CanFolge}} {{#FolgeRefs}}<br>Folge: {{{FolgeRefs}}}{{/FolgeRefs}} {{#PrecursorRefs}}<br>Precursor: {{{PrecursorRefs}}}{{/PrecursorRefs}} {{#HasExtURL}}<br>URL: <a href="{{{ExtURL}}}"{{{ExtNewWindow}}}>{{ExtURL}}</a>{{/HasExtURL}} </div> </header> {{{Content}}} |
Changes to box/dirbox/dirbox.go.
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + | "zettelstore.de/z/box" "zettelstore.de/z/box/dirbox/directory" "zettelstore.de/z/box/filebox" "zettelstore.de/z/box/manager" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/search" ) func init() { manager.Register("dir", func(u *url.URL, cdata *manager.ConnectData) (box.ManagedBox, error) { path := getDirPath(u) if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { return nil, err |
︙ | |||
107 108 109 110 111 112 113 | 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 | - + - + - + | mxCmds sync.RWMutex } func (dp *dirBox) Location() string { return dp.location } |
︙ | |||
153 154 155 156 157 158 159 | 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 | - + - + - + - + - + - + - + - + + - + - + - + - + + - - + + + - + - + + + + + + + - + - + - + | sum *= 16777619 dp.mxCmds.RLock() defer dp.mxCmds.RUnlock() return dp.fCmds[sum%dp.fSrvs] } |
︙ | |||
305 306 307 308 309 310 311 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | - + | if s == syntax { return directory.MetaSpecHeader, "zettel" } } return directory.MetaSpecFile, syntax } |
︙ | |||
357 358 359 360 361 362 363 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | - + - + | if err == nil { dp.notifyChanged(box.OnDelete, curZid) dp.notifyChanged(box.OnUpdate, newZid) } return err } |
︙ | |||
387 388 389 390 391 392 393 | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - + | } func (dp *dirBox) ReadStats(st *box.ManagedBoxStats) { st.ReadOnly = dp.readonly st.Zettel, _ = dp.dirSrv.NumEntries() } |
︙ |
Changes to box/dirbox/service.go.
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - + | "zettelstore.de/z/box/filebox" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/input" ) |
︙ |
Changes to box/filebox/zipbox.go.
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + | "strings" "zettelstore.de/z/box" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/input" "zettelstore.de/z/search" ) var validFileName = regexp.MustCompile(`^(\d{14}).*(\.(.+))$`) func matchValidFileName(name string) []string { return validFileName.FindStringSubmatch(name) } |
︙ | |||
48 49 50 51 52 53 54 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + | func (zp *zipBox) Location() string { if strings.HasPrefix(zp.name, "/") { return "file://" + zp.name } return "file:" + zp.name } |
︙ | |||
93 94 95 96 97 98 99 | 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 | - + - + - + - + | if entry.contentExt == "" { entry.contentExt = ext entry.contentName = name } } } |
︙ | |||
143 144 145 146 147 148 149 | 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 | - + - + + - + - + - + - + - - - + + + + + - - - - - + + + + + + + + + - + - + - + | } else { m = CalcDefaultMeta(zid, entry.contentExt) } CleanupMeta(m, zid, entry.contentExt, inMeta, false) return domain.Zettel{Meta: m, Content: domain.NewContent(src)}, nil } |
︙ |
Changes to box/manager/box.go.
︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + | // Package manager coordinates the various boxes and indexes of a Zettelstore. package manager import ( "context" "errors" "sort" "strings" "zettelstore.de/z/box" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/search" |
︙ | |||
124 125 126 127 128 129 130 | 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 | - + - - + + + + + + + + + + + + + - + - - - - + + + + - - + - - - + + - + - - - + + - - - - - | result = append(result, m) } } return result, nil } // FetchZids returns the set of all zettel identifer managed by the box. |
︙ |
Changes to box/manager/collect.go.
︙ | |||
20 21 22 23 24 25 26 | 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 | - - - + - - + + - - + - - + - | "zettelstore.de/z/strfun" ) type collectData struct { refs id.Set words store.WordSet urls store.WordSet |
︙ |
Changes to box/manager/indexer.go.
︙ | |||
193 194 195 196 197 198 199 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | - | zi.AddBackRef(ref) } else { zi.AddDeadRef(ref) } } zi.SetWords(cData.words) zi.SetUrls(cData.urls) |
︙ |
Changes to box/manager/memstore/memstore.go.
︙ | |||
32 33 34 35 36 37 38 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - - + | type zettelIndex struct { dead id.Slice forward id.Slice backward id.Slice meta map[string]metaRefs words []string urls []string |
︙ | |||
65 66 67 68 69 70 71 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - - + + - + | idx: make(map[id.Zid]*zettelIndex), dead: make(map[id.Zid]id.Slice), words: make(stringRefs), urls: make(stringRefs), } } |
︙ | |||
108 109 110 111 112 113 114 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | - - - - - - - - - - - | } } } if len(back) > 0 { m.Set(meta.KeyBack, back.String()) updated = true } |
︙ | |||
264 265 266 267 268 269 270 | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | - + | } } } } return back } |
︙ | |||
286 287 288 289 290 291 292 | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - | } ms.updateDeadReferences(zidx, zi) ms.updateForwardBackwardReferences(zidx, zi) ms.updateMetadataReferences(zidx, zi) zi.words = updateWordSet(zidx.Zid, ms.words, zi.words, zidx.GetWords()) zi.urls = updateWordSet(zidx.Zid, ms.urls, zi.urls, zidx.GetUrls()) |
︙ | |||
380 381 382 383 384 385 386 | 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 | - - - - - - - - - - + | continue } srefs[word] = refs2 } return next.Words() } |
︙ |
Changes to box/manager/store/zettel.go.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - | type ZettelIndex struct { Zid id.Zid // zid of the indexed zettel backrefs id.Set // set of back references metarefs map[string]id.Set // references to inverse keys deadrefs id.Set // set of dead references words WordSet urls WordSet |
︙ | |||
57 58 59 60 61 62 63 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - - - | // SetWords sets the words to the given value. func (zi *ZettelIndex) SetWords(words WordSet) { zi.words = words } // SetUrls sets the words to the given value. func (zi *ZettelIndex) SetUrls(urls WordSet) { zi.urls = urls } |
︙ | |||
87 88 89 90 91 92 93 | 83 84 85 86 87 88 89 | - - - | } // GetWords returns a reference to the set of words. It must not be modified. func (zi *ZettelIndex) GetWords() WordSet { return zi.words } // GetUrls returns a reference to the set of URLs. It must not be modified. func (zi *ZettelIndex) GetUrls() WordSet { return zi.urls } |
Changes to box/membox/membox.go.
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | + | "sync" "zettelstore.de/z/box" "zettelstore.de/z/box/manager" "zettelstore.de/z/domain" "zettelstore.de/z/domain/id" "zettelstore.de/z/domain/meta" "zettelstore.de/z/search" ) func init() { manager.Register( "mem", func(u *url.URL, cdata *manager.ConnectData) (box.ManagedBox, error) { return &memBox{u: u, cdata: *cdata}, nil |
︙ | |||
44 45 46 47 48 49 50 | 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 | - + - + - + - + - + - + - + - + - + + - + - + + - - - - + + + + + + - - - + + + + + - + - + | } } func (mp *memBox) Location() string { return mp.u.String() } |
︙ | |||
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 | - + - + | delete(mp.zettel, curZid) mp.mx.Unlock() mp.notifyChanged(box.OnDelete, curZid) mp.notifyChanged(box.OnUpdate, newZid) return nil } |
︙ |
Added box/merge.go.
|
Changes to client/client.go.
︙ | |||
13 14 15 16 17 18 19 | 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 | - - - + - - - - - - - - - - - - + + - + | import ( "bytes" "context" "encoding/json" "errors" "io" |
︙ | |||
135 136 137 138 139 140 141 | 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 | - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + | } return c.RefreshToken(ctx) } // Authenticate sets a new token by sending user name and password. func (c *Client) Authenticate(ctx context.Context) error { authData := url.Values{"username": {c.username}, "password": {c.password}} |
︙ | |||
209 210 211 212 213 214 215 | 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 | - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - + + | func encodeZettelData(buf *bytes.Buffer, data *api.ZettelDataJSON) error { enc := json.NewEncoder(buf) enc.SetEscapeHTML(false) return enc.Encode(&data) } // ListZettel returns a list of all Zettel. |
︙ | |||
384 385 386 387 388 389 390 | 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 | - + - + - - - - - - - - - - - - - - - + - + - + - + - - + + - + | err = dec.Decode(&out) if err != nil { return nil, err } return &out, nil } |
︙ |
Changes to client/client_test.go.
︙ | |||
12 13 14 15 16 17 18 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + | package client_test import ( "context" "flag" "fmt" "net/url" |
︙ | |||
96 97 98 99 100 101 102 103 | 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 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + - + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + - + - - - + + + + + + + + + + - + - + + + - + + - - + + - + - + - + | t.Error("Cannot delete", zid, ":", err) return } } func TestUpdateZettel(t *testing.T) { t.Parallel() c := getClient() |
︙ |
Changes to cmd/cmd_file.go.
︙ | |||
23 24 25 26 27 28 29 | 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 | - - + + - - + - - - + + - + | "zettelstore.de/z/encoder" "zettelstore.de/z/input" "zettelstore.de/z/parser" ) // ---------- Subcommand: file ----------------------------------------------- |
︙ |
Changes to cmd/cmd_run.go.
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + | // under this license. //----------------------------------------------------------------------------- package cmd import ( "flag" "net/http" zsapi "zettelstore.de/z/api" "zettelstore.de/z/auth" "zettelstore.de/z/box" "zettelstore.de/z/config" "zettelstore.de/z/domain/meta" "zettelstore.de/z/kernel" "zettelstore.de/z/usecase" "zettelstore.de/z/web/adapter/api" |
︙ | |||
37 38 39 40 41 42 43 | 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 | - + - + - + + + - - - + + + - - - - - - + + + + + + - - + + - + - - - - - - + + + + + + - - - - + + - - + - - - - - - - - + + + - - - - - - - + + + + + + + + + - + - - + - - - + - - + | } func withDebug(fs *flag.FlagSet) bool { dbg := fs.Lookup("debug") return dbg != nil && dbg.Value.String() == "true" } |
Changes to cmd/fd_limit.go.
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 | - | //----------------------------------------------------------------------------- // Copyright (c) 2021 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. //----------------------------------------------------------------------------- |
Changes to cmd/fd_limit_raise.go.
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 | - | //----------------------------------------------------------------------------- // Copyright (c) 2021 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. //----------------------------------------------------------------------------- |
︙ |
Changes to cmd/main.go.
︙ | |||
16 17 18 19 20 21 22 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - | "fmt" "net" "net/url" "os" "strconv" "strings" |
︙ | |||
69 70 71 72 73 74 75 | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + | Header: true, Flags: flgSimpleRun, }) RegisterCommand(Command{ Name: "file", Func: cmdFile, Flags: func(fs *flag.FlagSet) { |
︙ |
Changes to cmd/register.go.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + + | // Mention all needed encoders, parsers and stores to have them registered. 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. |
︙ |
Changes to collect/collect.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 | - - + + - - + - - - - + + + | // Package collect provides functions to collect items from a syntax tree. package collect import "zettelstore.de/z/ast" // Summary stores the relevant parts of the syntax tree type Summary struct { |
Changes to collect/collect_test.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 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 | - - + + - + - + - + - - + + - + - + - + - - + + - - - + + + - - + + | return r } func TestLinks(t *testing.T) { t.Parallel() zn := &ast.ZettelNode{} summary := collect.References(zn) |
Changes to collect/order.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 | - - - - - + + - - - - - - - - + + + + + + - + - - - - + - + | // Package collect provides functions to collect items from a syntax tree. package collect import "zettelstore.de/z/ast" // Order of internal reference within the given zettel. func Order(zn *ast.ZettelNode) (result []*ast.Reference) { |
︙ |
Changes to config/config.go.
︙ | |||
40 41 42 43 44 45 46 | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - - - | // GetHomeZettel returns the value of the "home-zettel" key. GetHomeZettel() id.Zid // GetDefaultVisibility returns the default value for zettel visibility. GetDefaultVisibility() meta.Visibility |
︙ | |||
72 73 74 75 76 77 78 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | - - + - - | // 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(meta.KeyTitle); ok { return val } |
︙ |
Deleted docs/development/00010000000000.zettel.
| - - - - - - - - |
|
Deleted docs/development/20210916193200.zettel.
| - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/development/20210916194900.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
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 |
︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | - - - - | Default: (the empty string). ; [!home-zettel]''home-zettel'' : Specifies the identifier of the zettel, that should be presented for the default view / home view. If not given or if the identifier does not identify a zettel, the zettel with the identifier ''00010000000000'' is shown. ; [!marker-external]''marker-external'' : Some HTML code that is displayed after a reference to external material. Default: ''&\#10138;'', to display a ""➚"" sign. |
︙ |
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 26 27 28 | - + + + | id: 00001004051200 title: The ''file'' sub-command role: manual tags: #command #configuration #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001006000000.zettel.
1 2 | 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: 00001006000000 title: Layout of a Zettel |
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 | - + - - | id: 00001006020000 title: Supported Metadata Keys role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001006020100.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 | - | id: 00001006020100 title: Supported Zettel Roles role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ | |||
32 33 34 35 36 37 38 | 31 32 33 34 35 36 37 38 | - + | Think of them as Post-it notes. ; [!literature]''literature'' : Contains some remarks about a book, a paper, a web page, etc. You should add a citation key for citing it. ; [!zettel]''zettel'' : A real zettel that contains your own thoughts. |
Changes to docs/manual/00001006030000.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: 00001006030000 title: Supported Key Types role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001006034000.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 | - - - - + + | id: 00001006034000 title: TagSet Key Type role: manual tags: #manual #meta #reference #zettel #zettelstore syntax: zmk |
Changes to docs/manual/00001006035500.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - - - - + | id: 00001006035500 title: Word 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 |
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 | - + | | 00000200000000 | 0000899999999 | Reserved for future use | 00009000000000 | 0000999999999 | Reserved for applications This list may change in the future. ==== External Applications |= From | To | Description |
Changes to docs/manual/00001007040000.zettel.
1 2 | 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 | - - + - - - - + + + + - - - + + + - - - - - - - + + + + + + + - + | id: 00001007040000 title: Zettelmarkup: Inline-Structured Elements |
︙ |
Changes to docs/manual/00001007040300.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 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 | - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | id: 00001007040300 title: Zettelmarkup: Reference-like text role: manual tags: #manual #zettelmarkup #zettelstore syntax: zmk |
Deleted docs/manual/00001007040310.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007040320.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007040322.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007040324.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007040330.zettel.
| - - - - - - - - - - - |
|
Deleted docs/manual/00001007040340.zettel.
| - - - - - - - - - - - - - - - |
|
Deleted docs/manual/00001007040350.zettel.
| - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001007050000.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - + - + | id: 00001007050000 title: Zettelmarkup: Attributes |
︙ | |||
44 45 46 47 48 49 50 | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - + | This is not true for the generic attribute. In ``{=key1 =key2}``, the first key is ignored. Therefore it is equivalent to ``{=key2}``. The key ""''-''"" (just hyphen-minus) is special. It is called //default attribute//{-} and has a markup specific meaning. |
︙ |
Changes to docs/manual/00001007060000.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 | - - + | id: 00001007060000 title: Zettelmarkup: Summary of Formatting Characters |
︙ | |||
26 27 28 29 30 31 32 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - + - - - + + + | | '':'' | [[Region block|00001007030800]] / [[description text|00001007030100]] | [[Inline region|00001007040100]] | '';'' | [[Description term|00001007030100]] | [[Small text|00001007040100]] | ''<'' | [[Quotation block|00001007030600]] | [[Short inline quote|00001007040100]] | ''='' | [[Headings|00001007030300]] | [[Computer output|00001007040200]] | ''>'' | [[Quotation lists|00001007030200]] | (blocked: to remove anyambiguity with quotation lists) | ''?'' | (free) | (free) | ''@'' | (free) | (reserved) |
Changes to docs/manual/00001008010000.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001008010000 title: Use Markdown within Zettelstore role: manual tags: #manual #markdown #zettelstore syntax: zmk |
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 47 | - + | An attacker might include malicious HTML code in your zettel. For example, HTML allows to embed JavaScript, a full-sized programming language that drives many web sites. When a zettel is displayed, JavaScript code might be executed, sometimes with harmful results. Zettelstore mitigates this problem by ignoring suspicious text when it encodes a zettel as HTML. Any HTML text that might contain the ``<script>`` tag or the ``<iframe>`` tag is ignored. This may lead to unexpected results if you depend on these. |
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 |
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + | Computed zettel with internal runtime information are examples for such a zettel. When you install a Zettelstore, only some zettel have visibility ""public"". One is the zettel that contains CSS for displaying the web interface. This is to ensure that the web interface looks nice even for not authenticated users. Another is the zettel containing the [[version|00000000000001]] of the Zettelstore. Yet other zettel lists the Zettelstore [[license|00000000000004]], its [[contributors|00000000000005]], and external, licensed [[dependencies|00000000000006]], such as program code written by others or graphics designed by others. |
Changes to docs/manual/00001012000000.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: 00001012000000 title: API role: manual tags: #api #manual #zettelstore syntax: zmk |
Changes to docs/manual/00001012050200.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 | - + - + - + - + - + | id: 00001012050200 title: API: Authenticate a client role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001012050400.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: 00001012050400 title: API: Renew an access token role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001012050600.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - - + - + | id: 00001012050600 title: API: Provide an access token |
Changes to docs/manual/00001012051200.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 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 | - - + - - + + - - + + - + + + + + + - - + + - - - - - + - - - - + - | id: 00001012051200 title: API: List metadata of all zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
Added docs/manual/00001012051400.zettel.
|
Added docs/manual/00001012051600.zettel.
|
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 16 | - + - + + | 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 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: 00001012051810 title: API: Select zettel based on their metadata role: manual tags: #api #manual #zettelstore syntax: zmk |
Added docs/manual/00001012051820.zettel.
|
Changes to docs/manual/00001012051830.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: 00001012051830 title: API: Shape the list of zettel metadata by limiting its length role: manual tags: #api #manual #zettelstore syntax: zmk |
Added docs/manual/00001012052200.zettel.
|
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 |
Deleted 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 14 15 16 | - + - + | id: 00001012053200 title: API: Create a new zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - - + + - + + + + + - + - - - + + - - - - - - - - - | 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. The new zettel will have no content, its title will be set to the value of [[''default-title''|00001004020000#default-title]] (default: ""Untitled""), its role is set to the value of [[''default-role''|00001004020000#default-role]] (default: ""zettel""), and its syntax is set to the value of [[''default-syntax''|00001004020000#default-syntax]] (default: ""zmk""). ``` |
Changes to docs/manual/00001012053400.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 52 53 54 55 56 57 58 | - - + - + - - + + - - - + + + + - - - + + + + + - - - - + + - - - - - - - + + + + + + + + + - - - + - - - - - - + - - - - + + + - - + - - - - - - + - - - - + + - - - + + - + | id: 00001012053400 title: API: Retrieve metadata and content of an existing zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
Deleted docs/manual/00001012053500.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001012053600.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 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 | - + - + + + + - - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + + + - + | id: 00001012053600 |
Deleted docs/manual/00001012053700.zettel.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Changes to docs/manual/00001012053800.zettel.
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | id: 00001012053800 title: API: Retrieve context of an existing zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ | |||
27 28 29 30 31 32 33 | 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 | - + + + + + + + - + | Currently, only some of the newest zettel with a given tag are considered a connection.[^The number of zettel is given by the value of parameter ''depth''.] Otherwise the context would become too big and therefore unusable. To retrieve the context of an existing zettel, use the [[endpoint|00001012920000]] ''/x/{ID}''[^Mnemonic: conte**X**t]. ```` # curl 'http://127.0.0.1:23123/x/00001012053800?limit=3&dir=forward&depth=2' |
Changes to docs/manual/00001012054000.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 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 | - + - + + + + + + + - + + + - + | id: 00001012054000 title: API: Retrieve zettel order within an existing zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
Changes to docs/manual/00001012054200.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: 00001012054200 title: API: Update a zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001012054400.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 | - + - + - + - - - | id: 00001012054400 title: API: Rename a zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
Changes to docs/manual/00001012054600.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: 00001012054600 title: API: Delete a zettel role: manual tags: #api #manual #zettelstore syntax: zmk |
︙ |
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 | - + + + + + - + + - + - - - - - - - - - - - | id: 00001012920000 title: Endpoints used by the API role: manual tags: #api #manual #reference #zettelstore syntax: zmk |
Changes to docs/manual/00001012920500.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - - + + - + + + + + + | id: 00001012920500 |
Added docs/manual/00001012920501.zettel.
|
Changes to docs/manual/00001012920503.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - - + - - - - + + + + | id: 00001012920503 |
Changes to docs/manual/00001012920510.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + - - + | id: 00001012920510 |
Changes to docs/manual/00001012920513.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + - - + | id: 00001012920513 |
Added docs/manual/00001012920516.zettel.
|
Changes to docs/manual/00001012920519.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + - - + | id: 00001012920519 |
Changes to docs/manual/00001012920522.zettel.
1 | 1 2 3 4 5 6 7 8 9 10 | - + - - + | id: 00001012920522 |
Changes to docs/manual/00001012920800.zettel.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - - + + + + | id: 00001012920800 title: Values to specify zettel parts |
Changes to domain/content.go.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - | // Package domain provides domain specific types, constants, and functions. package domain import ( "encoding/base64" "errors" |
︙ | |||
33 34 35 36 37 38 39 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - - - - - | // Set content to new string value. func (zc *Content) Set(s string) { zc.data = s zc.isBinary = calcIsBinary(s) } |
︙ |
Changes to domain/meta/meta.go.
︙ | |||
109 110 111 112 113 114 115 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - | // Supported keys. var ( KeyID = registerKey("id", TypeID, usageComputed, "") KeyTitle = registerKey("title", TypeZettelmarkup, usageUser, "") KeyRole = registerKey("role", TypeWord, usageUser, "") KeyTags = registerKey("tags", TypeTagSet, usageUser, "") KeySyntax = registerKey("syntax", TypeWord, usageUser, "") |
︙ | |||
132 133 134 135 136 137 138 | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - | KeyFolge = registerKey("folge", TypeIDSet, usageProperty, "") KeyFooterHTML = registerKey("footer-html", TypeString, usageUser, "") KeyForward = registerKey("forward", TypeIDSet, usageProperty, "") KeyHomeZettel = registerKey("home-zettel", TypeID, usageUser, "") KeyLang = registerKey("lang", TypeWord, usageUser, "") KeyLicense = registerKey("license", TypeEmpty, usageUser, "") KeyMarkerExternal = registerKey("marker-external", TypeEmpty, usageUser, "") |
︙ | |||
180 181 182 183 184 185 186 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | - + - - - - - - - - - | // Meta contains all meta-data of a zettel. type Meta struct { Zid id.Zid pairs map[string]string YamlSep bool } |
︙ |
Changes to domain/meta/parse.go.
︙ | |||
158 159 160 161 162 163 164 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | - + | switch Type(key) { case TypeString, TypeZettelmarkup: if v != "" { addData(m, key, v) } case TypeTagSet: |
︙ |
Changes to domain/meta/type.go.
︙ | |||
53 54 55 56 57 58 59 | 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 | - + + - + - - - - - + + + + + + - - - - + + - - - - + + + + + + + + + + + + + + | TypeWord = registerType("Word", false) TypeWordSet = registerType("WordSet", true) TypeZettelmarkup = registerType("Zettelmarkup", false) ) // Type returns a type hint for the given key. If no type hint is specified, // TypeUnknown is returned. |
︙ | |||
159 160 161 162 163 164 165 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | - + - - - - - - - - - | } return ListFromValue(value), true } // GetTags returns the list of tags as a string list. Each tag does not begin // with the '#' character, in contrast to `GetList`. func (m *Meta) GetTags(key string) ([]string, bool) { |
︙ |
Deleted encoder/djsonenc/djsonenc.go.
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
Added encoder/encfun/encfun.go.
|
Changes to encoder/encoder.go.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + - - + + - - + + - - - - - - + + - + - - - + + + - - + + - + - + - - + + - - + + - - - - + + + + - - + + - + + | // Package encoder provides a generic interface to encode the abstract syntax // tree into some text form. package encoder import ( "errors" |
Changes to encoder/env.go.
︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | // tree into some text form. package encoder import "zettelstore.de/z/ast" // Environment specifies all data and functions that affects encoding. type Environment struct { // Important for many encoder. LinkAdapter func(*ast.LinkNode) ast.InlineNode ImageAdapter func(*ast.ImageNode) ast.InlineNode CiteAdapter func(*ast.CiteNode) ast.InlineNode // Important for HTML encoder Lang string // default language Interactive bool // Encoded data will be placed in interactive content Xhtml bool // use XHTML syntax instead of HTML syntax MarkerExternal string // Marker after link to (external) material. NewWindow bool // open link in new window IgnoreMeta map[string]bool footnotes []*ast.FootnoteNode // Stores footnotes detected while encoding } // AdaptLink helps to call the link adapter. func (env *Environment) AdaptLink(ln *ast.LinkNode) (*ast.LinkNode, ast.InlineNode) { if env == nil || env.LinkAdapter == nil { return ln, nil } n := env.LinkAdapter(ln) if n == nil { return ln, nil } if ln2, ok := n.(*ast.LinkNode); ok { return ln2, nil } return nil, n } // AdaptImage helps to call the link adapter. func (env *Environment) AdaptImage(in *ast.ImageNode) (*ast.ImageNode, ast.InlineNode) { if env == nil || env.ImageAdapter == nil { return in, nil } n := env.ImageAdapter(in) if n == nil { return in, nil } if in2, ok := n.(*ast.ImageNode); ok { return in2, nil } return nil, n } // AdaptCite helps to call the link adapter. func (env *Environment) AdaptCite(cn *ast.CiteNode) (*ast.CiteNode, ast.InlineNode) { if env == nil || env.CiteAdapter == nil { return cn, nil } n := env.CiteAdapter(cn) if n == nil { return cn, nil } if cn2, ok := n.(*ast.CiteNode); ok { return cn2, nil } return nil, n } // IsInteractive returns true, if Interactive is enabled and currently embedded // interactive encoding will take place. func (env *Environment) IsInteractive(inInteractive bool) bool { return inInteractive && env != nil && env.Interactive } |
︙ |
Changes to encoder/htmlenc/block.go.
︙ | |||
114 115 116 117 118 119 120 | 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 | - - + + - + - + - - - + + - - + | v.lang.push(attrs) defer v.lang.pop() v.b.WriteStrings("<", code) v.visitAttributes(attrs) v.b.WriteString(">\n") |
︙ | |||
188 189 190 191 192 193 194 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + | if pn := getParaItem(item); pn != nil { if inPara { v.b.WriteByte('\n') } else { v.b.WriteString("<p>") inPara = true } |
︙ | |||
243 244 245 246 247 248 249 | 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 | - + - + - + | // writeItemSliceOrPara emits the content of a paragraph if the paragraph is // the only element of the block slice and if compact mode is true. Otherwise, // the item slice is emitted normally. func (v *visitor) writeItemSliceOrPara(ins ast.ItemSlice, compact bool) { if compact && len(ins) == 1 { if para, ok := ins[0].(*ast.ParaNode); ok { |
︙ | |||
304 305 306 307 308 309 310 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | - + - + | ast.AlignRight: " style=\"text-align:right\">", } func (v *visitor) writeRow(row ast.TableRow, cellStart, cellEnd string) { v.b.WriteString("<tr>") for _, cell := range row { v.b.WriteString(cellStart) |
︙ |
Changes to encoder/htmlenc/htmlenc.go.
︙ | |||
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 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + - + - - + + - - - + - - - + + - - - - + - - + + - + + + + - + - + - + - + - + - + | //----------------------------------------------------------------------------- // Package htmlenc encodes the abstract syntax tree into HTML5. package htmlenc import ( "io" "strings" "zettelstore.de/z/api" "zettelstore.de/z/ast" "zettelstore.de/z/domain/meta" "zettelstore.de/z/encoder" "zettelstore.de/z/encoder/encfun" "zettelstore.de/z/parser" ) func init() { encoder.Register(api.EncoderHTML, encoder.Info{ Create: func(env *encoder.Environment) encoder.Encoder { return &htmlEncoder{env: env} }, }) } type htmlEncoder struct { env *encoder.Environment } // WriteZettel encodes a full zettel as HTML5. |
Changes to encoder/htmlenc/inline.go.
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + + + + + | } } else { v.b.WriteByte('\n') } } func (v *visitor) visitLink(ln *ast.LinkNode) { ln, n := v.env.AdaptLink(ln) if n != nil { ast.Walk(v, n) return } v.lang.push(ln.Attrs) defer v.lang.pop() switch ln.Ref.State { case ast.RefStateSelf, ast.RefStateFound, ast.RefStateHosted, ast.RefStateBased: v.writeAHref(ln.Ref, ln.Attrs, ln.Inlines) case ast.RefStateBroken: |
︙ | |||
61 62 63 64 65 66 67 | 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 | - + - + - + - + - - + + + + + + + - - - - + - - + - + - - + + - + - + + - + - - - + + + + + + + + + - + - + - - + + - + | } v.b.WriteString("<a href=\"") v.writeQuotedEscaped(ln.Ref.Value) v.b.WriteByte('"') v.visitAttributes(ln.Attrs) v.b.WriteByte('>') v.inInteractive = true |
︙ | |||
194 195 196 197 198 199 200 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | - + - + - + | return default: panic(fmt.Sprintf("Unknown format kind %v", fn.Kind)) } v.b.WriteStrings("<", code) v.visitAttributes(attrs) v.b.WriteByte('>') |
︙ | |||
235 236 237 238 239 240 241 | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | - + | if withSpan { v.b.WriteString("<span") v.visitAttributes(fn.Attrs) v.b.WriteByte('>') } openingQ, closingQ := getQuotes(v.lang.top()) v.b.WriteString(openingQ) |
︙ |
Changes to encoder/htmlenc/visitor.go.
︙ | |||
13 14 15 16 17 18 19 | 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 | - - + - - - - + + + - - + | import ( "io" "sort" "strconv" "strings" |
︙ | |||
89 90 91 92 93 94 95 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - - + + | } else { v.b.WriteByte(' ') } case *ast.BreakNode: v.visitBreak(n) case *ast.LinkNode: v.visitLink(n) |
︙ | |||
112 113 114 115 116 117 118 | 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 | - + - - - - - - - - - - - - + - - + - - + - - - + + - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - | } var mapMetaKey = map[string]string{ meta.KeyCopyright: "copyright", meta.KeyLicense: "license", } |
︙ | |||
192 193 194 195 196 197 198 | 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 | - + - + | v.b.WriteString("<ol class=\"zs-endnotes\">\n") for i := 0; i < len(footnotes); i++ { // Do not use a range loop above, because a footnote may contain // a footnote. Therefore v.enc.footnote may grow during the loop. fn := footnotes[i] n := strconv.Itoa(i + 1) v.b.WriteStrings("<li id=\"fn:", n, "\" role=\"doc-endnote\">") |
︙ |
Added encoder/jsonenc/djsonenc.go.