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:
.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:
@jsehnoutka’s script can be adapted. Just replace:
local newText = ws ..
"* [ ] " ..
rest ..
" 📅" ..
result.value
by this:
local newText = ws ..
"* [ ] " ..
rest ..
" [deadline: " ..
result.value ..
"] "
