Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From v0.21.0 To trunk
2025-10-07
| ||
13:36 | Adapt to zsx changes ... (Leaf check-in: 6071c1355a user: stern tags: trunk) | |
2025-10-06
| ||
16:58 | Adapt to zsx changes ... (check-in: 78140061ec user: stern tags: trunk) | |
2025-05-02
| ||
14:34 | Remove Zid for SxnPrelude ... (check-in: b5c74e61e1 user: stern tags: trunk) | |
2025-04-17
| ||
14:58 | Version 0.21.0 ... (check-in: ef331b4f0c user: stern tags: release, trunk, v0.21.0) | |
09:21 | Update changelog ... (check-in: 6f32e74255 user: stern tags: trunk) | |
Changes to api/const.go.
︙ | |||
115 116 117 118 119 120 121 | 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 | - + + + - + - + + + | const ( CommandAuthenticated = Command("authenticated") CommandRefresh = Command("refresh") ) // Supported search operator representations. const ( |
︙ |
Changes to client/client_test.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 | - + - - - + - - + - - - | "t73f.de/r/zsc/api" "t73f.de/r/zsc/client" "t73f.de/r/zsc/domain/id" ) func TestZettelList(t *testing.T) { c := getClient() |
︙ |
Changes to domain/id/id.go.
︙ | |||
85 86 87 88 89 90 91 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - | // WebUI JS zettel are in the range 30000..39999 // WebUI image zettel are in the range 40000..49999 ZidEmoji = Zid(40001) // Other sxn code zettel are in the range 50000..59999 |
︙ |
Changes to domain/id/idset/idset.go.
︙ | |||
129 130 131 132 133 134 135 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | - - + + + + + + | // IntersectOrSet removes all zettel identifier that are not in the other set. // Both sets can be modified by this method. One of them is the set returned. // It contains the intersection of both, if s is not nil. // // If s == nil, then the other set is always returned. func (s *Set) IntersectOrSet(other *Set) *Set { |
︙ |
Changes to domain/meta/meta.go.
︙ | |||
142 143 144 145 146 147 148 | 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 | - - - - | KeyFolge = "folge" KeyFolgeRole = "folge-role" KeyForward = "forward" KeyLang = "lang" KeyLicense = "license" KeyModified = "modified" KeyPrecursor = "precursor" |
︙ | |||
275 276 277 278 279 280 281 | 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 | + - + + + + + + + + + + + + - - - - - - + + + + + + + - - + + | } } // SetNonEmpty stores the given value under the given key, if the value is non-empty. // An empty value will delete the previous association. func (m *Meta) SetNonEmpty(key string, value Value) { if value == "" { if key != KeyID { |
︙ |
Changes to domain/meta/type.go.
︙ | |||
90 91 92 93 94 95 96 97 98 99 100 101 102 103 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | + + | var ( cachedTypedKeys = make(map[string]*DescriptionType) mxTypedKey sync.RWMutex suffixTypes = map[string]*DescriptionType{ "-date": TypeTimestamp, "-number": TypeNumber, "-ref": TypeID, "-refs": TypeIDSet, SuffixKeyRole: TypeWord, "-time": TypeTimestamp, SuffixKeyURL: TypeURL, "-zettel": TypeID, "-zid": TypeID, "-zids": TypeIDSet, } |
︙ |
Changes to domain/meta/values.go.
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + | "iter" "slices" "strings" "time" zeroiter "t73f.de/r/zero/iter" "t73f.de/r/zsc/domain/id" "t73f.de/r/zsx" "t73f.de/r/zsx/input" ) // Value ist a single metadata value. type Value string // AsBool returns the value interpreted as a bool. |
︙ | |||
128 129 130 131 132 133 134 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | - + | ValueSyntaxJPEG = "jpeg" // Syntax: JPEG image ValueSyntaxJPG = "jpg" // Syntax: PEG image ValueSyntaxMarkdown = "markdown" // Syntax: Markdown / CommonMark ValueSyntaxMD = "md" // Syntax: Markdown / CommonMark ValueSyntaxNone = "none" // Syntax: no syntax / content, just metadata ValueSyntaxPlain = "plain" // Syntax: plain text ValueSyntaxPNG = "png" // Syntax: PNG image |
︙ |
Changes to go.mod.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 | - + - - - - - + + + + + | module t73f.de/r/zsc |
Changes to go.sum.
| 1 2 3 4 5 6 7 8 9 10 | - - - - - - - - - - + + + + + + + + + + |
|
Changes to sexp/sexp.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 | + | import ( "errors" "fmt" "sort" "t73f.de/r/sx" "t73f.de/r/sx/sxbuiltins" "t73f.de/r/zsc/api" ) // EncodeZettel transforms zettel data into a sx object. func EncodeZettel(zettel api.ZettelData) sx.Object { return sx.MakeList( sx.MakeSymbol("zettel"), |
︙ | |||
78 79 80 81 82 83 84 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | Content: contentVals[1].(sx.String).GetValue(), }, nil } // EncodeMetaRights translates metadata/rights into a sx object. func EncodeMetaRights(mr api.MetaRights) *sx.Pair { return sx.MakeList( |
︙ |
Changes to shtml/const.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 | - + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + | // // SPDX-License-Identifier: EUPL-1.2 // SPDX-FileCopyrightText: 2024-present Detlef Stern //----------------------------------------------------------------------------- package shtml |
Changes to shtml/shtml.go.
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | - + - - + - - | return nil } plist := sx.Nil() keys := a.Keys() for i := len(keys) - 1; i >= 0; i-- { key := keys[i] if key != zsx.DefaultAttribute && isValidName(key) { |
︙ | |||
121 122 123 124 125 126 127 | 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 | - + - + - - + - | if env.err != nil || len(env.endnotes) == 0 { return nil } var result sx.ListBuilder result.AddN( SymOL, |
︙ | |||
234 235 236 237 238 239 240 | 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 | - - - + - - - - - + + + + + + + + + + + + + + + + + + + - - + + | } ev.fns[symVal] = fn } func (ev *Evaluator) bindMetadata() { ev.bind(sz.SymMeta, 0, ev.evalList) evalMetaString := func(args sx.Vector, env *Environment) sx.Object { |
︙ | |||
322 323 324 325 326 327 328 329 | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | + - + | return sx.Nil() } var result sx.ListBuilder result.Add(symBLOCKQUOTE) if attrs := EvaluateAttributes(GetAttributes(args[0], env)); attrs != nil { result.Add(attrs) } isCompact := isCompactList(args[1:]) for _, elem := range args[1:] { |
︙ | |||
358 359 360 361 362 363 364 | 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | - + - + - + - + | dditem := getList(ddlst, env) result.Add(dditem.Cons(symDD)) } } return result.List() }) |
︙ | |||
428 429 430 431 432 433 434 | 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | - + - + | content := getString(args[1], env) if a.HasDefault() { content = sx.MakeString(visibleReplacer.Replace(content.GetValue())) } return evalVerbatim(a, content) }) ev.bind(zsx.SymVerbatimZettel, 0, nilFn) |
︙ | |||
459 460 461 462 463 464 465 466 | 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return func(args sx.Vector, env *Environment) sx.Object { var result sx.ListBuilder result.Add(sym) if attrs := EvaluateAttributes(GetAttributes(args[0], env)); attrs != nil { result.Add(attrs) } if len(args) > 1 { isCompact := isCompactList(args[1:]) for _, elem := range args[1:] { var itemLb sx.ListBuilder |
︙ | |||
640 641 642 643 644 645 646 | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | - + - - + | noteNum := strconv.Itoa(len(env.endnotes) + 1) noteID := ev.unique + noteNum env.endnotes = append(env.endnotes, endnoteInfo{ noteID: noteID, noteAST: args[1:], noteHx: nil, attrs: attrPlist}) hrefAttr := sx.Nil().Cons(sx.Cons(SymAttrRole, sx.MakeString("doc-noteref"))). Cons(sx.Cons(SymAttrHref, sx.MakeString("#fn:"+noteID))). |
︙ | |||
880 881 882 883 884 885 886 | 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | - - - - - - - - - | } if ev.noLinks { return result.Cons(SymSPAN) } return result.Cons(EvaluateAttributes(a)).Cons(SymA) } |
︙ | |||
928 929 930 931 932 933 934 | 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 | - + | return zsx.GetAttributes(getList(arg, env)) } // GetReference returns the reference symbol and the reference value of a reference pair. func GetReference(val sx.Object, env *Environment) (*sx.Symbol, string) { if env.err == nil { if p := getList(val, env); env.err == nil { |
︙ |
Changes to sz/ref.go.
︙ | |||
19 20 21 22 23 24 25 | 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 | - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + | "t73f.de/r/sx" "t73f.de/r/zsc/api" "t73f.de/r/zsc/domain/id" "t73f.de/r/zsx" ) |
Changes to sz/zmk/block.go.
︙ | |||
667 668 669 670 671 672 673 | 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | - + | case input.EOS: // add to table if cp.lastRow == nil { if row.IsEmpty() { return nil } cp.lastRow = sx.Cons(row.List(), nil) |
︙ | |||
739 740 741 742 743 744 745 | 739 740 741 742 743 744 745 746 747 | - + | inp.Next() } inp.Next() // consume last '}' attrs := parseBlockAttributes(inp) inp.SkipToEOL() refText := string(inp.Src[posA:posE]) ref := cp.scanReference(refText) |
Changes to sz/zmk/post-processor.go.
︙ | |||
21 22 23 24 25 26 27 | 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 | - + - + - + - + | ) var symInVerse = sx.MakeSymbol("in-verse") var symNoBlock = sx.MakeSymbol("no-block") type postProcessor struct{} |
︙ | |||
92 93 94 95 96 97 98 | 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 | - - + + - + - + - + - - + + - - + + - + - - + + - + - + - + - + - + - + | symSeparator: ignoreProcess, } } func ignoreProcess(*postProcessor, *sx.Pair, *sx.Pair) *sx.Pair { return nil } |
︙ | |||
202 203 204 205 206 207 208 | 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 | - + - + - + - + - + - - - + + + + - + - + - + - + - + - + | addtoParagraph() newElems.Add(item) } addtoParagraph() return zsx.MakeList(ln.Car().(*sx.Symbol), attrs, newElems.List()) } |
︙ | |||
394 395 396 397 398 399 400 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | - + - + - + | case '>': return zsx.AttrAlignRight, true default: return sx.MakeString(""), false } } |
︙ | |||
523 524 525 526 527 528 529 | 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | - - + + - + - + - + - + - + - + - + - + - + - + | if content, isString := sx.GetString(tail.Car()); isString && content.GetValue() != "" { return txt } } return nil } |
Changes to sz/zmk/zmk.go.
︙ | |||
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - + - - - | lastPara = cp.parseBlock(&blkBuild, lastPara) } if cp.nestingLevel != 0 { panic("Nesting level was not decremented") } var pp postProcessor |
︙ |
Changes to sz/zmk/zmk_test.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 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 | + + + - - - - + + + + + + + - - + + + + + + + - - - - - + + + + + - + - + - + - - - + + + - - + + - - + + | var parser zmk.Parser for tcn, tc := range tcs { t.Run(fmt.Sprintf("TC=%02d,src=%q", tcn, tc.source), func(st *testing.T) { st.Helper() inp := input.NewInput([]byte(tc.source)) parser.Initialize(inp) ast := parser.Parse() if got := ast.String(); tc.want != got { st.Errorf("none\nwant=%q\n got=%q", tc.want, got) } |
︙ | |||
491 492 493 494 495 496 497 | 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 | - + - + - + - + - + - + - + - + | {"E: &,?;c.", "(BLOCK (PARA (TEXT \"E: &,?;c.\")))"}, }) } func TestVerbatimZettel(t *testing.T) { t.Parallel() checkTcs(t, TestCases{ |
︙ | |||
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + | {"; abc\n: def\n\n ghi\n\n jkl", "(BLOCK (DESCRIPTION () ((TEXT \"abc\")) (BLOCK (BLOCK (PARA (TEXT \"def\")) (PARA (TEXT \"ghi\")) (PARA (TEXT \"jkl\"))))))"}, {"; abc\n:", "(BLOCK (DESCRIPTION () ((TEXT \"abc\"))) (PARA (TEXT \":\")))"}, {"; abc\n: def\n: ghi", "(BLOCK (DESCRIPTION () ((TEXT \"abc\")) (BLOCK (BLOCK (PARA (TEXT \"def\"))) (BLOCK (PARA (TEXT \"ghi\"))))))"}, {"; abc\n: def\n; ghi\n: jkl", "(BLOCK (DESCRIPTION () ((TEXT \"abc\")) (BLOCK (BLOCK (PARA (TEXT \"def\")))) ((TEXT \"ghi\")) (BLOCK (BLOCK (PARA (TEXT \"jkl\"))))))"}, // Empty description {"; abc\n: ", "(BLOCK (DESCRIPTION () ((TEXT \"abc\"))) (PARA (TEXT \":\")))"}, {"; abc\n; def\n: ghi", "(BLOCK (DESCRIPTION () ((TEXT \"abc\")) (BLOCK) ((TEXT \"def\")) (BLOCK (BLOCK (PARA (TEXT \"ghi\"))))))"}, // Empty continuation of definition {"; abc\n: def\n ", "(BLOCK (DESCRIPTION () ((TEXT \"abc\")) (BLOCK (BLOCK (PARA (TEXT \"def\"))))))"}, }) } func TestTable(t *testing.T) { t.Parallel() checkTcs(t, TestCases{ |
︙ | |||
852 853 854 855 856 857 858 | 864 865 866 867 868 869 870 871 872 873 | - + | {"::a::{.go .py}", "(BLOCK (PARA (FORMAT-SPAN ((\"class\" . \"go py\")) (TEXT \"a\"))))"}, }) } func TestTemp(t *testing.T) { t.Parallel() checkTcs(t, TestCases{ |