Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
holroy committed Jan 12, 2025
2 parents 002a396 + 6d9030e commit e195834
Show file tree
Hide file tree
Showing 45 changed files with 519 additions and 227 deletions.
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 0.5.67

Includes several documentation fixes and several community-contributed bug fixes.

- @reply2za: Fixed inline rendering in the reading view.
- @carlesalbasboix: Adds sum(), avg(), min(), and max() to data arrays.
- @mnaoumov: Adds code mirror configuration which code highlights dataviewjs!

---

# 0.5.66

Bugfix for version comparisons to fix some other plugins having broken interactions with Dataview.
Expand All @@ -8,7 +18,7 @@ Bugfix for version comparisons to fix some other plugins having broken interacti

A maintenance update which fixes some issues with rendering embeds in Dataviews and adds a few new functions.

- Adds the `hash()` function for generating consistent uniformly-distributed values given arbitary inputs. Primarily useful for creating "random" views which remain consistent across page refreshes. Thanks to @holroy.
- Adds the `hash()` function for generating consistent uniformly-distributed values given arbitrary inputs. Primarily useful for creating "random" views which remain consistent across page refreshes. Thanks to @holroy.
- Adds the `slice()` function for slicing arrays, similar to Javascript's `Array.slice`. Thanks to @holroy.
- Fixes several issues with rendering embeds inside dataviews. Thanks to @GottZ.
- Several documentation improvements around tasks - thanks to @holroy and @RaviOnline.
Expand Down Expand Up @@ -260,7 +270,7 @@ inline queries in codeblocks.

# 0.5.32

The Dataview API has been noticably revamped - there are now approximately twice as many functions available on the
The Dataview API has been noticeably revamped - there are now approximately twice as many functions available on the
plugin API as there were before, and some additional utilities have been added to both the plugin and inline API. I
will be finishing up the associated new "extension" functionality shortly, which will allow:

Expand Down Expand Up @@ -378,7 +388,7 @@ A long-overdue swap from the beta branch to the stable branch. The beta branch s
changes, and has some nice performance improvements that come along with it! Here are the major changes:

- Most views now use React and no longer flicker when updating; this is not the case yet for DataviewJS, which will be
getting equivalent treament in the future.
getting equivalent treatment in the future.
- Dataview now caches metadata, so Dataview loads are very fast after the first time you open your vault. Dataview still
needs to visit every file when you update the plugin version, so that should be the only times you experience slower
load times.
Expand Down Expand Up @@ -537,7 +547,7 @@ Iterative beta which adds a few nice QoL features and fixes some more bugs:
- Some issues with array and object rendering were corrected.
- Error messages on empty dataview results were improved and now show up for all views.

Inline images are now rendered correctly in Dataview tables and lists - no more hacky `app://local/` schenanigans!
Inline images are now rendered correctly in Dataview tables and lists - no more hacky `app://local/` shenanigans!

---

Expand All @@ -550,7 +560,7 @@ Inline images are now rendered correctly in Dataview tables and lists - no more
# 0.5.1 (Beta)

- Temporarily revert the new task metadata behavior: inline fields in sublists of tasks are added to the page, instead
of the task. This behavior is not good, but is compatible with legacy usages of task metadata, which should uinbreak
of the task. This behavior is not good, but is compatible with legacy usages of task metadata, which should not break
some existing queries.
- This behavior will be removed in the future behind a flag.
- Added the 'visual' field to tasks - if set, tasks render 'visual' instead of their regular text.
Expand Down
221 changes: 221 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"version": "0.2",
"ignorePaths": [],
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"aaab",
"akey",
"alexfertel",
"AnnaKornfeldSimpson",
"apng",
"artisticat",
"autorelease",
"bcbe",
"bimap",
"binaryop",
"bkey",
"blacksmithgu",
"Brenan",
"bryc",
"callouts",
"canonicalization",
"canonicalize",
"CANONICALIZER",
"canonicalizes",
"canonicalizing",
"carlesalbasboix",
"cday",
"charleshan",
"Cheatsheet",
"Cheatsheets",
"Chouffy",
"clsname",
"codemirror",
"combinators",
"compday",
"comptime",
"concat",
"containsword",
"crashy",
"cres",
"crog",
"crpg",
"cssclasses",
"currencyformat",
"cyrb",
"dailys",
"datapoints",
"Datarow",
"Dataview",
"dataviewjs",
"Dataviews",
"datefield",
"ddd",
"DDTHH",
"début",
"dedup",
"dformat",
"dogfood",
"Donadio",
"dtformat",
"duedate",
"dueday",
"duetime",
"durationformat",
"dvjs",
"econtains",
"elink",
"embeddable",
"endswith",
"errorbox",
"etags",
"Evals",
"eyuelt",
"failable",
"fastfood",
"fdefault",
"fileset",
"Filetext",
"Filipe",
"frontmatter",
"fullscan",
"functionname",
"GamerGirlandCo",
"gdhjg",
"gentlegiantJGC",
"Gott",
"Groot",
"helloxx",
"Hoeven",
"holroy",
"iamrecursion",
"icontains",
"iden",
"ifield",
"iitem",
"implicits",
"INDEXEDDB",
"Ingrouped",
"Inlines",
"inlink",
"inlinks",
"Jeamee",
"jfif",
"Kanban",
"kometenstaub",
"ldefault",
"leoccyao",
"lezer",
"Linkpath",
"localforage",
"localtime",
"longkeyidontneedwhenreading",
"lres",
"luxon",
"lwrap",
"MarioRicalde",
"matchreg",
"maxby",
"mday",
"meello",
"meep",
"Millis",
"minby",
"mkdocs",
"mnaoumov",
"moba",
"mobas",
"mocsa",
"mt-krainski",
"mvalues",
"nestedfield",
"nonnull",
"noopener",
"Nums",
"offref",
"onwarn",
"ooker777",
"outlink",
"outlinks",
"padleft",
"padright",
"Pagerow",
"papaparse",
"parsimmon",
"pathlike",
"pjeby",
"pjepg",
"pleh",
"preact",
"protofarer",
"proxied",
"pymdownx",
"RaviOnline",
"rawlink",
"recurkey",
"Refreshable",
"REGEXES",
"regexmatch",
"regexreplace",
"regextest",
"renderable",
"Repr",
"RyotaUshio",
"sandboxed",
"sandboxing",
"seanlzx",
"sheeley",
"sohanglal",
"somemetadata",
"somidad",
"spoopy",
"Stardew",
"startswith",
"steamid",
"steg",
"striptime",
"subargs",
"subcontainer",
"subeval",
"subfolders",
"sublists",
"Subsettings",
"subsources",
"subtag",
"Subtags",
"subvalue",
"subword",
"succ",
"superfences",
"tasklist",
"tcopy",
"Templater",
"Testcase",
"toolbelt",
"trunc",
"typeof",
"tzhou",
"unindented",
"unrendered",
"v_mujunma",
"vals",
"vararg",
"varargs",
"vectorize",
"vitaly",
"vpos",
"vrtmrz",
"weekyear",
"whitespaces",
"xxhello",
"ymdh",
"ymdhm",
"ymdhms",
"zerollup",
"Статус"
],
"ignoreWords": [],
"import": [],
"enabled": true
}
8 changes: 4 additions & 4 deletions docs/docs/annotation/metadata-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ There are two specifics to these emoji-shorthands. First, they omit the inline f
| start | `🛫YYYY-MM-DD` |
| scheduled | `⏳YYYY-MM-DD` |

