在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):blacksmithgu/obsidian-dataview开源软件地址(OpenSource Url):https://github.com/blacksmithgu/obsidian-dataview开源编程语言(OpenSource Language):TypeScript 97.3%开源软件介绍(OpenSource Introduction):Obsidian DataviewTreat your Obsidian Vault as a database which you can query from. Provides a JavaScript API and pipeline-based query language for filtering, sorting, and extracting data from Markdown pages. See the Examples section below for some quick examples, or the full reference for all the details. ExamplesShow all games in the game folder, sorted by rating, with some metadata: ```dataview
table time-played, length, rating
from "games"
sort rating desc
``` List games which are MOBAs or CRPGs. ```dataview
list from #game/moba or #game/crpg
``` List all tasks in un-completed projects: ```dataview
task from #projects/active
``` Note: To create a task you just add Show all files in the ```dataviewjs
for (let group of dv.pages("#book").where(p => p["time-read"].year == 2021).groupBy(p => p.genre)) {
dv.header(3, group.key);
dv.table(["Name", "Time Read", "Rating"],
group.rows
.sort(k => k.rating, 'desc')
.map(k => [k.file.link, k["time-read"], k.rating]))
}
``` UsageFor a full description of all features, instructions, and examples, see the reference. For a more brief outline, let us examine the two major aspects of Dataview: data and querying. DataDataview generates data from your vault by pulling information from Markdown frontmatter and Inline fields.
Examples of both are shown below: ---
alias: "document"
last-reviewed: 2021-08-17
thoughts:
rating: 8
reviewable: false
--- # Markdown Page
Basic Field:: Value
**Bold Field**:: Nice!
You can also write [field:: inline fields]; multiple [field2:: on the same line].
If you want to hide the (field3:: key), you can do that too. QueryingOnce you've annotated documents and the like with metadata, you can then query it using any of Dataview's four query modes:
JavaScript Queries: Security NoteJavaScript queries are very powerful, but they run at the same level of access as any other Obsidian plugin. This means they can potentially rewrite, create, or delete files, as well as make network calls. You should generally write JavaScript queries yourself or use scripts that you understand or that come from reputable sources. Regular Dataview queries are sandboxed and cannot make negative changes to your vault (in exchange for being much more limited). ContributingContributions via bug reports, bug fixes, documentation, and general improvements are always welcome. For more major feature work, make an issue about the feature idea / reach out to me so we can judge feasibility and how best to implement it. Local DevelopmentThe codebase is written in TypeScript and uses foo@bar:~$ git clone [email protected]:blacksmithgu/obsidian-dataview.git
foo@bar:~$ cd obsidian-dataview
foo@bar:~/obsidian-dataview$ npm install
foo@bar:~/obsidian-dataview$ npm run dev This will install libraries, build dataview, and deploy it to Installing to Other VaultsIf you want to dogfood dataview in your real vault, you can build and install manually. Dataview is predominantly a read-only store, so this should be safe, but watch out if you are adjusting functionality that performs file edits! foo@bar:~/obsidian-dataview$ npm run build
foo@bar:~/obsidian-dataview$ ./scripts/install-built path/to/your/vault Building DocumentationWe use foo@bar:~/obsidian-dataview$ pip3 install mkdocs mkdocs-material mkdocs-redirects
foo@bar:~/obsidian-dataview$ cd docs
foo@bar:~/obsidian-dataview/docs$ mkdocs serve This will start a local web server rendering the documentation in Using Dataview Types In Your Own PluginDataview publishes TypeScript typings for all of its APIs onto NPM (as SupportHave you found the Dataview plugin helpful, and want to support it? I accept donations which go towards future development efforts. I generally do not accept payment for bug bounties/feature requests, as financial incentives add stress/expectations which I want to avoid for a hobby project! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论