Dataviewjs Snippet - Across Vault Word Count (requires MetaEdit)

While trying to figure out how to make an actual plugin I’ve been working on this behemoth of a dataview js snippet. It allows you to list pages in your vault that either contains a certain tag or were modified on a certain day and then export the data from the chart to inline fields on the page.

For the menu and button functionality to work, the MetaEdit plugin is required (can be found in community plugins search in Obsidian).

Thanks to Azulaloi in the Obsidian discord for the idea and Christian for the functionality from the MetaEdit Plugin for Obsidian.

7 Likes

How did you mange to get word , characters, sentences count in dataview plugin?

By using dataviewjs, you can use javascript inside of a dataview codeblock. From there, with some help from the code of the Better Word Count Plugin, I used RegEx to define characters and then used those to get words and sentences. Since the dataview display is essentially an array, you can put an array containing whatever you want in place of the query you would normally put after the column headers. If you are proficent with JS, the code can be found in the link at the top of the original post.

I haven’t really worked with dataview yet, but I would very much like to get such an word count across notes.

Looking at your github page, to be honest I am not entirely sure what I should do with the two code blocks. I tried wrapping them in a dataviewjs-codeblock, but that didn’t work. Would you mind explaining the setup to make the code work?

Nice snippet! Would it be possible to exclude all notes with a certain tag and count the rest of the vault?

Have you been able to work this out? It’s looking pretty intimidating as a beginner from my end.

yeah, I’ve basically written my own dataviewjs at some point.

This one works to display the wordcount of all files in a folder.