Skip to content

Commit

Permalink
0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brenan committed Mar 23, 2021
1 parent edda8f1 commit 6e1f520
Show file tree
Hide file tree
Showing 18 changed files with 690 additions and 418 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Obsidian Dataview

Treat your obsidian vault as a database which you can query from. Provides a fully-fledged query language for filtering,
sorting, and extracting data from your pages. See the Examples section below for some quick examples, or the Usage
section for a more in-detail explanation.
sorting, and extracting data from your pages. See the Examples section below for some quick examples, or the full
[reference](https://blacksmithgu.github.io/obsidian-dataview/).

## Examples

Expand Down Expand Up @@ -67,12 +67,14 @@ sort file.day desc

# Usage

**Note**: See the full documentation [here](https://blacksmithgu.github.io/obsidian-dataview/).

Dataview allows you to write queries over markdown files which can be filtered by folder, tag, and markdown YAML fields; it can then display the resulting data in various formats. All dataviews are embedded code blocks with the general form

~~~
```dataview
[list|table|task] field1, (field2 + field3) as myfield, ..., fieldN
from #tag or "folder"
from #tag or "folder" or [[link]] or outgoing([[link]])
where field [>|>=|<|<=|=|&|'|'] [field2|literal value] (and field2 ...) (or field3...)
sort field [ascending|descending|asc|desc] (ascending is implied if not provided)
```
Expand Down
6 changes: 3 additions & 3 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- [**Dataview**](README.md)
- Queries
- [Literal Values](literal-values.md)
- [Functions](functions.md)
- [Queries](queries.md)
- [Functions](functions.md)
- [Fields](fields.md)
42 changes: 42 additions & 0 deletions docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ reverse(list(1, 2, 3)) = list(3, 2, 1)
reverse(list("a", "b", "c")) = list("c", "b", "a")
```
##### `length(object|array)`
Returns the number of fields in an object, or the number of entries in an array.
```
length(list()) = 0
length(list(1, 2, 3)) = 3
length(object("hello", 1, "goodbye", 2)) = 2
```
##### `sum(array)`
Sums all numeric values in the array1
---
## String Operations
Expand All @@ -94,4 +108,32 @@ Checks if the given string matches the given pattern (using the JavaScript regex
regexmatch("\w+", "hello") = true
regexmatch(".", "a") = true
regexmatch("yes|no", "maybe") = false
```
##### `replace(string, pattern, replacement)`
Replace all instances of `pattern` in `string` with `replacement`.
```
replace("what", "wh", "h") = "hat"
replace("The big dog chased the big cat.", "big", "small") = "The small dog chased the small cat."
replace("test", "test", "no") = "no"
```
##### `lower(string)`
Convert a string to all lower case.
```
lower("Test") = "test"
lower("TEST") = "test"
```
##### `upper(string)`
Convert a string to all upper case.
```
upper("Test") = "TEST"
upper("test") = "TEST"
```
1 change: 0 additions & 1 deletion docs/literal-values.md

This file was deleted.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dataview",
"name": "Dataview",
"version": "0.1.10",
"version": "0.2.0",
"minAppVersion": "0.10.13",
"description": "Complex data views for the data-obsessed.",
"author": "Michael Brenan <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-dataview",
"version": "0.1.10",
"version": "0.2.0",
"description": "Advanced data views for Obsidian.md.",
"main": "main.js",
"scripts": {
Expand Down
Loading

0 comments on commit 6e1f520

Please sign in to comment.