obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.

MIT License

Stars
6.9K
Committers
112

Bot releases are hidden (Show)

obsidian-dataview - 0.4.12-hotfix1

Published by blacksmithgu about 3 years ago

0.4.12-hotfix1

Re-release of 0.4.12 that fixes an important indexing issue.

  • Fix #505: Use completion instead of completed when setting task completion time.
  • Fix #509: Add startswith / endswith string functions.
  • Fix #488: Add padleft and padright, and string.
  • Fix #506, #512: Fix date comparisons due to a bizarre date zone issue.
obsidian-dataview - 0.4.11

Published by blacksmithgu about 3 years ago

0.4.11

Fixes task behavior and adds "truly inline" fields!

Improved Task Behavior

Task queries are now much improved from their primitive foundations - you can now filter, sort, and group them! The FROM
block is still page-based, sadly, though you can simply use WHERE instead if desired. For example, you can now access
task fields like text, line, or completed:

TASK WHERE contains(text, "#tag")
WHERE !completed
GROUP BY file.folder

The full list of all available task metadata can be found
here; tasks include all the information
needed to uniquely identify them, and automatically inherit all of the metadata from their parent file as well (so you
can access file.name, for example). You can also annotate tasks with inline fields, as described in the section below.

There is some additional UX work to be done - primarily on more easily allowing you to navigate to where the task is
defined, as well as render tasks in views other than the TASK view. The semantics of how grouping works (to make it
more intuitive/useful than it currently is) will likely also be revisited.

Inline Inline Fields

Early support for truly inline fields have been added, where you can add metadata in the middle of a sentence. It looks
similar to existing inline field syntax, but with brackets or parenthesis:

I would rate this a [rating:: 6]. It was (thoughts:: acceptable).

Improved rendering for all inline fields is coming in an unpcoming update to improve the visual look of these inline
fields.

Issues

  • Fix #496: Fix task SORT functionality to do something.
  • Fix #492: Tasks now properly annotated with parent file information.
  • Fix #498: Fix task checking/unchecking logic (which broke due to a change in the task regex...).
obsidian-dataview - 0.4.10

Published by blacksmithgu about 3 years ago

0.4.10

I'm not sure how I did it, but I broke the GitHub release UI, so a new release it is! This one with a correct tag.

obsidian-dataview - 0.4.9

Published by blacksmithgu about 3 years ago

0.4.9

Tiny bugfix release; fixes #477, by making dv.paragraph actually produce a paragraph element. Also includes fixes for
DataArray#limit and DataArray#mutate.

obsidian-dataview - 0.4.8

Published by blacksmithgu about 3 years ago

Bugfix release which improves emoji parsing in tags and strings.

obsidian-dataview - 0.4.7

Published by blacksmithgu about 3 years ago

0.4.7

Tiny bugfix release which fixes date parsing causing pages to not index properly. Turns out the Luxon DateTime API made
questionable choices with DateTime.toObject() and DateTime.fromObject()!

obsidian-dataview - 0.4.6

Published by blacksmithgu about 3 years ago

0.4.6

Task feature release, and general bugfix release which fixes some performance issues due to a bad CSV implementation,
adds asynchronous script support, and fixes some performance issues for DataviewJS.

Task Improvements

Thanks to @sheeley, Dataview is finally getting some task query improvements! It is frankly still really janky, but much
more usable. TASK queries can now filter over tasks instead of just pages in the WHERE, SORT, and GROUP BY
statements. So things like:

TASK WHERE !completed

Or

TASK WHERE contains(text, "haha")

Are now possible. Note that FROM statements in task queries still select based on pages for now until we finish the
revamp, so

TASK FROM #tag

will still select tasks from pages with the given tag. That being said, you can select tasks with the given tag via a
quick TASK WHERE contains(text, "#tag").

More improvements and general performance upgrades for task queries are already in the works, and should be available in
0.4.7.

Asynchronous CSV Loading

Dataview now properly loads CSVs on-demand and asynchronously, instead of trying to index them all when Dataview starts
up (which is bad and horridly slow). This will fix performance problems for people who have lots of CSV files, though
the downside is that the JavaScript API dv.csv call has been made asynchronous and moved to a sub-api. If you want to
load CSV files in DataviewJS, use

