https://github.com/torantine/obsidian-snippets
https://github.com/torantine/obsidian-snippets
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/torantine/obsidian-snippets
- Owner: torantine
- Created: 2021-06-14T21:27:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-24T19:54:20.000Z (about 1 year ago)
- Last Synced: 2024-08-09T02:18:51.303Z (8 months ago)
- Size: 44.9 KB
- Stars: 18
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - torantine/obsidian-snippets - (Others)
README
# obsidian-snippets
# Table of Contents
- [Dataviewjs Snippets](#Dataviewjs-Snippets)
- [Across Vault Word Count](#Across-Vault-Word-Count)
- [Tasks Containing Outlinks From Frontmatter](#Tasks-Containing-Outlinks-From-Frontmatter)
- [Templater Snippets](#Templater-Snippets)
- [Suggest Files In Folder](#Suggest-Files-In-Folder)## Dataviewjs Snippets
### Across Vault Word Count
To function properly, this snippet requires MetaEdit.
A key feature of this snippet is the use of metadata fields, in this case inline dataview fields, as variables inside of dataviewjs. Through the use of MetaEdit and elements, an inline value can be used as a variable that stores its state with the page. Additionally, the dataview table can be exported to inline fields to store the data on the page.
Features:
- Search by tag or modified date
- Output: number of pages, modified date, page links, words, total words, characters, total characters, sentences, total sentencesKnown Bugs:
- Upon changing search type to tags, all pages cannot be chosen unless another option is chosen first.
Changelog
- v 0.0.2 the search term text in target files is no longer counted
- v 0.0.3 fixes non-space-delimited words not being counted. Thanks goes to boniall in the Obsidian discord for pointing out the issue.
- v 0.0.4 added `。!?` as defining ends of sentences and `‘ ’ “ ”` as characters able to exist after sentence end
- v 0.0.5 an empty tagToSearchFor now returns all files
- v 0.0.6 added in modified date column and the ability to export to inline fields
- v 0.0.11 added in dropdown menus, search by modified date, export sums to inline fields, dependency check for MetaEdit plugin### Tasks Containing Outlinks From Frontmatter
https://github.com/torantine/obsidian-snippets/blob/main/tasksContainingTargetOutlinks.md
## Templater Snippets
### Suggest Files In Folder
Use this snippet in a templater js template to pop up a suggester with a list of files from a speficified folder. Change the placeholder text "FOLDER/SUBFOLDER/" to the folder path you want to suggest files from. The `inFolderSuggester` const will contain a string with the file chosen by the user.