This means if you want to query for all tasks that are completed 2021-08-22, you'll write:
This means if you want to query for all tasks that are completed 2021-08-22, you'll write:

~~~markdown
```dataview
Expand All @@ -54,7 +54,7 @@ Which will list both variants - shorthands and textual annotation:
As with pages, Dataview adds a number of implicit fields to each task or list item:

!!! info "Inheritance of Fields"
Tasks inherit *all fields* from their parent page - so if you have a `rating` field in your page, you can also access it on your task in a `TASK` Query.
Tasks inherit *all fields* from their parent page - so if you have a `rating` field in your page, you can also access it on your task in a `TASK` Query.


| Field name | Data Type | Description |
Expand All @@ -64,7 +64,7 @@ As with pages, Dataview adds a number of implicit fields to each task or list it
| `completed` | Boolean | Whether or not this *specific* task has been completed; this does not consider the completion or non-completion of any child tasks. A task is explicitly considered "completed" if it has been marked with an `"x"`. If you use a custom status, e.g. `[-]`, `checked` will be true, whereas `completed` will be false. |
| `fullyCompleted` | Boolean | Whether or not this task and **all** of its subtasks are completed. |
| `text` | Text | The plain text of this task, including any metadata field annotations. |
| `visual` | Text | The text of this task, which is rendered by Dataview. This field can be overriden in DataviewJS to allow for different task text to be rendered than the regular task text, while still allowing the task to be checked (since Dataview validation logic normally checks the text against the text in-file). |
| `visual` | Text | The text of this task, which is rendered by Dataview. This field can be overridden in DataviewJS to allow for different task text to be rendered than the regular task text, while still allowing the task to be checked (since Dataview validation logic normally checks the text against the text in-file). |
| `line` | Number | The line of the file this task shows up on. |
| `lineCount` | Number | The number of Markdown lines that this task takes up. |
| `path` | Text | The full path of the file this task is in. Equals to `file.path` for [pages](./metadata-pages.md). |
Expand Down Expand Up @@ -106,4 +106,4 @@ WHERE any(file.tasks, (t) => !t.fullyCompleted)
```
~~~

This will give you back all the file links that have unfinished tasks inside. We get back a list of tasks on page level and thus need to use a [list function](../reference/functions.md) to look at each element.
This will give you back all the file links that have unfinished tasks inside. We get back a list of tasks on page level and thus need to use a [list function](../reference/functions.md) to look at each element.
14 changes: 13 additions & 1 deletion docs/docs/api/data-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface DataArray<T> {

/**
* Return a sorted array sorted by the given key; an optional comparator can be provided, which will
* be used to compare the keys in leiu of the default dataview comparator.
* be used to compare the keys in lieu of the default dataview comparator.
*/
sort<U>(key: ArrayFunc<T, U>, direction?: "asc" | "desc", comparator?: ArrayComparator<U>): DataArray<T>;

Expand Down Expand Up @@ -116,6 +116,18 @@ export interface DataArray<T> {
/** Run a lambda on each element in the array. */
forEach(f: ArrayFunc<T, void>): void;

/** Calculate the sum of the elements in the array. */
sum(): number;

/** Calculate the average of the elements in the array. */
avg(): number;

/** Calculate the minimum of the elements in the array. */
min(): number;

/** Calculate the maximum of the elements in the array. */
max(): number;

/** Convert this to a plain javascript array. */
array(): T[];

Expand Down
Loading

0 comments on commit e195834

Please sign in to comment.