buttons icon indicating copy to clipboard operation
buttons copied to clipboard

Relative or searchable line numbers

Open holroy opened this issue 2 years ago • 0 comments

I'm using a button to forcefully refresh a dataviewjs query like the following:

```button
name Refresh
type line(8) text
action ```dataviewjs
replace [8,8]
```

This button works beautifully in that given file with those given line numbers. But I'm missing an option (or just don't know how to do it) to make the button work related to its defintion. I would love some syntax like the following:

```button
name Refresh
type line(+1) text
action ```dataviewjs
replace [+1,+1]
```

Where +1 would refer to the first line after the button, (and potentially -1 would refer to the line in front of the button). Such a syntax would also allow for the button to replace stuff like: [+1, 1000] which essentially would replace the rest of the file.

An alternate syntax (which would be nice but maybe harder to implement), would be something like [/%%pre%%/,/%%post%%/] which would do a search for %%pre%% and %%post%% and replace everything between those line numbers.


Are either of these possible in the current situation, with just me not knowing the correct syntax, or would it be possible to implement either (or both) of them?

holroy avatar Feb 18 '23 14:02 holroy