let data = await dv.io.csv("path");

The API supports local files in the vault OR files that can be fetched via AJAX (so http, https):

let data = await dv.io.csv("https://some.domain.com/thing.csv");

DataviewJS blocks have been updated to automatically support asynchronous calls, so you can now use await and async.

Bug Fixes

  • Improve #118, #32: Better emoji regex matching

  • Improve #454: Revert link comparison behavior to default

  • Improve #462: Don't render unrecognized classes

    Prevents some freezes if you have a preview window open and try to
    render $= dv or something.

    Also adds a few more nice functions like min and max.

  • Improve #462: Add max render depth for values to avoid freezes

obsidian-dataview - 0.4.5

Published by blacksmithgu about 3 years ago

0.4.5

Bugfix release which includes a few minor features, and documentation improvements. This includes a few breaking changes
which align Dataview more closely with Obsidian preferences, especially around links.

Breaking Change: Frontmatter Links

As per Obsidian recommendation from Licat, Dataview now expects frontmatter links to be quoted. I.e.,

link: "[[Link]]"

Instead of

link: [[Link]]

This resolves a long-standing parse ambiguity error in frontmatter which was hurting people who preferred to use
frontmatter over inline fields. Note that inline fields are unaffected.

(Potentially) Breaking Change: Function Vectorization

A secretive and poorly-documented feature of Dataview allows you to call functions vectorized, where you can pass them
lists of arguments instead of single arguments, and the function will be applied to every element in the list.

If you tried to call a vectorized function with multiple list arguments, it would expand them quadratically before (a
cartesian product). It now expands linearly, where the function will be applied to the first argument of each list,
then the second, and so on. This should make vectorization more usable, especially when doing operations on GROUP BY.

I.e.,

# Before
replace(["hello", "jello"], "ello", ["a", "b"]) = [["ha", "ja"], ["hb", "jb"]]

# After
replace(["hello", "jello"], "ello", ["a", "b"]) = ["ha", "jb"]

More work on vectorization and how it interacts with variable indexing will follow in the future.

Development Experience

The documentation has been updated with instructions on how to build and use Dataview locally; thanks to @sheeley for
adding hot-reloading of the plugin and a test-vault.

Dataview types and utility libraries are now also available on npm as blacksmithhgu/obsidian-dataview; they are
updated every time dataview is updated.

