Progress bar for notes (Easy and powerful) with dataview

Here is a minimal example how a dataview query looks like that would automatically render the correct progress bar based on “current” and “total” pages.

TABLE WITHOUT ID
    link(file.link, title) as Title,
    author as Author,
    "<progress max=" + total + " value=" + current + "> </progress> " + round(current/total*100) + "%" as Progress
FROM #book
WHERE status = "reading"

On your book detail page you need this data:

---
tag: book
title: "Super Brain"
author: [Deepak Chopra, Rudolph E. Tanzi]
current: 172
total: 369
status: reading
---

It’s such a cool idea btw, I didn’t know that you could use a <progress> component. I highly recommend the Book Search plugin that automatically creates metadata for a book.

7 Likes