Project tracking(Metaedit, Dataview and Kanban)

Hi @dryice,
not sure whether you’re still looking for a solution, but I thought I’d post it anyway, as it took me a while to figure out a solution for the same question. I am not a programmer and fairly new to obsidian and dataview. What worked for me though, was to convert the YAML title using encodeURIComponent(). This works for me with YAML titles like “My perfect project”.

Here’s how I changed the code snippet from @Aonto

function projectTracker(dv, query) {
    let searchPagePaths = dv.pages(query).file.path
    
    for(let i=0; i < searchPagePaths.length; i++){
        if(dv.page(searchPagePaths[i]).Total){
                    let title = dv.page(searchPagePaths[i]).Title;
                    console
                    let total = dv.page(searchPagePaths[i]).Total;
                    let status = ((dv.page(searchPagePaths[i]).Completed / dv.page(searchPagePaths[i]).Total) * 100).toFixed();
                    const progress = "![pb|500](https://progress-bar.dev/" + status + "/?scale=" + "100" + "&title=" + encodeURIComponent(title) + "&width=400)"; 
                    dv.paragraph(progress);
                    // dv.paragraph("<br>"); 
        }
    }
} 

projectTracker(
    dv,
    "#projects" //change tag if you need
)

The Kanban YAML section looks like

---
Title: My perfect project
kanban-plugin: basic
tag: projects
Total: 2
Incomplete: 0
Completed: 2
---

The result looks like this
grafik

Hope this helps :slight_smile:

4 Likes