# Who's using index.defineTag?

**URL:** https://community.silverbullet.md/t/whos-using-index-definetag/3810
**Category:** General
**Created:** [January 28, 2026, 7:38pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810 "2026-01-28T19:38:24Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 28, 2026, 7:38pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/1 "2026-01-28T19:38:24Z")

</div>

As is too often the case (I’m sorry), I’m surprised there are people that have discovered an obscure API, started using it, and if I quietly remove it things break ☹

Today: `index.defineTag`, who’s using it? And if so, what for? I’ve already removed it from the website docs, because I think I’ll soon have a replacement that (in my mind) serves more purposes, but to verify that I’d first like to hear from people who use this API and what for.

cc @deepkn

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 28, 2026, 7:40pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/2 "2026-01-28T19:40:32Z")

</div>

Ok, through search on the forums I see reference to it here: [Global page decorations in V2 - #4 by zef](https://community.silverbullet.md/t/global-page-decorations-in-v2/2185/4) (supporting pageDecorations as described there is the goal of the successor to this API).

I also see that @ChenZhu-Xie is using it here: [ABC - Accurate 🖇️ Bi-directional 🖱️ Cursor-level linking system](https://community.silverbullet.md/t/abc-accurate-bi-directional-cursor-level-linking-system/3536) but I’m not sure if this is something you’re still actively using or relying on?

---

<div class="post-metadata">

### Author: ![ChenZhu-Xie](https://community.silverbullet.md/user_avatar/community.silverbullet.md/chenzhu-xie/32/1476_2.png) [@ChenZhu-Xie](https://community.silverbullet.md/u/ChenZhu-Xie)
#### Post date: [January 29, 2026, 3:38am UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/3 "2026-01-29T03:38:32Z")

</div>

Yes, currently [ABC - Accurate 🖇️ Bi-directional 🖱️ Cursor-level linking system](https://community.silverbullet.md/t/abc-accurate-bi-directional-cursor-level-linking-system/3536) is actively using this streamlined API. It is convenient for dynamically augmenting objects with supplementary attributes and later invoking those values. Specifically, the plugin assigns an additional `_.thBlabel` property to `link` objects, which is then formatted in the `BackRefs(...)` function using `template.new[==[​[[${_.ref}|${_.thBlabel}]]​]==]`.

Historically, `add Visitimes Property` in another plugin [ABC - Adaptive Bread Crumb - #2 by ChenZhu-Xie](https://community.silverbullet.md/t/abc-adaptive-bread-crumb/3464/2) also employed this API, but its state proved ephemeral, resetting whenever SB was reopened, in contrast to the `datastore API`’s long-lived, cumulative persistence via IndexedDB. For this reason, I migrated that plugin to the datastore for ‘permanent’ key–value storage. That said, short/lightweight lifecycles can be appropriate, and the earlier plugin benefited from such behavior.

Notably, the API is not inherently transient; the clearing behavior stemmed from the use of local `Visitimes = Visitimes or 0`, which redefined the value when SB reindexed Lua blocks at launch.

Overall, (1) this API is quite convenient, (2) it is actively used, and (3) in some cases it is indispensable. Naturally, if a better alternative or an improved version emerges, the plugin can be upgraded accordingly without much difficulty.

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 29, 2026, 7:11am UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/4 "2026-01-29T07:11:17Z")

</div>

Ok, let me make this an exercise in keeping the APIs stable and taking a “slow deprecation” approach.

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 29, 2026, 2:58pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/5 "2026-01-29T14:58:00Z")

</div>

A head’s up, while I will keep the old `index.defineTag` API working, on edge it ought to be replace with this: [tag](https://silverbullet.md/API/tag)

---

<div class="post-metadata">

### Author: ![paletochen](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@paletochen](https://community.silverbullet.md/u/paletochen)
#### Post date: [January 30, 2026, 7:57am UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/6 "2026-01-30T07:57:06Z")

</div>

I’m the opposite here, I saw last night the new tag.define API and I have already implemented it, and brought back my missing “attributes” for tasks 🙂

---

<div class="post-metadata">

### Author: ![Mr.Red](https://community.silverbullet.md/user_avatar/community.silverbullet.md/mr.red/32/821_2.png) [@Mr.Red](https://community.silverbullet.md/u/Mr.Red)
#### Post date: [January 30, 2026, 8:49am UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/7 "2026-01-30T08:49:31Z")

</div>

Wanted to try the API/tag on **_2.4.1-85ac15546f15d22b1cfadcabd94aae8c0f372860_** (edge), but I can’t get it to work.

on [silverbullet.md](http://silverbullet.md) running **_2.4.1-45-g923b18eb_** seems to work. How to get this version?

PS: I don’t use `index.defineTag`

---

<div class="post-metadata">

### Author: ![paletochen](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/p/cdc98d/32.png) [@paletochen](https://community.silverbullet.md/u/paletochen)
#### Post date: [January 30, 2026, 9:58am UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/8 "2026-01-30T09:58:15Z")

</div>

I have that same version and I confirm it is working for me. I have in CONFIG:

````auto
```space-lua
tag.define {
  name = "task",
  transform = function(o)
    -- Match Deadline 📅
    local deadline = o.name:match("📅%s*(%d%d%d%d%-%d%d%-%d%d)")
    if deadline then
      o.deadline = deadline
    end
}

````

I also have a local snippet to easily type it in:

````auto
```space-lua
local snippets = {
  ["due"] = function() return "📅 " .. os.date("%Y-%m-%d") end,
}

````

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 30, 2026, 3:06pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/9 "2026-01-30T15:06:39Z")

</div>

What @paletochen mentioned regarding CONFIG is important. Tag definitions will only be active if they’re picked up _before_ indexing happens. The best way to ensure this is them in the CONFIG page, which is evaluated immediately at boot. Still thinking of ways to avoid this restriction, but for now it’s there (also in the docs I think).

---

<div class="post-metadata">

### Author: ![marcoswur](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@marcoswur](https://community.silverbullet.md/u/marcoswur)
#### Post date: [January 30, 2026, 3:17pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/10 "2026-01-30T15:17:54Z")

</div>

I think it would be interesting to apply the same solution to the item object (item.define).  
Attributes can also be used on items. I use…

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 30, 2026, 3:30pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/11 "2026-01-30T15:30:13Z")

</div>

This should work for anything including items. Note it’s always `tag.define` just with different `name`s pointing to task or item or page or whatever you like.

---

<div class="post-metadata">

### Author: ![bau](https://community.silverbullet.md/user_avatar/community.silverbullet.md/bau/32/2597_2.png) [@bau](https://community.silverbullet.md/u/bau)
#### Post date: [January 30, 2026, 7:06pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/12 "2026-01-30T19:06:40Z")

</div>

If I correctly understand the example provided in the doc relating to the deadline of a task, we assign a value to this attribute (optional) even though it does not appear in the text (I understood that this is the aim of the manipulation).

We therefore contravene the principle according to which “ **the truth is in the markdown !** ” because to reconstitute the index, the rule for assigning the value must always be present and active. Weird !

However, the same result is obtained using css rules:

```auto
.sb-attribute[data-deadline]::before {
  content: "📅 ";
  display: inline;
}
.sb-attribute[data-deadline] > .sb-list.sb-frontmatter{
  background: none;
  color: blue;
}
.sb-attribute[data-deadline] > .sb-list.sb-frontmatter.sb-atom {
    display: none;
}
.sb-attribute[data-deadline]> .sb-list.sb-frontmatter.sb-meta {
    display: none;
}

```

then, the markdown conforms to the index:

 ![deadline](https://community.silverbullet.md/uploads/default/original/2X/4/45fe522c22563f0d9d4484e76e18f0becd008862.png)

[@jsehnoutka’s script](https://community.silverbullet.md/t/interactive-task-creation-in-lua/2135) can be adapted. Just replace:

```auto
      local newText = ws ..
        "* [] " ..
        rest ..
        " 📅" ..
       result.value

```

by this:

```auto
      local newText = ws ..
        "* [] " ..
        rest ..
        " [deadline: " ..
        result.value ..
        "] "

```

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [January 31, 2026, 1:37pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/13 "2026-01-31T13:37:03Z")

</div>

> [@bau](#):
>
> If I correctly understand the example provided in the doc relating to the deadline of a task, we assign a value to this attribute (optional) even though it does not appear in the text (I understood that this is the aim of the manipulation).

It _does_ appear in the text. Your task e.g. says “📅 some-date” in there somewhere in the name, which is then parsed out and interpreted as a deadline using a regular expression.

> [@](#):
>
> We therefore contravene the principle according to which “ **the truth is in the markdown !** ” because to reconstitute the index, the rule for assigning the value must always be present and active. Weird !

No we don’t, the date is still there in the markdown. I suppose the phrase should be “the truth is _encoded_ in the markdown”

---

<div class="post-metadata">

### Author: ![bau](https://community.silverbullet.md/user_avatar/community.silverbullet.md/bau/32/2597_2.png) [@bau](https://community.silverbullet.md/u/bau)
#### Post date: [January 31, 2026, 4:03pm UTC](https://community.silverbullet.md/t/whos-using-index-definetag/3810/14 "2026-01-31T16:03:22Z")

</div>

I understand what you say. And yes, “📅 some-date” can parsed using a regular expession to reconstruct the value of the “deadline” attribute.

So, for me, the problem is that some attributes will be encoded with the standard schema ([:]) and others will be “encoded” in fancy non-standardized strings (eg: why not adopt another emoji to mark the deadline ?).

If I’m embarrassed, it’s not because I’m using Task Explorer (admittedly, the filter cannot work correctly since the attribute is only identifiable in the text if you know the code used: emoji, … but the problem is minor). It’s more out of principle.

To summarize, if the encoding is done only on display (for example, with css), no problem. But, if it is the data itself that is transformed, I fear that the basic principle will be transgressed.

It seems to me that an attribute must be normalized, like a tag.

(I hope I understand how it works; if not, my apologies)
