Giter VIP home page Giter VIP logo

Comments (10)

blacksmithgu avatar blacksmithgu commented on May 24, 2024 2

Yay, this is finally doable! Thanks to @sheeley for the implementation!

TASK WHERE contains(text, "#tag")

from obsidian-dataview.

blacksmithgu avatar blacksmithgu commented on May 24, 2024 1

I have good news and bad news. The good news is this is possible; the bad news is it requires a tiny bit of JavaScript:

```dataviewjs
dv.taskList(dv.pages("#project").file.tasks.where(t => t.text.includes("#tag")));
```

from obsidian-dataview.

blacksmithgu avatar blacksmithgu commented on May 24, 2024 1

Yes.

```dataviewjs
dv.taskList(dv.pages("#project").file.tasks.where(t => t.text.includes("#tag") && !t.completed));
```

from obsidian-dataview.

dpurnomo avatar dpurnomo commented on May 24, 2024 1

Yes.

```dataviewjs
dv.taskList(dv.pages("#project").file.tasks.where(t => t.text.includes("#tag") && !t.completed));

I notice that this will only catch if the task is without indentation. If the task is indented (like in a nested task list) it does not work for me. Perhaps a bug?

Example:

- [ ] Test task #tag → this works
    - [ ] Test task 2 #tag → This does not work

from obsidian-dataview.

blacksmithgu avatar blacksmithgu commented on May 24, 2024

Full task support with tag filtering, on-complete, and so on is upcoming. I'll also fix a few bugs with the view which may cause task checkboxes to not work properly, since you should be able to check them to check the original task...

from obsidian-dataview.

hstagner avatar hstagner commented on May 24, 2024

Is it possible to list the pages that the tasks come from as well? This works beautifully, but it is only rendering the task itself. I'd like the extra context of pages, if possible.

from obsidian-dataview.

hstagner avatar hstagner commented on May 24, 2024

It also only appears to re-render on file open. Is that a bug?

from obsidian-dataview.

hstagner avatar hstagner commented on May 24, 2024

I have good news and bad news. The good news is this is possible; the bad news is it requires a tiny bit of JavaScript:

```dataviewjs
dv.taskList(dv.pages("#project").file.tasks.where(t => t.text.includes("#tag")));

Is there a way to combine this with tasks that are not completed so that only those that are not completed show?

from obsidian-dataview.

sheeley avatar sheeley commented on May 24, 2024

@blacksmithgu looking at this, it appears we should have an in, includes, or contains function. Did you have a preference?

from obsidian-dataview.

blacksmithgu avatar blacksmithgu commented on May 24, 2024

We should add an inline in operator: 6 in [1, 2, 6], #tag in file.tags, and so on. There is already a non-inline contains(file.tags, #tag) for people who prefer that syntax, and lists will be getting a contains method later: file.tags.contains(#tag).

from obsidian-dataview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.