Index: README.md
==================================================================
--- README.md
+++ README.md
@@ -21,6 +21,6 @@
The software, including the manual, is licensed
under the [European Union Public License 1.2 (or
later)](https://zettelstore.de/home/file?name=LICENSE.txt&ci=trunk).
-[Stay tuned](https://twitter.com/zettelstore) …
+[Stay tuned](https://twitter.com/zettelstore)…
Index: VERSION
==================================================================
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
-0.6.0
+0.5.0
Index: ast/ast.go
==================================================================
--- ast/ast.go
+++ ast/ast.go
@@ -82,8 +82,7 @@
RefStateSelf // Reference to same zettel with a fragment
RefStateFound // Reference to an existing internal zettel, URL is ajusted
RefStateBroken // Reference to a non-existing internal zettel
RefStateHosted // Reference to local hosted non-Zettel, without URL change
RefStateBased // Reference to local non-Zettel, to be prefixed
- RefStateSearch // Reference to a zettel search
RefStateExternal // Reference to external material
)
Index: ast/ref.go
==================================================================
--- ast/ref.go
+++ ast/ref.go
@@ -10,26 +10,20 @@
package ast
import (
"net/url"
- "strings"
"zettelstore.de/z/domain/id"
)
-// SearchPrefix is the prefix that denotes a search expression.
-const SearchPrefix = "search:"
-
// ParseReference parses a string and returns a reference.
func ParseReference(s string) *Reference {
- if s == "" || s == "00000000000000" {
+ switch s {
+ case "", "00000000000000":
return &Reference{URL: nil, Value: s, State: RefStateInvalid}
}
- if strings.HasPrefix(s, SearchPrefix) {
- return &Reference{URL: nil, Value: s[len(SearchPrefix):], State: RefStateSearch}
- }
if state, ok := localState(s); ok {
if state == RefStateBased {
s = s[1:]
}
u, err := url.Parse(s)
@@ -71,13 +65,10 @@
// String returns the string representation of a reference.
func (r Reference) String() string {
if r.URL != nil {
return r.URL.String()
}
- if r.State == RefStateSearch {
- return SearchPrefix + r.Value
- }
return r.Value
}
// IsValid returns true if reference is valid
func (r *Reference) IsValid() bool { return r.State != RefStateInvalid }
Index: box/box.go
==================================================================
--- box/box.go
+++ box/box.go
@@ -248,22 +248,28 @@
func (err *ErrNotAllowed) Error() string {
if err.User == nil {
if err.Zid.IsValid() {
return fmt.Sprintf(
"operation %q on zettel %v not allowed for not authorized user",
- err.Op, err.Zid)
+ err.Op,
+ err.Zid.String())
}
return fmt.Sprintf("operation %q not allowed for not authorized user", err.Op)
}
if err.Zid.IsValid() {
return fmt.Sprintf(
"operation %q on zettel %v not allowed for user %v/%v",
- err.Op, err.Zid, err.User.GetDefault(api.KeyUserID, "?"), err.User.Zid)
+ err.Op,
+ err.Zid.String(),
+ err.User.GetDefault(api.KeyUserID, "?"),
+ err.User.Zid.String())
}
return fmt.Sprintf(
"operation %q not allowed for user %v/%v",
- err.Op, err.User.GetDefault(api.KeyUserID, "?"), err.User.Zid)
+ err.Op,
+ err.User.GetDefault(api.KeyUserID, "?"),
+ err.User.Zid.String())
}
// Is return true, if the error is of type ErrNotAllowed.
func (*ErrNotAllowed) Is(error) bool { return true }
Index: box/constbox/base.css
==================================================================
--- box/constbox/base.css
+++ box/constbox/base.css
@@ -101,17 +101,17 @@
table {
border-collapse: collapse;
border-spacing: 0;
max-width: 100%;
}
- thead>tr>td { border-bottom: 2px solid hsl(0, 0%, 70%); font-weight: bold }
- tfoot>tr>td { border-top: 2px solid hsl(0, 0%, 70%); font-weight: bold }
- td {
+ th,td {
text-align: left;
padding: .25rem .5rem;
- border-bottom: 1px solid hsl(0, 0%, 85%)
}
+ td { border-bottom: 1px solid hsl(0, 0%, 85%) }
+ thead th { border-bottom: 2px solid hsl(0, 0%, 70%) }
+ tfoot th { border-top: 2px solid hsl(0, 0%, 70%) }
main form {
padding: 0 .5em;
margin: .5em 0 0 0;
}
main form:after {
@@ -197,13 +197,13 @@
.zs-error {
background-color: lightpink;
border-style: none !important;
font-weight: bold;
}
- td.left { text-align:left }
- td.center { text-align:center }
- td.right { text-align:right }
+ td.left,th.left { text-align:left }
+ td.center,th.center { text-align:center }
+ td.right,th.right { text-align:right }
.zs-font-size-0 { font-size:75% }
.zs-font-size-1 { font-size:83% }
.zs-font-size-2 { font-size:100% }
.zs-font-size-3 { font-size:117% }
.zs-font-size-4 { font-size:150% }
Index: box/constbox/info.mustache
==================================================================
--- box/constbox/info.mustache
+++ box/constbox/info.mustache
@@ -19,18 +19,10 @@
{{#Valid}}
{{Zid}}{{/Valid}}
{{^Valid}}{{Zid}}{{/Valid}}
{{/LocLinks}}
{{/HasLocLinks}}
-{{#HasSearchLinks}}
-Searches
-
-{{#SearchLinks}}
-- {{Text}}
-{{/SearchLinks}}
-
-{{/HasSearchLinks}}
{{#HasExtLinks}}
External
{{#ExtLinks}}
- {{.}}
Index: box/constbox/listzettel.mustache
==================================================================
--- box/constbox/listzettel.mustache
+++ box/constbox/listzettel.mustache
@@ -1,9 +1,6 @@
-
Index: cmd/cmd_run.go
==================================================================
--- cmd/cmd_run.go
+++ cmd/cmd_run.go
@@ -63,12 +63,12 @@
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)
- ucEvaluate := usecase.NewEvaluate(rtConfig, ucGetZettel, ucGetMeta, ucListMeta)
ucListSyntax := usecase.NewListSyntax(protectedBoxManager)
ucListRoles := usecase.NewListRoles(protectedBoxManager)
ucListTags := usecase.NewListTags(protectedBoxManager)
ucZettelContext := usecase.NewZettelContext(protectedBoxManager, rtConfig)
ucDelete := usecase.NewDeleteZettel(ucLog, protectedBoxManager)
ADDED cmd/fd_limit.go
Index: cmd/fd_limit.go
==================================================================
--- /dev/null
+++ cmd/fd_limit.go
@@ -0,0 +1,16 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+//go:build !darwin
+// +build !darwin
+
+package cmd
+
+func raiseFdLimit() error { return nil }
ADDED cmd/fd_limit_raise.go
Index: cmd/fd_limit_raise.go
==================================================================
--- /dev/null
+++ cmd/fd_limit_raise.go
@@ -0,0 +1,51 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+//go:build darwin
+// +build darwin
+
+package cmd
+
+import (
+ "fmt"
+ "syscall"
+
+ "zettelstore.de/z/kernel"
+)
+
+const minFiles = 1048576
+
+func raiseFdLimit() error {
+ var rLimit syscall.Rlimit
+ err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
+ if err != nil {
+ return err
+ }
+ if rLimit.Cur >= minFiles {
+ return nil
+ }
+ rLimit.Cur = minFiles
+ if rLimit.Cur > rLimit.Max {
+ rLimit.Cur = rLimit.Max
+ }
+ err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
+ if err != nil {
+ return err
+ }
+ err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
+ if err != nil {
+ return err
+ }
+ if rLimit.Cur < minFiles {
+ msg := fmt.Sprintf("Make sure you have no more than %d files in all your boxes if you enabled notification\n", rLimit.Cur)
+ kernel.Main.GetKernelLogger().Mandatory().Msg(msg)
+ }
+ return nil
+}
Index: cmd/main.go
==================================================================
--- cmd/main.go
+++ cmd/main.go
@@ -206,12 +206,13 @@
ok = setConfigValue(
ok, kernel.BoxService, kernel.BoxDefaultDirType,
cfg.GetDefault(keyDefaultDirBoxType, kernel.BoxDirTypeNotify))
ok = setConfigValue(ok, kernel.BoxService, kernel.BoxURIs+"1", "dir:./zettel")
+ format := kernel.BoxURIs + "%v"
for i := 1; ; i++ {
- key := kernel.BoxURIs + strconv.Itoa(i)
+ key := fmt.Sprintf(format, i)
val, found := cfg.Get(key)
if !found {
break
}
ok = setConfigValue(ok, kernel.BoxService, key, val)
@@ -263,10 +264,17 @@
}
kern := kernel.Main
var createManager kernel.CreateBoxManagerFunc
if command.Boxes {
+ err := raiseFdLimit()
+ if err != nil {
+ logger := kern.GetKernelLogger()
+ logger.IfErr(err).Msg("Raising some limitions did not work")
+ logger.Error().Msg("Prepare to encounter errors. Most of them can be mitigated. See the manual for details")
+ kern.SetConfig(kernel.BoxService, kernel.BoxDefaultDirType, kernel.BoxDirTypeSimple)
+ }
createManager = func(boxURIs []*url.URL, authManager auth.Manager, rtConfig config.Config) (box.Manager, error) {
compbox.Setup(cfg)
return manager.New(boxURIs, authManager, rtConfig)
}
} else {
@@ -301,11 +309,11 @@
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.
+// or via a simple call ``./zettelstore`` on the command line.
func runSimple() int {
if _, err := searchAndReadConfiguration(); err == nil {
return executeCommand(strRunSimple)
}
dir := "./zettel"
Index: docs/development/20210916194900.zettel
==================================================================
--- docs/development/20210916194900.zettel
+++ docs/development/20210916194900.zettel
@@ -4,12 +4,10 @@
syntax: zmk
modified: 20220309105459
# Sync with the official repository
#* ``fossil sync -u``
-# Make sure that there is no workspace defined.
-#* ``ls ..`` must not have a file ''go.work'', in no parent folder.
# Make sure that all dependencies are up-to-date.
#* ``cat go.mod``
# Clean up your Go workspace:
#* ``go run tools/build.go clean`` (alternatively: ``make clean``).
# All internal tests must succeed:
@@ -32,12 +30,11 @@
# Update files in directory ''www''
#* index.wiki
#* download.wiki
#* changes.wiki
#* plan.wiki
-# Set file ''VERSION'' to the new release version.
- It _must_ consist of three digits: MAJOR.MINOR.PATCH, even if PATCH is zero
+# Set file ''VERSION'' to the new release version
# Disable Fossil autosync mode:
#* ``fossil setting autosync off``
# Commit the new release version:
#* ``fossil commit --tag release --tag vVERSION -m "Version VERSION"``
#* **Important:** the tag must follow the given pattern, e.g. ''v0.0.15''.
Index: docs/manual/00001000000000.zettel
==================================================================
--- docs/manual/00001000000000.zettel
+++ docs/manual/00001000000000.zettel
@@ -1,11 +1,11 @@
id: 00001000000000
title: Zettelstore Manual
role: manual
tags: #manual #zettelstore
syntax: zmk
-modified: 20220803183647
+modified: 20211027121716
* [[Introduction|00001001000000]]
* [[Design goals|00001002000000]]
* [[Installation|00001003000000]]
* [[Configuration|00001004000000]]
@@ -14,10 +14,9 @@
* [[Zettelmarkup|00001007000000]]
* [[Other markup languages|00001008000000]]
* [[Security|00001010000000]]
* [[API|00001012000000]]
* [[Web user interface|00001014000000]]
-* [[Tips and Tricks|00001017000000]]
* [[Troubleshooting|00001018000000]]
* Frequently asked questions
Licensed under the EUPL-1.2-or-later.
Index: docs/manual/00001004050000.zettel
==================================================================
--- docs/manual/00001004050000.zettel
+++ docs/manual/00001004050000.zettel
@@ -1,11 +1,11 @@
id: 00001004050000
title: Command line parameters
role: manual
tags: #command #configuration #manual #zettelstore
syntax: zmk
-modified: 20220805174626
+modified: 20211124141554
Zettelstore is not just a service that provides services of a zettelkasten.
It allows to some tasks to be executed at the command line.
Typically, the task (""sub-command"") will be given at the command line as the first parameter.
@@ -24,7 +24,5 @@
* [[``zettelstore version``|00001004050400]] to display version information of Zettelstore.
* [[``zettelstore run``|00001004051000]] to start the Zettelstore service.
* [[``zettelstore run-simple``|00001004051100]] is typically called, when you start Zettelstore by a double.click in your GUI.
* [[``zettelstore file``|00001004051200]] to render files manually without activated/running Zettelstore services.
* [[``zettelstore password``|00001004051400]] to calculate data for [[user authentication|00001010040200]].
-
-To measure potential bottlenecks within the software Zettelstore, there are some [[command line flags for profiling the application|00001004059900]].
Index: docs/manual/00001006020000.zettel
==================================================================
--- docs/manual/00001006020000.zettel
+++ docs/manual/00001006020000.zettel
@@ -1,30 +1,28 @@
id: 00001006020000
title: Supported Metadata Keys
role: manual
tags: #manual #meta #reference #zettel #zettelstore
syntax: zmk
-modified: 20220810111207
+modified: 20220628111132
Although you are free to define your own metadata, by using any key (according to the [[syntax|00001006010000]]), some keys have a special meaning that is enforced by Zettelstore.
See the [[computed list of supported metadata keys|00000000000090]] for details.
Most keys conform to a [[type|00001006030000]].
; [!all-tags|''all-tags'']
-: A property (a computed values that is not stored) that contains both the value of [[''tags''|#tags]] and the value of [[''content-tags''|#content-tags]].
+: A property (a computed values that is not stored) that contains both the value of [[''tags''|#tags]] together with all [[tags|00001007040000#tag]] that are specified within the content.
; [!back|''back'']
: Is a property that contains the identifier of all zettel that reference the zettel of this metadata, that are not referenced by this zettel.
Basically, it is the value of [[''backward''|#backward]], but without any zettel identifier that is contained in [[''forward''|#forward]].
; [!backward|''backward'']
: Is a property that contains the identifier of all zettel that reference the zettel of this metadata.
References within invertible values are not included here, e.g. [[''precursor''|#precursor]].
; [!box-number|''box-number'']
: Is a computed value and contains the number of the box where the zettel was found.
For all but the [[predefined zettel|00001005090000]], this number is equal to the number __X__ specified in startup configuration key [[''box-uri-__X__''|00001004010000#box-uri-x]].
-; [!content-tags|''content-tags'']
-: A property that contains all [[inline tags|00001007040000#tag]] defined within the content.
; [!copyright|''copyright'']
: Defines a copyright string that will be encoded.
If not given, the value ''default-copyright'' from the [[configuration zettel|00001004020000#default-copyright]] will be used.
; [!credential|''credential'']
: Contains the hashed password, as it was emitted by [[``zettelstore password``|00001004051400]].
Index: docs/manual/00001007000000.zettel
==================================================================
--- docs/manual/00001007000000.zettel
+++ docs/manual/00001007000000.zettel
@@ -1,11 +1,11 @@
id: 00001007000000
title: Zettelmarkup
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
-modified: 20220810194655
+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.
Zettelmarkup supports the longevity of stored notes by providing a syntax that any person can easily read, as well as a computer.
@@ -32,8 +32,6 @@
* [[General principles|00001007010000]]
* [[Basic definitions|00001007020000]]
* [[Block-structured elements|00001007030000]]
* [[Inline-structured element|00001007040000]]
* [[Attributes|00001007050000]]
-* [[Search expressions|00001007700000]]
-* [[Summary of formatting characters|00001007800000]]
-* [[Tutorial|00001007900000]]
+* [[Summary of formatting characters|00001007060000]]
Index: docs/manual/00001007031100.zettel
==================================================================
--- docs/manual/00001007031100.zettel
+++ docs/manual/00001007031100.zettel
@@ -1,21 +1,37 @@
id: 00001007031100
title: Zettelmarkup: Transclusion
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
-modified: 20220809144920
+modified: 20220218133058
-A transclusion allows to include the content of other zettel into the current zettel.
+A transclusion allows to include the content of another zettel into the current zettel just by referencing the other zettel.
The transclusion specification begins with three consecutive left curly bracket characters (""''{''"", U+007B) at the first position of a line and ends with three consecutive right curly bracket characters (""''}''"", U+007D).
-The curly brackets delimit either a [[zettel identifier|00001006050000]] or a searched zettel list.
-
-This leads to two variants of transclusion:
-# Transclusion of the content of another zettel into the current zettel.
- This is done if you specify a zettel identifier, and is called ""zettel transclusion"".
-# Transclusion of the list of zettel references that satisfy a [[search expression|00001007700000]].
- This is called ""search transclusion"".
-
-The variants are described on separate zettel:
-* [[Zettel transclusion|00001007031110]]
-* [[Search transclusion|00001007031140]]
+The curly brackets delimit the [[zettel identifier|00001006050000]] to be included.
+
+First, the referenced zettel is read.
+If it contains some transclusions itself, these will be expanded, recursively.
+When a recursion is detected, expansion does not take place.
+Instead an error message replaces the transclude specification.
+
+An error message is also given, if the zettel cannot be read or if too many transclusions are made.
+The maximum number of transclusion can be controlled by setting the value [[''max-transclusions''|00001004020000#max-transclusions]] of the runtime configuration zettel.
+
+If everything went well, the referenced, expanded zettel will replace the transclusion element.
+
+For example, to include the text of the Zettel titled ""Zettel identifier"", just specify its identifier [[''00001006050000''|00001006050000]] in the transclude element:
+```zmk
+{{{00001006050000}}}
+```
+This will result in:
+:::example
+{{{00001006050000}}}
+:::
+
+Please note: if the referenced zettel is changed, all transclusions will also change.
+
+This allows, for example, to create a bigger document just by transcluding smaller zettel.
+
+=== See also
+[[Inline-mode transclusion|00001007040324]] does not work at the paragraph / block level, but is used for [[inline-structured elements|00001007040000]].
DELETED docs/manual/00001007031110.zettel
Index: docs/manual/00001007031110.zettel
==================================================================
--- docs/manual/00001007031110.zettel
+++ /dev/null
@@ -1,37 +0,0 @@
-id: 00001007031110
-title: Zettelmarkup: Zettel Transclusion
-role: manual
-tags: #manual #zettelmarkup #zettelstore
-syntax: zmk
-
-A zettel transclusion is specified by the following sequence, starting at the first position in a line: ''{{{zettel-identifier}}}''.
-
-When evaluated, the referenced zettel is read.
-If it contains some transclusions itself, these will be expanded, recursively.
-When a recursion is detected, expansion does not take place.
-Instead an error message replaces the transclude specification.
-
-An error message is also given, if the zettel cannot be read or if too many transclusions are made.
-The maximum number of transclusion can be controlled by setting the value [[''max-transclusions''|00001004020000#max-transclusions]] of the runtime configuration zettel.
-
-If everything went well, the referenced, expanded zettel will replace the transclusion element.
-
-For example, to include the text of the Zettel titled ""Zettel identifier"", just specify its identifier [[''00001006050000''|00001006050000]] in the transclude element:
-```zmk
-{{{00001006050000}}}
-```
-This will result in:
-:::zs-example
-{{{00001006050000}}}
-:::
-
-Please note: if the referenced zettel is changed, all transclusions will also change.
-
-This allows, for example, to create a bigger document just by transcluding smaller zettel.
-
-In addition, if a zettel __z__ transcludes a zettel __t__, but the current user is not allowed to view zettel __t__ (but zettel __z__), then the transclusion will not take place.
-To the current user, it seems that there was no transclusion in zettel __z__.
-This allows to create a zettel with content that seems to be changed, depending on the authorization of the current user.
-
-=== See also
-[[Inline-mode transclusion|00001007040324]] does not work at the paragraph / block level, but is used for [[inline-structured elements|00001007040000]].
DELETED docs/manual/00001007031140.zettel
Index: docs/manual/00001007031140.zettel
==================================================================
--- docs/manual/00001007031140.zettel
+++ /dev/null
@@ -1,30 +0,0 @@
-id: 00001007031140
-title: Zettelmarkup: Search Transclusion
-role: manual
-tags: #manual #search #zettelmarkup #zettelstore
-syntax: zmk
-modified: 20220811141604
-
-A search transclusion is specified by the following sequence, starting at the first position in a line: ''{{{search:search-expression}}}''.
-The line must literally start with the sequence ''{{{search:''.
-Everything after this prefix is interpreted as a [[search expression|00001007700000]].
-
-When evaluated, the search expression is evaluated, leading to a list of [[links|00001007040310]] to zettel, matching the search expression.
-Every link references the found zettel, with its title as link text.
-
-This list replaces the search transclusion element.
-
-For example, to include the list of all zettel with the [[all-tags|00001006020000#all-tags]] ""#search"", ordered by title specify the following search transclude element:
-```zmk
-{{{search:all-tags:#search ORDER title}}}
-```
-This will result in:
-:::zs-example
-{{{search:all-tags:#search ORDER title}}}
-:::
-
-Please note: if the referenced zettel is changed, all transclusions will also change.
-
-For example, this allows to create a dynamic list of zettel inside a zettel, maybe to provide some introductory text followed by a list of child zettel.
-
-The search will deliver only those zettel, which the current user is allowed to read.
Index: docs/manual/00001007040000.zettel
==================================================================
--- docs/manual/00001007040000.zettel
+++ docs/manual/00001007040000.zettel
@@ -1,11 +1,11 @@
id: 00001007040000
title: Zettelmarkup: Inline-Structured Elements
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
-modified: 20220809171453
+modified: 20220218131736
Most characters you type is concerned with inline-structured elements.
The content of a zettel contains is many cases just ordinary text, lightly formatted.
Inline-structured elements allow to format your text and add some helpful links or images.
Sometimes, you want to enter characters that have no representation on your keyboard.
@@ -61,5 +61,8 @@
* Two consecutive hyphen-minus characters result in an __en-dash__ character.
It is typically used in numeric ranges.
``pages 4--7`` will be rendered in HTML as: ::pages 4--7::{=example}.
Alternative specifications are: ``–``, ``&x8211``, and ``–``.
+* Three consecutive full stop characters (""''.''"", U+002E) after a space result in an horizontal ellipsis character.
+ ``to be continued ... later`` will be rendered in HTML as: ::to be continued, ... later::{=example}.
+ Alternative specifications are: ``…``, ``&x8230``, and ``…``.
Index: docs/manual/00001007040310.zettel
==================================================================
--- docs/manual/00001007040310.zettel
+++ docs/manual/00001007040310.zettel
@@ -1,36 +1,24 @@
id: 00001007040310
title: Zettelmarkup: Links
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
-modified: 20220808161918
+modified: 20220218131639
There are two kinds of links, regardless of links to (internal) other zettel or to (external) material.
Both kinds begin with two consecutive left square bracket characters (""''[''"", U+005B) and ends with two consecutive right square bracket characters (""'']''"", U+005D).
The first form provides some text plus the link specification, delimited by a vertical bar character (""''|''"", U+007C): ``[[text|linkspecification]]``.
-The text is a sequence of [[inline elements|00001007040000]].
-However, it should not contain links itself.
The second form just provides a link specification between the square brackets.
Its text is derived from the link specification, e.g. by interpreting the link specification as text: ``[[linkspecification]]``.
-=== Link specifications
The link specification for another zettel within the same Zettelstore is just the [[zettel identifier|00001006050000]].
To reference some content within a zettel, you can append a number sign character (""''#''"", U+0023) and the name of the mark to the zettel identifier.
The resulting reference is called ""zettel reference"".
-If the link specification begins with the string ''search:'', the text following this string will be interpreted as a [[search expression|00001007700000]].
-The resulting reference is called ""search reference"".
-When this type of references is rendered, it will reference a list of all zettel that fulfills the search expression.
-
-A link specification starting with one slash character (""''/''"", U+002F), or one or two full stop characters (""''.''"", U+002E) followed by a slash character,
-will be interpreted as a local reference, called ""hosted reference"".
-Such references will be interpreted relative to the web server hosting the Zettelstore.
-
-If a link specification begins with two slash characters, it will be interpreted relative to the value of [[''url-prefix''|00001004010000#url-prefix]].
-
-To specify some material outside the Zettelstore, just use an normal Uniform Resource Identifier (URI) as defined by [[RFC\ 3986|https://tools.ietf.org/html/rfc3986]].
-
-=== Other topics
-If the link references another zettel, and this zettel is not readable for the current user, because of a missing access rights, then only the associated text is presented.
+To specify some material outside the Zettelstore, just use an normal Uniform Resource Identifier (URI) as defined by [[RFC\ 3986|https://tools.ietf.org/html/rfc3986]].
+If the URL begins with the slash character (""/"", U+002F), or if it begins with ""./"" or with ""../"", i.e. without scheme, user info, and host name, the reference will be treated as a ""local reference"", otherwise as an ""external reference"".
+If the URL begins with two slash characters, it will be interpreted relative to the value of [[''url-prefix''|00001004010000#url-prefix]].
+
+The text in the second form is just a sequence of [[inline elements|00001007040000]].
Index: docs/manual/00001007040320.zettel
==================================================================
--- docs/manual/00001007040320.zettel
+++ docs/manual/00001007040320.zettel
@@ -1,11 +1,11 @@
id: 00001007040320
title: Zettelmarkup: Inline Embedding / Transclusion
role: manual
tags: #manual #zettelmarkup #zettelstore
syntax: zmk
-modified: 20220803183936
+modified: 20220218133039
To some degree, an specification for embedded material is conceptually not too far away from a specification for [[linked material|00001007040310]].
Both contain a reference specification and optionally some text.
In contrast to a link, the specification of embedded material must currently resolve to some kind of real content.
This content replaces the embed specification.
@@ -14,13 +14,12 @@
The curly brackets delimits either a reference specification or some text, a vertical bar character and the link specification, similar to a link.
One difference to a link: if the text was not given, an empty string is assumed.
The reference must point to some content, either zettel content or URL-referenced content.
-If the current user is not allowed to read the referenced zettel, the inline transclusion / embedding is ignored.
-If the referenced zettel does not exist, or is not readable because of other reasons, a [[spinning emoji|00000000040001]] is presented as a visual hint:
+If the referenced zettel does not exist, or is not readable, a [[spinning emoji|00000000040001]] is presented as a visual hint:
Example: ``{{00000000000000}}`` will be rendered as ::{{00000000000000}}::{=example}.
There are two kind of content:
# [[image content|00001007040322]],
# [[textual content|00001007040324]].
ADDED docs/manual/00001007060000.zettel
Index: docs/manual/00001007060000.zettel
==================================================================
--- /dev/null
+++ docs/manual/00001007060000.zettel
@@ -0,0 +1,42 @@
+id: 00001007060000
+title: Zettelmarkup: Summary of Formatting Characters
+role: manual
+tags: #manual #reference #zettelmarkup #zettelstore
+syntax: zmk
+modified: 20220311120759
+
+The following table gives an overview about the use of all characters that begin a markup element.
+
+|= Character :|= [[Blocks|00001007030000]] <|= [[Inlines|00001007040000]] <
+| ''!'' | (free) | (free)
+| ''"'' | [[Verse block|00001007030700]] | [[Short inline quote|00001007040100]]
+| ''#'' | [[Ordered list|00001007030200]] | [[Tag|00001007040000]]
+| ''$'' | (reserved) | (reserved)
+| ''%'' | [[Comment block|00001007030900]] | [[Comment|00001007040000]]
+| ''&'' | (free) | [[Entity|00001007040000]]
+| ''\''' | (free) | [[Computer input|00001007040200]]
+| ''('' | (free) | (free)
+| '')'' | (free) | (free)
+| ''*'' | [[Unordered list|00001007030200]] | [[strongly emphasized text|00001007040100]]
+| ''+'' | (free) | (free)
+| '','' | (free) | [[Sub-scripted text|00001007040100]]
+| ''-'' | [[Horizontal rule|00001007030400]] | ""[[en-dash|00001007040000]]""
+| ''.'' | (free) | [[Horizontal ellipsis|00001007040000]]
+| ''/'' | (free) | (free)
+| '':'' | [[Region block|00001007030800]] / [[description text|00001007030100]] | [[Inline region|00001007040100]]
+| '';'' | [[Description term|00001007030100]] | [[Small text|00001007040100]]
+| ''<'' | [[Quotation block|00001007030600]] | (free)
+| ''='' | [[Headings|00001007030300]] | [[Computer output|00001007040200]]
+| ''>'' | [[Quotation lists|00001007030200]] | [[Inserted text|00001007040100]]
+| ''?'' | (free) | (free)
+| ''@'' | [[Inline-Zettel block|00001007031200]] | [[Inline-zettel snippet|00001007040200#inline-zettel-snippet]]
+| ''['' | (reserved) | [[Linked material|00001007040300]], [[citation key|00001007040300]], [[footnote|00001007040300]], [[mark|00001007040300]]
+| ''\\'' | (blocked by inline meaning) | [[Escape character|00001007040000]]
+| '']'' | (reserved) | End of [[link|00001007040300]], [[citation key|00001007040300]], [[footnote|00001007040300]], [[mark|00001007040300]]
+| ''^'' | (free) | [[Super-scripted text|00001007040100]]
+| ''_'' | (free) | [[Emphasized text|00001007040100]]
+| ''`'' | [[Verbatim block|00001007030500]] | [[Literal text|00001007040200]]
+| ''{'' | [[Transclusion|00001007031100]] | [[Embedded material|00001007040300]], [[Attribute|00001007050000]]
+| ''|'' | [[Table row / table cell|00001007031000]] | Separator within link and [[embed|00001007040320]] formatting
+| ''}'' | End of [[Transclusion|00001007031100]] | End of embedded material, End of Attribute
+| ''~'' | [[Evaluation block|00001007031300]] | [[Deleted text|00001007040100]]
DELETED docs/manual/00001007700000.zettel
Index: docs/manual/00001007700000.zettel
==================================================================
--- docs/manual/00001007700000.zettel
+++ /dev/null
@@ -1,29 +0,0 @@
-id: 00001007700000
-title: Search expression
-role: manual
-tags: #manual #search #zettelstore
-syntax: zmk
-modified: 20220810164112
-
-A search expression allows you to search for specific zettel.
-You may select zettel based on a full-text search, based on specifc metadata values, or both.
-
-In its simplest form, a search expression just contains a string to be search for with the help of a full-text search.
-For example, the string ''syntax'' will search for all zettel containing the word ""syntax"".
-
-If you want to search for all zettel with a title containing the word ""syntax"", you must specify ''title:syntax''.
-""title"" names the [[metadata key|00001006010000]], in this case the [[supported metadata key ""title""|00001006020000#title]].
-The colon character (""'':''"") is a [[search operator|00001007705000]], in this example to specify a match.
-""syntax"" is the [[search value|00001007706000]] that must match to the value of the given metadata key, here ""title"".
-
-A search expression may contain more than one search term, such as ''title:syntax''.
-Search terms must be separated by one or more space characters, for example ''title:syntax title:search''.
-
-* [[Search terms|00001007702000]]
-* [[Search operator|00001007705000]]
-* [[Search value|00001007706000]]
-
-A search expression follows a [[formal syntax|00001007780000]].
-
-Here are some examples of search expressions, which can be used to manage a Zettelstore:
-{{{00001007790000}}}
DELETED docs/manual/00001007702000.zettel
Index: docs/manual/00001007702000.zettel
==================================================================
--- docs/manual/00001007702000.zettel
+++ /dev/null
@@ -1,69 +0,0 @@
-id: 00001007702000
-title: Search term
-role: manual
-tags: #manual #search #zettelstore
-syntax: zmk
-modified: 20220808130055
-
-A search term allows you to specify one search restriction.
-The result [[search expression|00001007700000]], which contains more than one search term, will be the applications of all restrictions.
-
-A search term can be one of the following:
-* A metadata-based search, by specifying the name of a [[metadata key|00001006010000]], followed by a [[search operator|00001007705000]], followed by an optional [[search value|00001007706000]].
-
- All zettel containing the given metadata key with a allowed value (depending on the search operator) are selected.
-
- If no search value is given, then all zettel containing the given metadata key are selected (or ignored, for a negated search operator).
-* An optional [[search operator|00001007705000]], followed by a [[search value|00001007706000]].
-
- This specifies a full-text search for the given search value.
-
- **Note:** the search value will be normalized according to Unicode NKFD, ignoring everything except letters and numbers.
- Therefore, the following search expression are essentially the same: ''"search syntax"'' and ''search syntax''.
- The first is a search expression with one search value, which is normalized to two strings to be searched for.
- The second is a search expression containing two search values, giving two string to be searched for.
-* The string ''NEGATE'' will negate (sic!) the behavior of the whole search expression.
- If it occurs multiple times, the negation will be negated.
-* The string ''ORDER'', followed by a non-empty sequence of spaces and the name of a metadata key, will specify an ordering of the result list.
- If you include the string ''REVERSE'' after ''ORDER'' but before the metadata key, the ordering will be reversed.
-
- Example: ''ORDER published'' will order the resulting list based on the publishing data, while ''ORDER REVERSED published'' will return a reversed result order.
-
- Currently, only the first term specifying the order of the resulting list will be used.
- Other ordering terms will be ignored.
-
- An explicit order field will take precedence over the random order described below.
-
-* The string ''RANDOM'' will provide a random order of the resulting list.
-
- Currently, only the first term specifying the order of the resulting list will be used.
- Other ordering terms will be ignored.
-
- A random order specification will be ignored, if there is an explicit ordering given.
-
- Example: ''RANDOM ORDER published'' will be interpreted as ''ORDER published''.
-
-* The string ''OFFSET'', followed by a non-empty sequence of spaces and a number greater zero (called ""N"").
-
- This will ignore the first N elements of the result list, based on the specified sort order.
- A zero value of N will produce the same result as if nothing was specified.
- If specified multiple times, the higher value takes precedence.
-
- Example: ''OFFSET 4 OFFSET 8'' will be interpreted as ''OFFSET 8''.
-
-* The string ''LIMIT'', followed by a non-empty sequence of spaces and a number greater zero (called ""N"").
-
- This will limit the result list to the first N elements, based on the specified sort order.
- A zero value of N will produce the same result as if nothing was specified.
- If specified multiple times, the lower value takes precedence.
-
- Example: ''LIMIT 4 LIMIT 8'' will be interpreted as ''LIMIT 4''.
-
-You may have noted that the specifications of first two items overlap somehow.
-This is resolved by the following rule:
-* A search term containing no [[search operator character|00001007705000]] is treated as a full-text search.
-* The first search operator character found in a search term divides the term into two pieces.
- If the first piece, from the beginning of the search term to the search operator character, is syntactically a metadata key, the search term is treated as a metadata-based search.
-* Otherwise, the search term is treated as a full-text search.
-
-If a term like ''ORDER'', ''ORDER REVERSE'', ''OFFSET'', or ''LIMIT'' is not followed by an appropriate value, it is interpreted as a search value for a full-text search. For example, ''ORDER 123'' will search for a zettel conatining the strings ""ORDER"" (case-insensitive) and ""123"".
DELETED docs/manual/00001007705000.zettel
Index: docs/manual/00001007705000.zettel
==================================================================
--- docs/manual/00001007705000.zettel
+++ /dev/null
@@ -1,45 +0,0 @@
-id: 00001007705000
-title: Search operator
-role: manual
-tags: #manual #search #zettelstore
-syntax: zmk
-modified: 20220811141050
-
-A search operator specifies how the comparison of a search value and a zettel should be executed.
-Every comparison is done case-insensitive, treating all uppercase letters the same as lowercase letters.
-
-The following are allowed search operator characters:
-* The exclamation mark character (""!"", U+0021) negates the meaning
-* The tilde character (""''~''"", U+007E) compares on containment (""contains operator"")
-* The greater-than sign character (""''>''"", U+003E) matches if there is some prefix (""prefix operator"")
-* The less-than sign character (""''<''"", U+003C) compares a suffix relationship (""suffix operator"")
-* The colon character (""'':''"", U+003A) specifies the __default comparison__, i.e. one of the previous comparisons.
-
- **Please note:** this operator will be changed in version 0.7.0.
- It was included to allow the transition of the previous mechanism into search expressions.
-
- With version 0.7.0, this operator will take the role of the ''=''-operator.
-* The equal sign character (""''=''"", U+003D) compares on equal words (""equal operator"")
-
- **Please note:** this operator will be removed in version 0.7.0.
- It was included to allow the transition of the previous mechanism into search expressions.
-
-Since the exclamation mark character can be combined with the other, there are 12 possible combinations:
-# ""''!''"": is an abbreviation of the ""''!:''"" operator.
-# ""'':''"": depending on the [[metadata key type|00001006030000]] one of the other operators is chosen.
- For example, a [[numeric key type|00001006033000]] will execute the equals operator, while for a [[string type|00001006033500]] a contains operator will be executed.
-
- With version 0.7.0 its meaning will be changed to that of the ''='' operator.
-# ""''!:''"": similar to the ""match operator"" above, the appropriate negated search operator will be chosen, depending on the metadata key type
-
- With version 0.7.0 its meaning will be changed to that of the ''!='' operator.
-# ""''~''"": is successful if the search value is contained in the value to be compared.
-# ""''!~''"": is successful if the search value is not contained in the value to be compared.
-# ""''=''"": is successful if the search value is equal to one word of the value to be compared.
-# ""''!=''"": is successful if the search value is not equal to any word of the value to be compared.
-# ""''>''"": is successful if the search value is a prefix of the value to be compared.
-# ""''!>''"": is successful if the search value is not a prefix of the value to be compared.
-# ""''<''"": is successful if the search value is a suffix of the value to be compared.
-# ""''!<''"": is successful if the search value is not a suffix of the value to be compared.
-# ""''''"": a missing search operator can only occur for a full-text search.
- It is equal to the ""''~''"" operator.
DELETED docs/manual/00001007706000.zettel
Index: docs/manual/00001007706000.zettel
==================================================================
--- docs/manual/00001007706000.zettel
+++ /dev/null
@@ -1,10 +0,0 @@
-id: 00001007706000
-title: Search value
-role: manual
-tags: #manual #search #zettelstore
-syntax: zmk
-modified: 20220807162031
-
-A search value specifies a value to be searched for, depending on the [[search operator|00001007705000]].
-
-A search value should be lower case, because all comparisons are done in a case-insensitive way and there are some upper case keywords planned.
DELETED docs/manual/00001007780000.zettel
Index: docs/manual/00001007780000.zettel
==================================================================
--- docs/manual/00001007780000.zettel
+++ /dev/null
@@ -1,24 +0,0 @@
-id: 00001007780000
-title: Forma syntax of search expressions
-role: manual
-tags: #manual #reference #search #zettelstore
-syntax: zmk
-modified: 20220811141423
-
-```
-SearchExpression := SearchTerm (SPACE+ SearchTerm)*.
-SearchTerm := "NEGATE"
- | SearchOperator? SearchValue
- | SearchKey SearchOperator SearchValue?
- | "RANDOM"
- | "ORDER" SPACE+ ("REVERSE" SPACE+)? SearchKey
- | "OFFSET" SPACE+ PosInt
- | "LIMIT" SPACE+ PosInt.
-SearchValue := NO-SPACE (NO-SPACE)*.
-SearchKey := MetadataKey.
-SearchOperator := '!'
- | ('!')? '=' ← removed in version 0.7.0
- | ('!')? (':' | '<' | '>').
-PosInt := '0'
- | ('1' .. '9') DIGIT*.
-```
DELETED docs/manual/00001007790000.zettel
Index: docs/manual/00001007790000.zettel
==================================================================
--- docs/manual/00001007790000.zettel
+++ /dev/null
@@ -1,17 +0,0 @@
-id: 00001007790000
-title: Useful search expressions
-role: manual
-tags: #example #manual #search #zettelstore
-syntax: zmk
-modified: 20220811141224
-
-|= Search Expression |= Meaning
-| [[search:role:configuration]] | Zettel that contains some configuration data for the Zettelstore
-| [[search:ORDER REVERSE id LIMIT 40]] | 40 recently created zettel
-| [[search:ORDER REVERSE published LIMIT 40]] | 40 recently updated zettel
-| [[search:RANDOM LIMIT 40]] | 40 random zettel
-| [[search:dead:]] | Zettel with invalid / dead links
-| [[search:backward!: precursor!:]] | Zettel that are not referenced by other zettel
-| [[search:all-tags!:]] | Zettel without any tags
-| [[search:tags!:]] | Zettel without tags that are defined within metadata
-| [[search:content-tags:]] | Zettel with tags within content
DELETED docs/manual/00001007800000.zettel
Index: docs/manual/00001007800000.zettel
==================================================================
--- docs/manual/00001007800000.zettel
+++ /dev/null
@@ -1,42 +0,0 @@
-id: 00001007800000
-title: Zettelmarkup: Summary of Formatting Characters
-role: manual
-tags: #manual #reference #zettelmarkup #zettelstore
-syntax: zmk
-modified: 20220810095559
-
-The following table gives an overview about the use of all characters that begin a markup element.
-
-|= Character :|= [[Blocks|00001007030000]] <|= [[Inlines|00001007040000]] <
-| ''!'' | (free) | (free)
-| ''"'' | [[Verse block|00001007030700]] | [[Short inline quote|00001007040100]]
-| ''#'' | [[Ordered list|00001007030200]] | [[Tag|00001007040000]]
-| ''$'' | (reserved) | (reserved)
-| ''%'' | [[Comment block|00001007030900]] | [[Comment|00001007040000]]
-| ''&'' | (free) | [[Entity|00001007040000]]
-| ''\''' | (free) | [[Computer input|00001007040200]]
-| ''('' | (free) | (free)
-| '')'' | (free) | (free)
-| ''*'' | [[Unordered list|00001007030200]] | [[strongly emphasized text|00001007040100]]
-| ''+'' | (free) | (free)
-| '','' | (free) | [[Sub-scripted text|00001007040100]]
-| ''-'' | [[Horizontal rule|00001007030400]] | ""[[en-dash|00001007040000]]""
-| ''.'' | (free) | (free)
-| ''/'' | (free) | (free)
-| '':'' | [[Region block|00001007030800]] / [[description text|00001007030100]] | [[Inline region|00001007040100]]
-| '';'' | [[Description term|00001007030100]] | (free)
-| ''<'' | [[Quotation block|00001007030600]] | (free)
-| ''='' | [[Headings|00001007030300]] | [[Computer output|00001007040200]]
-| ''>'' | [[Quotation lists|00001007030200]] | [[Inserted text|00001007040100]]
-| ''?'' | (free) | (free)
-| ''@'' | [[Inline-Zettel block|00001007031200]] | [[Inline-zettel snippet|00001007040200#inline-zettel-snippet]]
-| ''['' | (reserved) | [[Linked material|00001007040300]], [[citation key|00001007040300]], [[footnote|00001007040300]], [[mark|00001007040300]]
-| ''\\'' | (blocked by inline meaning) | [[Escape character|00001007040000]]
-| '']'' | (reserved) | End of [[link|00001007040300]], [[citation key|00001007040300]], [[footnote|00001007040300]], [[mark|00001007040300]]
-| ''^'' | (free) | [[Super-scripted text|00001007040100]]
-| ''_'' | (free) | [[Emphasized text|00001007040100]]
-| ''`'' | [[Verbatim block|00001007030500]] | [[Literal text|00001007040200]]
-| ''{'' | [[Transclusion|00001007031100]] | [[Embedded material|00001007040300]], [[Attribute|00001007050000]]
-| ''|'' | [[Table row / table cell|00001007031000]] | Separator within link and [[embed|00001007040320]] formatting
-| ''}'' | End of [[Transclusion|00001007031100]] | End of embedded material, End of Attribute
-| ''~'' | [[Evaluation block|00001007031300]] | [[Deleted text|00001007040100]]
DELETED docs/manual/00001007900000.zettel
Index: docs/manual/00001007900000.zettel
==================================================================
--- docs/manual/00001007900000.zettel
+++ /dev/null
@@ -1,9 +0,0 @@
-id: 00001007900000
-title: Zettelmarkup: Tutorial
-role: manual
-tags: #manual #tutorial #zettelmarkup #zettelstore
-syntax: zmk
-modified: 20220811135314
-
-* [[First steps|00001007903000]]: learn something about paragraphs, emphasized text, and lists.
-* [[Second steps|00001007906000]]: know about links, thematic breaks, and headings.
DELETED docs/manual/00001007903000.zettel
Index: docs/manual/00001007903000.zettel
==================================================================
--- docs/manual/00001007903000.zettel
+++ /dev/null
@@ -1,77 +0,0 @@
-id: 00001007903000
-title: Zettelmarkup: First Steps
-role: manual
-tags: #manual #tutorial #zettelmarkup #zettelstore
-syntax: zmk
-modified: 20220811122618
-
-[[Zettelmarkup|00001007000000]] allows you to leave your text as it is, at least in many situations.
-Some characters have a special meaning, but you have to enter them is a defined way to see a visible change.
-Zettelmarkup is designed to be used for zettel, which are relatively short.
-It allows to produce longer texts, but you should probably use a different tool, if you want to produce an scientific paper, to name an example.
-
-=== Paragraphs
-The most important concept of Zettelmarkup is the __paragraph__.
-Ordinary text is interpreted as part of a paragraph.
-Paragraphs are typically separated by one or more blank lines.
-
-Therefore, line endings are more or less ignored within one paragraph.
-Zettelmarkup will recognize the end of a line, and sore it as a ""soft break".
-A soft break is rendered in most cases as a space character.
-
-Within a paragraph you can style your text with [[special markup|00001007040000]].
-Some examples:
-
-|= Zettelmarkup | Rendered output | Instruction
-| ''An __emphasized__ word'' | An __emphasized__ word | Put two underscore characters before and after the text you want to emphasize
-| ''Someone uses **bold** text'' | Someone uses **bold** text | Put two asterisks before and after the text you want to see bold
-| ''He says: ""I love you!""'' | Her says: ""I love you!"" | Put two quotation mark characters before and after the text you want to quote.
-
-You probably see a principle.
-
-One nice thing about the quotation mark characters: they are rendered according to the current language.
-Examples: ""english""{lang=en}, ""french""{lang=fr}, ""german""{lang=de}, ""finnish""{lang=fi}.
-You will see later, how to change the current language.
-
-=== Lists
-Quite often, text consists of lists.
-Zettelmarkup supports different types of lists.
-The most important lists are:
-* Unnumbered lists,
-* Numbered lists.
-
-You produce an unnumbered list element by writing an asterisk character followed by a space character at the beginning of a line.
-Since a list typically consists of more than one element, the following elements will also start at their own line:
-
-```zmk
-* First item
-* Second item
-* Third item
-```
-
-This is rendered as:
-
-:::zs-example
-* First item
-* Second item
-* Third item
-:::
-
-Similar, an numbered list element begins a line with the number sign (sic!) followed by a space character:
-
-```zmk
-# First item
-# Second item
-# Third item
-```
-
-This is rendered as:
-
-:::zs-example
-# First item
-# Second item
-# Third item
-:::
-
----
-After trying out these markup elements, you might want to continue with the [[second steps|00001007906000]].
DELETED docs/manual/00001007906000.zettel
Index: docs/manual/00001007906000.zettel
==================================================================
--- docs/manual/00001007906000.zettel
+++ /dev/null
@@ -1,83 +0,0 @@
-id: 00001007906000
-title: Zettelmarkup: Second Steps
-role: manual
-tags: #manual #tutorial #zettelmarkup #zettelstore
-syntax: zmk
-modified: 20220811135024
-
-After you have [[learned|00001007903000]] the basic concepts and markup of Zettelmarkup (paragraphs, emphasized text, and lists), this zettel introduces you into the concepts of links, thematic breaks, and headings.
-
-=== Links
-A Zettelstore is much more useful, if you connect related zettel.
-If you read a zettel later, this allows you to know about the context of a zettel.
-[[Zettelmarkup|00001007000000]] allows you to specify such a connection.
-A connection can be specified within a paragraph via [[Links|00001007040310]].
-
-* A link always starts with two left square bracket characters and ends with two right square bracket characters: ''[[...]]''.
-* Within these character sequences you specify the [[zettel identifier|00001006050000]] of the zettel you want to reference: ''[[00001007903000]]'' will connect to zettel containing the first steps into Zettelmarkup.
-* In addition, you should give the link a more readable description.
- This is done by prepending the description before the reference and use the vertical bar character to separate both: ''[[First Steps|00001007903000]]''.
-
-You are not restricted to reference your zettel.
-Alternatively, you might specify an URL of an external website: ''[[Zettelstore|https://zettelstore.de]]''.
-Of course, if you just want to specify the URL, you are allowed to omit the description: ''[[https://zettelstore.de]]''
-
-|= Zettelmarkup | Rendered output | Remark
-| ''[[00001007903000]]'' | [[00001007903000]] | If no description is given, the zettel identifier acts as a description
-| ''[[First Steps|00001007903000]]'' | [[First Steps|00001007903000]] | The description should be chosen so that you are not confused later
-| ''[[https://zettelstore.de]]'' | [[https://zettelstore.de]] | A link to an external URL is rendered differently
-| ''[[Zettelstore|https://zettelstore.de]]'' | [[Zettelstore|https://zettelstore.de]] | You can use any URL your browser is able to support
-
-Again, you probably see a principle.
-
-=== Thematic Breaks
-[[And now for something completely different|https://en.wikipedia.org/wiki/And_Now_for_Something_Completely_Different]].
-
-Sometimes, you want to insert a thematic break into your text, because two paragraphs do not separate enough.
-In Zettelmarkup is is done by entering three or more hyphen-minus characters at the beginning of a new line.
-You must not include blank lines around this line, but it can be more readable if you want to look at the Zettelmarkup text.
-
-```zmk
-First paragraph.
----
-Second paragraph.
-```
-
-```zmk
-First paragraph.
-
----
-
-Second paragraph.
-```
-
-Both are rendered as:
-:::zs-example
-First paragraph.
----
-Second paragraph.
-:::
-
-Try it!
-
-This might be the time to relax a rule about paragraphs.
-You must not specify a blank line to end a paragraph.
-Any Zettelmarkup that must start at the beginning of a new line will end a previous paragraph.
-Similar, a blank line must not precede a paragraph.
-
-This applies also to lists, as given in the first steps, as well as other [[similar markup|00001007030000]] you will probably later.
-
-=== Headings
-Headings explicitly structure a zettel, similar to thematic breaks, but gives the resulting part a name.
-
-To specify a heading in Zettelmarkup, you must enter at least three equal signs, followed by a space, followed by the text of the heading.
-Everything must be one the same line.
-
-The number of equal signs determines the importance of the heading: less equal signs means more important.
-Therefore, three equal signs treat a heading as most important.
-It is a level-1 heading.
-Zettelmarkup supports up to five levels.
-To specify such a heading, you must enter seven equal signs, plus the space and the text.
-If you enter more than seven equal signs, the resulting heading is still of level 5.
-
-See the [[description of headings|00001007030300]] for more details and examples.
Index: docs/manual/00001010070200.zettel
==================================================================
--- docs/manual/00001010070200.zettel
+++ docs/manual/00001010070200.zettel
@@ -1,11 +1,11 @@
id: 00001010070200
title: Visibility rules for zettel
role: manual
tags: #authorization #configuration #manual #security #zettelstore
syntax: zmk
-modified: 20220808152359
+modified: 20220304114501
For every zettel you can specify under which condition the zettel is visible to others.
This is controlled with the metadata key [[''visibility''|00001006020000#visibility]].
The following values are supported:
@@ -40,10 +40,10 @@
If you want to show such a zettel, you must set ''expert-mode'' to true.
=== Examples
Similar to the [[API|00001012051810]], you can easily create a zettel list based on the ''visibility'' metadata key:
-| public | [[search:visibility:public]]
-| login | [[search:visibility:login]]
-| creator | [[search:visibility:creator]]
-| owner | [[search:visibility:owner]]
-| expert | [[search:visibility:expert]][^Only if [[''expert-mode''|00001004020000#expert-mode]] is enabled, this list will show some zettel.]
+| public | [[//h?visibility=public]]
+| login | [[//h?visibility=login]]
+| creator | [[//h?visibility=creator]]
+| owner | [[//h?visibility=owner]]
+| expert | [[//h?visibility=expert]][^Only if [[''expert-mode''|00001004020000#expert-mode]] is enabled, this list will show some zettel.]
Index: docs/manual/00001012000000.zettel
==================================================================
--- docs/manual/00001012000000.zettel
+++ docs/manual/00001012000000.zettel
@@ -1,11 +1,11 @@
id: 00001012000000
title: API
role: manual
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805144406
+modified: 20220627183444
The API (short for ""**A**pplication **P**rogramming **I**nterface"") is the primary way to communicate with a running Zettelstore.
Most integration with other systems and services is done through the API.
The [[web user interface|00001014000000]] is just an alternative, secondary way of interacting with a Zettelstore.
@@ -23,11 +23,11 @@
=== Zettel lists
* [[List metadata of all zettel|00001012051200]]
* [[Shape the list of zettel metadata|00001012051800]]
** [[Selection of zettel|00001012051810]]
** [[Limit the list length|00001012051830]]
-** [[Search expressions|00001012051840]] (includes content search)
+** [[Content search|00001012051840]]
** [[Sort the list of zettel metadata|00001012052000]]
* [[Map metadata values to lists of zettel identifier|00001012052400]]
=== Working with zettel
* [[Create a new zettel|00001012053200]]
Index: docs/manual/00001012051800.zettel
==================================================================
--- docs/manual/00001012051800.zettel
+++ docs/manual/00001012051800.zettel
@@ -1,15 +1,15 @@
id: 00001012051800
title: API: Shape the list of zettel metadata
role: manual
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805144809
+modified: 20211103162259
In most cases, it is not essential to list __all__ zettel.
Typically, you are interested only in a subset of the zettel maintained by your Zettelstore.
This is done by adding some query parameters to the general ''GET /j'' request.
* [[Select|00001012051810]] just some zettel, based on metadata.
* Only a specific amount of zettel will be selected by specifying [[a length and/or an offset|00001012051830]].
-* [[Specifying a search expression|00001012051840]], e.g. searching for zettel content and/or metadata, is another way of selecting some zettel.
+* [[Searching for specific content|00001012051840]], not just the metadata, is another way of selecting some zettel.
* The resulting list can be [[sorted|00001012052000]] according to various criteria.
Index: docs/manual/00001012051810.zettel
==================================================================
--- docs/manual/00001012051810.zettel
+++ docs/manual/00001012051810.zettel
@@ -1,11 +1,11 @@
id: 00001012051810
title: API: Select zettel based on their metadata
role: manual
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220811141840
+modified: 20220218133305
Every query parameter that does __not__ begin with the low line character (""_"", U+005F) is treated as the name of a [[metadata|00001006010000]] key.
According to the [[type|00001006030000]] of a metadata key, zettel are possibly selected.
All [[supported|00001006020000]] metadata keys have a well-defined type.
User-defined keys have the type ''e'' (string, possibly empty).
@@ -51,8 +51,5 @@
00001012921000 API: JSON structure of an access token
00001012920500 Formats available by the API
00001012920000 Endpoints used by the API
...
```
-=== Deprecation
-Comparisons via URL query parameter are deprecated since version 0.6.0.
-They will be removed in version 0.7.0
Index: docs/manual/00001012051840.zettel
==================================================================
--- docs/manual/00001012051840.zettel
+++ docs/manual/00001012051840.zettel
@@ -1,13 +1,17 @@
id: 00001012051840
-title: API: Shape the list of zettel metadata by specifying a search expression
+title: API: Shape the list of zettel metadata by searching the content
role: manual
-tags: #api #manual #search #zettelstore
+tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805165619
+modified: 20211124182444
+
+The query parameter ""''_s''"" allows to provide a string for a full-text search of all zettel.
+The search string will be normalized according to Unicode NKFD, ignoring everything except letters and numbers.
-The query parameter ""''_s''"" allows you to specify [[search expressions|00001007700000]] for a full-text search of all zettel content and/or restricting the search according to specific metadata.
+If you want to search in a specific way, you must apply the [[simple search syntax|00001012051890]].
+Otherwise, the content of each zettel is examined to just contain the words of the search string.
-You are allowed to specify this query parameter more than once, as well as the other query parameters.
+You are allowed to specify this query parameter more than once.
All results will be intersected, i.e. a zettel will be included into the list if all of the provided values match.
This parameter loosely resembles the search form of the [[web user interface|00001014000000]].
Index: docs/manual/00001012051890.zettel
==================================================================
--- docs/manual/00001012051890.zettel
+++ docs/manual/00001012051890.zettel
@@ -1,14 +1,11 @@
id: 00001012051890
-title: API: Comparison syntax (simple)
+title: API: Search syntax (simple)
role: manual
-tags: #api #manual #search #zettelstore
+tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220811141804
-
-By using a simple syntax for comparing metadata values, you can modify the default comparison.
-Note, this syntax is intend-fully similar to the syntax of the more general [[search operators|00001007705000]], which are part of [[search expressions|00001007700000]].
+modified: 20220218130900
If the search string starts with the exclamation mark character (""!"", U+0021), it will be removed and the query matches all values that **do not match** the search string.
In the next step, the first character of the search string will be inspected.
If it contains one of the characters ""'':''"", ""''=''"", ""''>''"", ""''<''"", or ""''~''"", this will modify how the search will be performed.
@@ -16,11 +13,13 @@
For example, assume the search string is ""def"":
; The colon character (""'':''"", U+003A) (or none of these characters)
: This is the __default__ comparison.
- The comparison chosen depends on the [[metadata key type|00001006030000]].
+ The comparison depends on the type of the underlying values.
+ For a content search, it is equal to the tilde character ""''~''"", which returns true if a word within the content just contains the search string.
+ For metadata, it depends on the key [[type|00001006030000]].
It you omit the the comparison character, the default comparison is also used.
; The tilde character (""''~''"", U+007E)
: The inspected text[^Either all words of the zettel content and/or some metadata values] contains the search string.
""def"", ""defghi"", and ""abcdefghi"" are matching the search string.
@@ -36,9 +35,5 @@
If you want to include an initial ""''!''"" into the search string, you must prefix that with the escape character ""''\\''"".
For example ""\\!abc"" will search for the string ""!abc"".
A similar rule applies to the characters that specify the way how the search will be done.
For example, ""!\\=abc"" will search for content that does not contains the string ""=abc"".
-
-=== Deprecation
-Comparisons via URL query parameter are deprecated since version 0.6.0.
-They will be removed in version 0.7.0
Index: docs/manual/00001012053900.zettel
==================================================================
--- docs/manual/00001012053900.zettel
+++ docs/manual/00001012053900.zettel
@@ -1,11 +1,11 @@
id: 00001012053900
title: API: Retrieve unlinked references to an existing zettel
role: manual
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805144656
+modified: 20220202112528
The value of a personal Zettelstore is determined in part by explicit connections between related zettel.
If the number of zettel grow, some of these connections are missing.
There are various reasons for this.
Maybe, you forgot that a zettel exists.
@@ -52,12 +52,11 @@
````
# curl 'http://127.0.0.1:23123/u/00001007000000?phrase=markdown'
{"id": "00001007000000","meta": {...},"list": [{"id": "00001008010000","meta": {...},"rights":62},{"id": "00001004020000","meta": {...},"rights":62}]}
````
-In addition, you are allowed to specify all query parameter to [[select zettel based on their metadata|00001012051810]], to [[limit the length of the returned list|00001012051830]], and to [[sort the returned list|00001012052000]].
-You are allowed to limit the search by a [[search expression|00001012051840]], which may search for zettel content.
+In addition, you are allowed to specify all query parameter to [[select zettel based on their metadata|00001012051810]], to [[limit the length of the returned list|00001012051830]], and to [[sort the returned list|00001012052000]]. You are allowed to limit the search only for those zettel with some [[specific content|00001012051840]].
=== Keys
The following top-level JSON keys are returned:
; ''id''
: The [[zettel identifier|00001006050000]] for which the unlinked references were requested.
Index: docs/manual/00001012070500.zettel
==================================================================
--- docs/manual/00001012070500.zettel
+++ docs/manual/00001012070500.zettel
@@ -1,11 +1,11 @@
id: 00001012070500
title: Retrieve administrative data
-role: manual
+role: zettel
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805174216
+modified: 20220304174027
The [[endpoint|00001012920000]] ''/x'' allows you to retrieve some (administrative) data.
Currently, you can only request Zettelstore version data.
Index: docs/manual/00001012080100.zettel
==================================================================
--- docs/manual/00001012080100.zettel
+++ docs/manual/00001012080100.zettel
@@ -1,11 +1,11 @@
id: 00001012080100
title: API: Execute commands
-role: manual
+role: zettel
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805174227
+modified: 20220103225956
The [[endpoint|00001012920000]] ''/x'' allows you to execute some (administrative) commands.
To differentiate between the possible commands, you have to set the query parameter ''_cmd'' to a specific value:
; ''authenticated''
Index: docs/manual/00001012080200.zettel
==================================================================
--- docs/manual/00001012080200.zettel
+++ docs/manual/00001012080200.zettel
@@ -1,11 +1,11 @@
id: 00001012080200
title: API: Check for authentication
-role: manual
+role: zettel
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805174236
+modified: 20220103235531
API clients typically wants to know, whether [[authentication is enabled|00001010040100]] or not.
If authentication is enabled, they present some form of user interface to get user name and password for the actual authentication.
Then they try to [[obtain an access token|00001012050200]].
If authentication is disabled, these steps are not needed.
Index: docs/manual/00001012080500.zettel
==================================================================
--- docs/manual/00001012080500.zettel
+++ docs/manual/00001012080500.zettel
@@ -1,11 +1,11 @@
id: 00001012080500
title: API: Refresh internal data
-role: manual
+role: zettel
tags: #api #manual #zettelstore
syntax: zmk
-modified: 20220805174246
+modified: 20211230234431
Zettelstore maintains some internal data to allow faster operations.
One example is the [[content search|00001012051840]] for a term: Zettelstore does not need to scan all zettel to find all occurrences for the term.
Instead, all word are stored internally, with a list of zettel where they occur.
DELETED docs/manual/00001017000000.zettel
Index: docs/manual/00001017000000.zettel
==================================================================
--- docs/manual/00001017000000.zettel
+++ /dev/null
@@ -1,20 +0,0 @@
-id: 00001017000000
-title: Tips and Tricks
-role: manual
-tags: #manual #zettelstore
-syntax: zmk
-modified: 20220805174255
-
-=== Welcome Zettel
-* **Problem:** You want to put your Zettelstore into the public and need a starting zettel for your users.
- In addition, you still want a ""home zettel"", with all your references to internal, non-public zettel.
- Zettelstore only allows to specify one [[''home-zettel''|00001004020000#home-zettel]].
-* **Solution:**
-*# Create a new zettel with all your references to internal, non-public zettel.
- Let's assume this zettel receives the zettel identifier ''20220803182600''.
-*# Create the zettel that should serve as the starting zettel for your users.
- It must have syntax [[Zettelmarkup|00001008000000#zmk]], i.e. the syntax metadata must be set to ''zmk''.
- If needed, set the runtime configuration [[''home-zettel|00001004020000#home-zettel]] to the value of the identifier of this zettel.
-*# At the beginning of the start zettel, add the following [[Zettelmarkup|00001007000000]] text in a separate paragraph: ``{{{20220803182600}}}`` (you have to adapt to the actual value of the zettel identifier for your non-public home zettel).
-* **Discussion:** As stated in the description for a [[transclusion|00001007031100]], a transclusion will be ignored, if the transcluded zettel is not visible to the current user.
- In effect, the transclusion statement (above paragraph that contained ''{{{...}}}'') is ignored when rendering the zettel.
Index: docs/manual/00001018000000.zettel
==================================================================
--- docs/manual/00001018000000.zettel
+++ docs/manual/00001018000000.zettel
@@ -1,11 +1,11 @@
id: 00001018000000
title: Troubleshooting
-role: manual
+role: zettel
tags: #manual #zettelstore
syntax: zmk
-modified: 20220805174305
+modified: 20220218125940
This page lists some problems and their solutions that may occur when using your Zettelstore.
=== Installation
* **Problem:** When you double-click on the Zettelstore executable icon, macOS complains that Zettelstore is an application from an unknown developer.
Index: domain/meta/meta_test.go
==================================================================
--- domain/meta/meta_test.go
+++ domain/meta/meta_test.go
@@ -1,9 +1,9 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2020-2022 Detlef Stern
//
-// This file is part of Zettelstore.
+// 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.
//-----------------------------------------------------------------------------
@@ -38,15 +38,15 @@
}
func TestTitleHeader(t *testing.T) {
t.Parallel()
m := New(testID)
- if got, ok := m.Get(api.KeyTitle); ok && got != "" {
+ if got, ok := m.Get(api.KeyTitle); ok || got != "" {
t.Errorf("Title is not empty, but %q", got)
}
addToMeta(m, api.KeyTitle, " ")
- if got, ok := m.Get(api.KeyTitle); ok && got != "" {
+ if got, ok := m.Get(api.KeyTitle); ok || got != "" {
t.Errorf("Title is not empty, but %q", got)
}
const st = "A simple text"
addToMeta(m, api.KeyTitle, " "+st+" ")
if got, ok := m.Get(api.KeyTitle); !ok || got != st {
Index: domain/meta/parse.go
==================================================================
--- domain/meta/parse.go
+++ domain/meta/parse.go
@@ -151,10 +151,14 @@
// 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:
Index: domain/meta/parse_test.go
==================================================================
--- domain/meta/parse_test.go
+++ domain/meta/parse_test.go
@@ -54,10 +54,15 @@
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 {
@@ -72,11 +77,10 @@
{"% 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"}}},
- {"new-title:\nnew-url:", []meta.Pair{{"new-title", ""}, {"new-url", ""}}},
}
for i, tc := range testcases {
meta := parseMetaStr(tc.input)
if got := meta.Pairs(); !equalPairs(tc.exp, got) {
t.Errorf("TC=%d: expected=%v, got=%v", i, tc.exp, got)
Index: encoder/encoder_inline_test.go
==================================================================
--- encoder/encoder_inline_test.go
+++ encoder/encoder_inline_test.go
@@ -124,11 +124,11 @@
{
descr: "Quotes formatting (german)",
zmk: `""quotes""{lang=de}`,
expect: expectMap{
encoderZJSON: `[{"":"Quote","a":{"lang":"de"},"i":[{"":"Text","s":"quotes"}]}]`,
- encoderHTML: `quotes
`,
+ encoderHTML: `quotes
`,
encoderSexpr: `((FORMAT-QUOTE (("lang" "de")) (TEXT "quotes")))`,
encoderText: `quotes`,
encoderZmk: `""quotes""{lang="de"}`,
},
},
@@ -168,11 +168,11 @@
{
descr: "HTML in Code formatting",
zmk: "``