ADDED .deepsource.toml Index: .deepsource.toml ================================================================== --- /dev/null +++ .deepsource.toml @@ -0,0 +1,8 @@ +version = 1 + +[[analyzers]] +name = "go" +enabled = true + + [analyzers.meta] + import_root = "github.com/zettelstore/client" Index: api/const.go ================================================================== --- api/const.go +++ api/const.go @@ -123,10 +123,11 @@ ValueSyntaxHTML = "html" ValueSyntaxMarkdown = "markdown" ValueSyntaxMD = "md" ValueSyntaxMustache = "mustache" ValueSyntaxNone = "none" + ValueSyntaxPikchr = "pikchr" ValueSyntaxSVG = "svg" ValueSyntaxText = "text" ValueSyntaxZmk = "zmk" ValueUserRoleCreator = "creator" ValueUserRoleOwner = "owner" @@ -150,11 +151,11 @@ ) // Values for HTTP query parameter. const ( QueryKeyCommand = "cmd" - QueryKeyCost = "cost" + QueryKeyDepth = "depth" QueryKeyDir = "dir" QueryKeyEncoding = "enc" QueryKeyLimit = "limit" QueryKeyPart = "part" QueryKeyPhrase = "phrase" @@ -168,20 +169,18 @@ ) // Supported encoding values. const ( EncodingHTML = "html" - EncodingMD = "md" EncodingSexpr = "sexpr" EncodingText = "text" EncodingZJSON = "zjson" EncodingZMK = "zmk" ) var mapEncodingEnum = map[string]EncodingEnum{ EncodingHTML: EncoderHTML, - EncodingMD: EncoderMD, EncodingSexpr: EncoderSexpr, EncodingText: EncoderText, EncodingZJSON: EncoderZJSON, EncodingZMK: EncoderZmk, } @@ -206,11 +205,10 @@ // Values for EncoderEnum const ( EncoderUnknown EncodingEnum = iota EncoderHTML - EncoderMD EncoderSexpr EncoderText EncoderZJSON EncoderZmk ) Index: client/client.go ================================================================== --- client/client.go +++ client/client.go @@ -477,22 +477,22 @@ ) // GetZettelContext returns metadata of the given zettel and, more important, // metadata of zettel that for the context of the first zettel. func (c *Client) GetZettelContext( - ctx context.Context, zid api.ZettelID, dir ContextDirection, cost, limit int) ( + ctx context.Context, zid api.ZettelID, dir ContextDirection, depth, limit int) ( *api.ZidMetaRelatedList, error, ) { ub := c.newURLBuilder('x').SetZid(zid) switch dir { case DirBackward: ub.AppendKVQuery(api.QueryKeyDir, api.DirBackward) case DirForward: ub.AppendKVQuery(api.QueryKeyDir, api.DirForward) } - if cost > 0 { - ub.AppendKVQuery(api.QueryKeyCost, strconv.Itoa(cost)) + if depth > 0 { + ub.AppendKVQuery(api.QueryKeyDepth, strconv.Itoa(depth)) } if limit > 0 { ub.AppendKVQuery(api.QueryKeyLimit, strconv.Itoa(limit)) } resp, err := c.buildAndExecuteRequest(ctx, http.MethodGet, ub, nil, nil) Index: www/changes.wiki ================================================================== --- www/changes.wiki +++ www/changes.wiki @@ -1,12 +1,7 @@