The codebase now uses Prettifier for a consistent formatting experience (even if it does wierd things sometimes I wish
it wouldn't do).

Misc. Bugfixes

  • Fix #213: Use a more permissive task parsing bailout which fixes subtasks not showing up.
  • Fix #385: replace() replaces all instances.
  • Fix #415: Only add markdown files to prefix index
  • Fix #310: Sort links by display name, fixing simple date comparisons
  • Fix #440: Add LIST WITHOUT ID.
  • Fix #401: Restore original behavior of [[]].
  • Fix #375: Add WITHOUT ID for lists.
  • Fix #344: Add containsword(), which is a case-insensitive contains which checks for exact word matches.
  • Fix #419: Improve docs around link indexing
obsidian-dataview - 0.4.4

Published by blacksmithgu about 3 years ago

0.4.4

Feature release with some bugfixes for flatten and group by.

Lambdas

Adds basic lambda support to the dataview query language along with some functions which accept it. Lambdas have the
form (arg1, arg2, ...) => expression; for example:

(x) => x + 2
(tag) => contains(tag, "yes")
(a, b) => a + b

The following methods have been updated to support lambdas:

  • any(list, lambda): Returns true if the lambda returns true for any value in the list.
  • all(list, lambda): Returns true if the lambda returns true for all values in the list.
  • none(list, lambda): Returns true if the lambda returns true for no values in the list.
  • map(list, lambda): Returns a new list where the lambda has been applied to each element.
  • filter(list, lambda): Returns a new list consisting only of elements that the lambda returned true for.

Primitive Lists & Objects

You can write lists using a primitive JavaScript-like syntax: [1, 2, 3]; you can additionally write objects using a
primitive JavaScript-like syntax: { key1: value1, key2: value2 }. These are mostly useful for complicated sort and
equality checks, though will be more useful in the future as subqueries and complex FROM statements are added.

Bugs

  • #378: Fixes some list rendering.
  • #398: Fixes issues with the FLATTEN statement.
obsidian-dataview - 0.4.3

Published by blacksmithgu about 3 years ago

This is a bugfix release which also includes a few highly requested QOL features.

Timezone Date Support

Dataview now supports dates with milliseconds (HH:MM:ss.mmm), as well as dates with
timezones (HH:MM:ssZ or HH:MM:ss+6:30).

Fixed CSV Support

Several performance issues and bugs related to csv support have been fixed; you can query from a csv file via

TABLE WITHOUT ID field1, field2, ... FROM csv("path/to/file.csv")

Removing the 'File' field

You can remove the default 'File' or 'GROUP' fields now using the 'WITHOUT ID' qualifier in a table query:

TABLE WITHOUT ID ... FROM
...

Custom Date Formats

You can now specify the default date format that dataview should use everywhere in the settings. You can also
use custom formatting inside of the query language with the new dateformat(date, "...format...") function.

Index Fixes

Several issues with files not properly reloading due to renames or deletions have been fixed.

obsidian-dataview - 0.4.2

Published by blacksmithgu about 3 years ago

Adds support for simple queries from CSV, as well as custom dataviews, and a few bugfixes.

CSV Queries

You can query data from CSV files using the csv() modifier:

TABLE file.name, field, field2 FROM csv("file.csv")

Which will select "field" and "field2" from CSV. You can select from multiple CSVs:

TABLE file.name, field, field2 FROM csv("file.csv") or csv("file2.csv")

Custom Dataviews

You can now create custom dataviews for usage in DataviewJS (available through dv.view()). The function can be used as
such: dv.view("path/to/view", input). A custom view is a folder containing view.js, which should be JS code that
will be loaded and provided with the dv object and your input argument. For example, a trivial view which renders
whatever 'input' is:

test-view/view.js:

console.log("hi!");
dv.paragraph(input);

You could then execute this view using dv.view("test-view", 16); in another dataview. Views can also include CSS files
in the same folder (like test-view/view.css), which will be applied when the view is rendered.

Automatic Build/Testing on GitHub

Mostly useful for development, but all commits and pull request are now checked that they properly build and commit.

Bugfixes

  • #160: Better emoji handling.
  • #327: Fix GROUP BY behavior.
  • #339: You can now disable DataviewJS codeblocks.
obsidian-dataview - 0.4.1

Published by blacksmithgu over 3 years ago

Hotfix release which corrects spurious scary-looking error messages, as well as link comparisons and usage of this in
queries. Fixes #323, #324.

obsidian-dataview - 0.4.0

Published by blacksmithgu over 3 years ago

Major internal refactor, but which includes several nice new bugfixes!

  • Much better refreshing logic, so views should properly refresh when dataview starts up.
  • Indexing has been moved to several background worker threads, improving performance and preventing dataview from
    causing frontend freezes.
  • Dataview Inline JS! Use $= <js> to evaluate an inline JS expression. You have access to dv, like in DataviewJS.
obsidian-dataview - 0.3.13

Published by blacksmithgu over 3 years ago

Various small bugfixes:

  • #265: join now works on single values.
  • #262: Remove limiation on how long fields can be.
  • #253: Fix (most) cases of emoji messing up field names.
  • #263: Index now properly updates on renames and deletes.
obsidian-dataview - 0.3.12

Published by blacksmithgu over 3 years ago

Fix #247, #246.

obsidian-dataview - 0.3.11

Published by blacksmithgu over 3 years ago

Fix #228; empty lists no longer render as ''.

obsidian-dataview - 0.3.10

Published by blacksmithgu over 3 years ago

Small release before bigger feature work. Potential hotfix for people struggling with long index wait-times (#231, #239, #244).

obsidian-dataview - 0.3.9

Published by blacksmithgu over 3 years ago

Fix a random debugging console.log that snuck it's way into the last release.

obsidian-dataview - 0.3.8

Published by blacksmithgu over 3 years ago

  • Add the dataview join(list, [separator]) function.
  • DataviewJS respects default null value.
obsidian-dataview - 0.3.7

Published by blacksmithgu over 3 years ago

  • Fix render issue, fix rendering of fields as strings