diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ec3568c..1c11f803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,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. @@ -270,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: @@ -388,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. @@ -547,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! --- @@ -560,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. diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..0c121457 --- /dev/null +++ b/cspell.json @@ -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 +} diff --git a/docs/docs/annotation/metadata-tasks.md b/docs/docs/annotation/metadata-tasks.md index d262ad94..9295a551 100644 --- a/docs/docs/annotation/metadata-tasks.md +++ b/docs/docs/annotation/metadata-tasks.md @@ -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 @@ -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 | @@ -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). | @@ -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. diff --git a/docs/docs/api/data-array.md b/docs/docs/api/data-array.md index 8f029d5c..6e860405 100644 --- a/docs/docs/api/data-array.md +++ b/docs/docs/api/data-array.md @@ -78,7 +78,7 @@ export interface DataArray { /** * 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(key: ArrayFunc, direction?: "asc" | "desc", comparator?: ArrayComparator): DataArray; diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index 4ec3568c..a89a2197 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -18,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. @@ -270,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: @@ -278,7 +278,7 @@ will be finishing up the associated new "extension" functionality shortly, which 2. For custom renderable objects (progress bars, embedded task lists, embedded tables) to be added to any Dataview view via plugins. 3. For plugins to provide alternative behavior for some dataview functionality (such as integrating task plugins with the dataview task query). - + As part of the API revamp, it is now possible to programmatically execute Dataview and DataviewJS queries - either for using the existing Dataview query language in your own plugin, or for embedding dataview. The Dataview npm library also now exposes many useful internal Dataview types, including the AST structure for all dataview queries. @@ -388,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. @@ -547,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! --- @@ -560,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. diff --git a/docs/docs/friends.md b/docs/docs/friends.md index 8e76f5ae..eac59a0e 100644 --- a/docs/docs/friends.md +++ b/docs/docs/friends.md @@ -7,7 +7,7 @@ A list of plugins which may be helpful for Dataview related workflows: Another non-exhaustive list of plugins which use Dataview for some of the heavy-lifting required for their features: - [Kanban](https://github.com/mgmeyers/obsidian-kanban) - Create markdown-backed Kanban boards in Obsidian - - [Breadcrumbs](http://publish.obsidian.md/breadcrumbs-docs) - Gives you a way to visualise a custom-built hierarchy in your Obsidian vault + - [Breadcrumbs](http://publish.obsidian.md/breadcrumbs-docs) - Gives you a way to visualize a custom-built hierarchy in your Obsidian vault - [Supercharged Links](https://github.com/mdelobelle/obsidian_supercharged_links) - Allows you to style links in your Obsidian vault based on note metadata A full list can be found using GitHub's [Dependents](https://github.com/blacksmithgu/obsidian-dataview/network/dependents) feature. diff --git a/docs/docs/queries/dql-js-inline.md b/docs/docs/queries/dql-js-inline.md index b2f6c58b..d6f394b1 100644 --- a/docs/docs/queries/dql-js-inline.md +++ b/docs/docs/queries/dql-js-inline.md @@ -6,7 +6,7 @@ when your vault changes. ## Dataview Query Language (DQL) -The [**Dataview Query Language**](../../queries/structure) (for short **DQL**) is a SQL-like language and Dataviews core functionality. It supports [four Query Types](./query-types.md) to produce different outputs, [data commands](./data-commands.md) to refine, resort or group your result and [plentiful functions](../reference/functions.md) which allow numerous operations and adjustments to achieve your wanted output. +The [**Dataview Query Language**](../../queries/structure) (for short **DQL**) is a SQL-like language and Dataviews core functionality. It supports [four Query Types](./query-types.md) to produce different outputs, [data commands](./data-commands.md) to refine, resort or group your result and [plentiful functions](../reference/functions.md) which allow numerous operations and adjustments to achieve your wanted output. !!! warning Differences to SQL If you are familiar with SQL, please read [Differences to SQL](../../queries/differences-to-sql) to avoid confusing DQL with SQL. @@ -43,7 +43,7 @@ Inline DQL Queries display **exactly one value** somewhere in the middle of your Today is `= date(today)` - `= [[exams]].deadline - date(today)` until exams! ~~~ -would, for example, render to +would, for example, render to ~~~markdown Today is November 07, 2022 - 2 months, 5 days until exams! @@ -68,7 +68,7 @@ Final paper due in `= [[Computer Science Theory]].due - date(today)` 🏃‍♂️ Goal reached? `= choice(this.steps > 10000, "YES!", "**No**, get moving!")` -You have `= length(filter(link(dateformat(date(today), "yyyy-MM-dd")).file.tasks, (t) => !t.completed))` tasks to do. `= choice(date(today).weekday > 5, "Take it easy!", "Time to get work done!")` +You have `= length(filter(link(dateformat(date(today), "yyyy-MM-dd")).file.tasks, (t) => !t.completed))` tasks to do. `= choice(date(today).weekday > 5, "Take it easy!", "Time to get work done!")` ~~~ ## Dataview JS @@ -92,7 +92,7 @@ what you can do with it, see the [API documentation](../../api/code-reference), examples](../../api/code-examples). !!! attention "Advanced usage" - Writing Javascript queries is a advanced technique that requires understanding in programming and JS. Please be aware that JS Queries have access to your file system and be cautious when using other peopless' JS Queries, especially when they are not publicy shared through the Obsidian Community. + Writing Javascript queries is a advanced technique that requires understanding in programming and JS. Please be aware that JS Queries have access to your file system and be cautious when using other peoples' JS Queries, especially when they are not publicly shared through the Obsidian Community. ## Inline Dataview JS diff --git a/docs/docs/queries/query-types.md b/docs/docs/queries/query-types.md index 7f70a459..e46bc027 100644 --- a/docs/docs/queries/query-types.md +++ b/docs/docs/queries/query-types.md @@ -2,7 +2,7 @@ The **Query Type** determines how the output of your dataview query looks like. It is the **first and only mandatory** specification you give to a dataview query. There are four available: `LIST`, `TABLE`, `TASK` and `CALENDAR`. -The Query Type also determines which **information level** a query is executed on. `LIST`, `TABLE` and `CALENDAR` operate at **page level** whereas `TASK` queries operate at the `file.tasks` level. More on that in the `TASK` Query Type. +The Query Type also determines which **information level** a query is executed on. `LIST`, `TABLE` and `CALENDAR` operate at **page level** whereas `TASK` queries operate at the `file.tasks` level. More on that in the `TASK` Query Type. You can combine **every Query Type with all available [Data Commands](data-commands.md)** to refine your result set. Read more about the interconnection between Query Types and Data Commands on [How to Use Dataview](../index.md#how-to-use-dataview) and the [structure page](structure.md). @@ -19,7 +19,7 @@ You can combine **every Query Type with all available [Data Commands](data-comma The simplest LIST query outputs a bullet point list of all files in your vault: ~~~ -```dataview +```dataview LIST ``` ~~~ @@ -40,7 +40,7 @@ but you can, of course, use [data commands](data-commands.md) to restrict which ~~~ ```dataview -LIST +LIST FROM #games/mobas OR #games/crpg ``` ~~~ @@ -55,7 +55,7 @@ FROM #games/mobas OR #games/crpg To add a **additional information** to your query, specify it right after the `LIST` command and before possibly available data commands: ~~~ -```dataview +```dataview LIST file.folder ``` ~~~ @@ -69,12 +69,12 @@ LIST file.folder - [League of Legends](#): Games - [Pillars of Eternity 2](#): Games - [Stardew Valley](#): Games/finished -- [Dashboard](#): +- [Dashboard](#): You can only add **one** additional information, not multiple. But you can **specify a computed value** instead of a plain meta data field, which can contain information of multiple fields: ~~~ -```dataview +```dataview LIST "File Path: " + file.folder + " _(created: " + file.cday + ")_" FROM "Games" ``` @@ -83,7 +83,7 @@ FROM "Games" **Output** - [League of Legends](#): File Path: Games _(created: May 13, 2021)_ -- [Pillars of Eternity 2](#): File Path: Games _(created: Februrary 02, 2022)_ +- [Pillars of Eternity 2](#): File Path: Games _(created: February 02, 2022)_ - [Stardew Valley](#): File Path: Games/finished _(created: April 04, 2021)_ ### Grouping @@ -91,7 +91,7 @@ FROM "Games" A **grouped list** shows their group keys, and only the group keys, by default: ~~~ -```dataview +```dataview LIST GROUP BY type ``` @@ -108,7 +108,7 @@ GROUP BY type A common use-case on grouped `LIST` queries is to add the file links to the output by specifying them as the additional information: ~~~ -```dataview +```dataview LIST rows.file.link GROUP BY type ``` @@ -129,7 +129,7 @@ GROUP BY type ### LIST WITHOUT ID -If you don't want the file name or group key included in the list view, you can use `LIST WITHOUT ID`. `LIST WITHOUT ID` works the same as `LIST`, but it does not output the file link or group name if you add an additional information. +If you don't want the file name or group key included in the list view, you can use `LIST WITHOUT ID`. `LIST WITHOUT ID` works the same as `LIST`, but it does not output the file link or group name if you add an additional information. ~~~ ```dataview @@ -215,7 +215,7 @@ TABLE !!! info "Disabling Result count" The first column always shows the result count. If you do not want to get it displayed, you can disable it in Dataview's settings ("Display result count", available since 0.5.52). -Of course, a `TABLE` is made for specifying one to multiple additional information: +Of course, a `TABLE` is made for specifying one to multiple additional information: ~~~ ```dataview @@ -226,11 +226,11 @@ FROM #games **Output** -| File (3) | started | file.folder | file.etags | +| File (3) | started | file.folder | file.etags | | --- | --- | --- | --- | -| [League of Legends](#) | May 16, 2021 | Games | - #games/moba | -| [Pillars of Eternity 2](#) | April 21, 2022 | Games | - #games/crpg | -| [Stardew Valley](#) | April 04, 2021 | Games/finished | - #games/simulation | +| [League of Legends](#) | May 16, 2021 | Games | - #games/moba | +| [Pillars of Eternity 2](#) | April 21, 2022 | Games | - #games/crpg | +| [Stardew Valley](#) | April 04, 2021 | Games/finished | - #games/simulation | !!! hint "Implicit fields" Curious about `file.folder` and `file.etags`? Learn more about [implicit fields on pages](../annotation/metadata-pages.md). @@ -248,22 +248,22 @@ FROM #games **Output** -| File (3) | started | Path | File Tags | +| File (3) | started | Path | File Tags | | --- | --- | --- | --- | -| [League of Legends](#) | May 16, 2021 | Games | - #games/moba | -| [Pillars of Eternity 2](#) | April 21, 2022 | Games | - #games/crpg | -| [Stardew Valley](#) | April 04, 2021 | Games/finished | - #games/simulation | +| [League of Legends](#) | May 16, 2021 | Games | - #games/moba | +| [Pillars of Eternity 2](#) | April 21, 2022 | Games | - #games/crpg | +| [Stardew Valley](#) | April 04, 2021 | Games/finished | - #games/simulation | !!! info "Custom headers with spaces" - If you want to use a custom header with spaces, like `File Tags`, you need to wrap it into double quotes: `"File Tags"`. + If you want to use a custom header with spaces, like `File Tags`, you need to wrap it into double quotes: `"File Tags"`. This is especially useful when you want to use **calculations or expressions as column values**: ~~~ ```dataview -TABLE -default(finished, date(today)) - started AS "Played for", -file.folder AS Path, +TABLE +default(finished, date(today)) - started AS "Played for", +file.folder AS Path, file.etags AS "File Tags" FROM #games ``` @@ -271,11 +271,11 @@ FROM #games **Output** -| File (3) | Played for | Path | File Tags | +| File (3) | Played for | Path | File Tags | | --- | --- | --- | --- | -| [League of Legends](#) | 1 years, 6 months, 1 weeks | Games | - #games/moba | -| [Pillars of Eternity 2](#) | 7 months, 2 days | Games | - #games/crpg | -| [Stardew Valley](#) | 4 months, 3 weeks, 3 days | Games/finished | - #games/simulation | +| [League of Legends](#) | 1 years, 6 months, 1 weeks | Games | - #games/moba | +| [Pillars of Eternity 2](#) | 7 months, 2 days | Games | - #games/crpg | +| [Stardew Valley](#) | 4 months, 3 weeks, 3 days | Games/finished | - #games/simulation | !!! hint "Calculations and expressions" Learn more about the capability of computing expressions and calculations under [expressions](../reference/expressions.md) and [functions](../reference/functions.md). @@ -284,7 +284,7 @@ FROM #games If you don't want the first column ("File" or "Group" by default), you can use `TABLE WITHOUT ID`. `TABLE WITHOUT ID` works the same as `TABLE`, but it does not output the file link or group name as a first column if you add additional information. -You can use this if you, for example, output another identifying value: +You can use this if you, for example, output another identifying value: ~~~ ```dataview @@ -297,11 +297,11 @@ FROM #games **Output** -| steamid (3) | File Tags | +| steamid (3) | File Tags | | --- | --- | -| 560130 | - #games/crog | -| - | - #games/moba | -| 413150 | - #games/simulation | +| 560130 | - #games/crog | +| - | - #games/moba | +| 413150 | - #games/simulation | Also, you can use `TABLE WITHOUT ID` if you want to **rename the first column for one specific query**. @@ -316,20 +316,20 @@ FROM #games **Output** -| Game (3) | File Tags | +| Game (3) | File Tags | | --- | --- | -| [League of Legends](#) | - #games/moba | -| [Pillars of Eternity 2](#) | - #games/crpg | -| [Stardew Valley](#) | - #games/simulation | +| [League of Legends](#) | - #games/moba | +| [Pillars of Eternity 2](#) | - #games/crpg | +| [Stardew Valley](#) | - #games/simulation | !!! info "Renaming the first column in general" If you want to rename the first column in all cases, change the name in Dataviews settings under Table Settings. ## TASK -The `TASK` Query outputs **an interactive list of all tasks in your vault** that match the given [data commands](data-commands.md) (if any). `TASK` queries are special compared to the other Query Types because they do give back **Tasks as results and not pages**. This implies that all [data commands](data-commands.md) operate on **Task level** and makes it possible to granularly filter your tasks i.e. for their status or meta data specified on the task itself. +The `TASK` Query outputs **an interactive list of all tasks in your vault** that match the given [data commands](data-commands.md) (if any). `TASK` queries are special compared to the other Query Types because they do give back **Tasks as results and not pages**. This implies that all [data commands](data-commands.md) operate on **Task level** and makes it possible to granularly filter your tasks i.e. for their status or meta data specified on the task itself. -Also, `TASK` Queries are the only possibility to **manipulate your files through DQL**. Normally, Dataview does not touch the content of your files; however, if you check a task through a dataview query, it'll get **checked in its original file, too**. In the Dataview Settings under "Task Settings", you can opt-in to automatically set a `completion` meta data field when checking a task in dataview. Mind though that this only works if you check the task inside a dataview block. +Also, `TASK` Queries are the only possibility to **manipulate your files through DQL**. Normally, Dataview does not touch the content of your files; however, if you check a task through a dataview query, it'll get **checked in its original file, too**. In the Dataview Settings under "Task Settings", you can opt-in to automatically set a `completion` meta data field when checking a task in dataview. Mind though that this only works if you check the task inside a dataview block. !!! summary "`TASK` Query Type" `TASK` queries render an interactive list of all tasks in your vault. `TASK` Queries are executed on **task level**, not page level, allowing for task-specific filtering. This is the only command in dataview that modifies your original files if interacted with. @@ -343,7 +343,7 @@ TASK **Output** - [ ] Buy new shoes #shopping -- [ ] Mail Paul about training schedule +- [ ] Mail Paul about training schedule - [ ] Finish the math assignment - [x] Finish Paper 1 [due:: 2022-08-13] - [ ] Read again through chapter 3 [due:: 2022-09-01] @@ -353,7 +353,7 @@ TASK - [ ] Get new pillows for mom #shopping - [x] Buy some working pencils #shopping -You can use [data commands](data-commands.md) like for all other Query Types. Data Commands are executed on task level, making [implicit fields on tasks](../annotation/metadata-tasks.md) directly available. +You can use [data commands](data-commands.md) like for all other Query Types. Data Commands are executed on task level, making [implicit fields on tasks](../annotation/metadata-tasks.md) directly available. ~~~ ```dataview @@ -407,7 +407,7 @@ A task is considered a **child task** if it is **indented by a tab** and is belo - [ ] Bedroom [urgent:: true] -!!! info "Childs of a bullet point item" +!!! info "Children of a bullet point item" While indented tasks under a bulleted list item are, strictly speaking, also child tasks, Dataview will handle them like normal tasks in most cases. Child Tasks **belong to their parent**. This means if you're querying for tasks, you'll get child tasks as part of their parent back. @@ -444,7 +444,7 @@ WHERE !completed - [ ] Bedroom [urgent:: true] - [ ] Call the insurance about the car -Here, `living room` does **not match** the query, but is included anyway, because its parent `clean up the house` does match. +Here, `living room` does **not match** the query, but is included anyway, because its parent `clean up the house` does match. Mind that you'll get individual children tasks back, if the child matches your predicate but the parent doesn't: @@ -461,11 +461,11 @@ WHERE urgent ## CALENDAR -The `CALENDAR` Query outputs a monthly based calendar where every result is depicted as a dot on it referring date. The `CALENDAR` is the only Query Type that requires an additional information. This additional information needs to be a [date](../annotation/types-of-metadata.md#date) (or unset) on all queried pages. +The `CALENDAR` Query outputs a monthly based calendar where every result is depicted as a dot on it referring date. The `CALENDAR` is the only Query Type that requires an additional information. This additional information needs to be a [date](../annotation/types-of-metadata.md#date) (or unset) on all queried pages. !!! summary "`CALENDAR` Query Type" The `CALENDAR` Query Types renders a calendar view where every result is represented by a dot on the given meta data field date. - + ~~~ @@ -485,4 +485,4 @@ While it is possible to use `SORT` and `GROUP BY` in combination with `CALENDAR` CALENDAR due WHERE typeof(due) = "date" ``` -~~~ \ No newline at end of file +~~~ diff --git a/docs/docs/queries/structure.md b/docs/docs/queries/structure.md index 31efe785..252d354c 100644 --- a/docs/docs/queries/structure.md +++ b/docs/docs/queries/structure.md @@ -26,7 +26,7 @@ Every query follows the same structure and consists of - exactly one **Query Type** with zero, one or many [fields](../annotation/add-metadata.md), depending on query type - zero or one **FROM** data commands with one to many [sources](../reference/sources.md) -- zero to many other **data commands** with one to many [expressions](../reference/expressions.md) and/or other infos depending on the data command +- zero to many other **data commands** with one to many [expressions](../reference/expressions.md) and/or other infos depending on the data command At a high level, a query conforms to the following pattern: @@ -56,7 +56,7 @@ The output format of a query is determined by its **Query Type**. There are four The Query Type is the **only mandatory command in a query**. Everything else is optional. !!! attention "Possibly memory intense examples" - Depending on the size of your vault, executing the following examples can take long and even freeze Obsidian in extreme cases. It's recommended that you specify a `FROM` to restrict the query execution to a specific subset of your vaults' files. See next section. + Depending on the size of your vault, executing the following examples can take long and even freeze Obsidian in extreme cases. It's recommended that you specify a `FROM` to restrict the query execution to a specific subset of your vaults' files. See next section. ~~~ Lists all pages in your vault as a bullet point list @@ -113,7 +113,7 @@ FROM (#assignment AND "30 School") OR ("30 School/32 Homeworks" AND outgoing([[S ## Filter, sort, group or limit results -In addition to the Query Types and the **Data command** `FROM` that's explained above, you have several other **Data Commands** available that help you restrict, refine, sort or group your query results. +In addition to the Query Types and the **Data command** `FROM` that's explained above, you have several other **Data Commands** available that help you restrict, refine, sort or group your query results. All data commands except the `FROM` command can be used **multiple times in any order** (as long as they come after the Query Type and `FROM`, if `FROM` is used at all). They'll be executed in the order they are written. @@ -142,7 +142,7 @@ SORT file.ctime DESC LIMIT 10 ``` -Lists the 10 oldest and incompleted tasks of your vault as an interactive task list, grouped by their containing file and sorted from oldest to newest file. +Lists the 10 oldest and incomplete tasks of your vault as an interactive task list, grouped by their containing file and sorted from oldest to newest file. ```dataview TASK WHERE !completed diff --git a/docs/docs/reference/functions.md b/docs/docs/reference/functions.md index 8db81f3f..0908d10b 100644 --- a/docs/docs/reference/functions.md +++ b/docs/docs/reference/functions.md @@ -10,7 +10,7 @@ Functions are another form of [expression](expressions.md) and can be used every functionname(parameter1, parameter2) ``` -Parameters are again [expressions](expressions.md) and you can use literals, meta data fields, or even another function as parameter. You'll find out which [data type](../annotation/types-of-metadata.md) your parameters need to have on the documentation of this page. Pay attention to the information inside the function brackets. Parameters in square brackets, i.e. `link(path, [display])` means they are *optional* and can be omitted. Find out more about the default behaviour of each function on their explanation. +Parameters are again [expressions](expressions.md) and you can use literals, meta data fields, or even another function as parameter. You'll find out which [data type](../annotation/types-of-metadata.md) your parameters need to have on the documentation of this page. Pay attention to the information inside the function brackets. Parameters in square brackets, i.e. `link(path, [display])` means they are *optional* and can be omitted. Find out more about the default behavior of each function on their explanation. ## Calling functions on lists of values @@ -26,7 +26,7 @@ replace("yes", "e", "a") = "yas" replace(["yes", "ree"], "e", "a") = ["yas", "raa"] ``` -This so-called "function vectorization" will not be mentioned explicitly on the following definitions and is possible for a wide range of these functionalities implicitly. +This so-called "function vectorization" will not be mentioned explicitly on the following definitions and is possible for a wide range of these functionalities implicitly. ## Constructors @@ -64,11 +64,11 @@ date([[2021-04-16]]) = ### `date(text, format)` -Parses a date from text to luxon `DateTime` with the specified format. Note localised formats might not work. +Parses a date from text to luxon `DateTime` with the specified format. Note localized formats might not work. Uses [Luxon tokens](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). ```js -date("12/31/2022", "MM/dd/yyyy") => DateTime for Decemeber 31th, 2022 +date("12/31/2022", "MM/dd/yyyy") => DateTime for December 31th, 2022 date("210313", "yyMMdd") => DateTime for March 13th, 2021 date("946778645000", "x") => DateTime for "2000-01-02T03:04:05" ``` @@ -244,7 +244,7 @@ A generic function to reduce a list into a single value, valid operands are `"+" ```js reduce([100, 20, 3], "-") = 77 -reduce([200, 10, 2], "/") = 10 +reduce([200, 10, 2], "/") = 10 reduce(values, "*") = Multiplies every element of values, same as product(values) reduce(values, this.operand) = Applies the local field operand to each of the values reduce(["⭐", 3], "*") = "⭐⭐⭐", same as "⭐" * 3 @@ -540,7 +540,7 @@ to `end` (`end` not included) where `start` and `end` represents the index of it ```js slice([1, 2, 3, 4, 5], 3) = [4, 5] => All items from given position, 0 as first -slice(["ant", "bison", "camel", "duck", "elephant"], 0, 2) = ["ant", "bison"] => First two items +slice(["ant", "bison", "camel", "duck", "elephant"], 0, 2) = ["ant", "bison"] => First two items slice([1, 2, 3, 4, 5], -2) = [4, 5] => counts from the end, last two items slice(someArray) => a copy of someArray ``` @@ -717,7 +717,7 @@ choice(x > 4, y, z) = y if x > 4, else z ### `hash(seed, [text], [variant])` Generate a hash based on the `seed`, and the optional extra `text` or a variant `number`. The function -generates a fixed number based on the combination of these parameters, which can be used to randomise +generates a fixed number based on the combination of these parameters, which can be used to randomize the sort order of files or lists/tasks. If you choose a `seed` based on a date, i.e. "2024-03-17", or another timestamp, i.e. "2024-03-17 19:13", you can make the "randomness" be fixed related to that timestamp. `variant` is a number, which in some cases is needed to make the combination of @@ -728,9 +728,9 @@ hash(dateformat(date(today), "YYYY-MM-DD"), file.name) = ... A unique value for hash(dateformat(date(today), "YYYY-MM-DD"), file.name, position.start.line) = ... A unique "random" value in a TASK query ``` -This function can be used in a `SORT` statement to randomise the order. If you're using a `TASK` query, +This function can be used in a `SORT` statement to randomize the order. If you're using a `TASK` query, since the file name could be the same for multiple tasks, you can add some number like the starting line -number (as shown above) to make it a unique combination. If using something like `FLATTEN file.lists as item`, +number (as shown above) to make it a unique combination. If using something like `FLATTEN file.lists as item`, the similar addition would be to do `item.position.start.line` as the last parameter. ### `striptime(date)` diff --git a/docs/docs/resources/faq.md b/docs/docs/resources/faq.md index 3cb6b9f3..996d7eb0 100644 --- a/docs/docs/resources/faq.md +++ b/docs/docs/resources/faq.md @@ -50,9 +50,9 @@ WHERE duration Gives you -| File (1) | start| end| duration| -| ---- | ----- | ------ | ----- | -| Example | 7 hours | 18 hours| 9 hours, 30 minutes | +| File (1) | start| end| duration| +| ---- | ----- | ------ | ----- | +| Example | 7 hours | 18 hours| 9 hours, 30 minutes | **But storing a Inline DQL in a field comes with a limitation**: While the value that gets displayed in the result is the calculated one, **the saved value inside your metadata field is still your Inline DQL calculation**. The value is literally `= this.end - this.start - this.pause`. This means you cannot filter for the Inlines' result like: @@ -79,7 +79,7 @@ You can use [CSS Snippets](https://help.obsidian.md/Extending+Obsidian/CSS+snipp } ``` -In general there are no unique ID's given to a specific table on a page, so the mentioned targetting applies to any note having that `cssclasses` defined and **all** tables on that page. Currently you can't target a specific table using an ordinary query, but if you're using javascript, you can add the class `clsname` directly to your query result by doing: +In general there are no unique ID's given to a specific table on a page, so the mentioned targeting applies to any note having that `cssclasses` defined and **all** tables on that page. Currently you can't target a specific table using an ordinary query, but if you're using javascript, you can add the class `clsname` directly to your query result by doing: ```js dv.container.className += ' clsname' @@ -96,11 +96,11 @@ table:has([href="#myId"]) { /* Style your table as you like */ background-color: #262626; & tr:nth-child(even) td:first-child{ - background-color: #3f3f3f; + background-color: #3f3f3f; } } ``` -Which would end up having a grey background on the entire table, and the first cell in every even row a different variant of grey. **Disclaimer:** We're not style gurus, so this is just an example to show some of the syntax needed for styling different parts of a table. +Which would end up having a grey background on the entire table, and the first cell in every even row a different variant of grey. **Disclaimer:** We're not style gurus, so this is just an example to show some of the syntax needed for styling different parts of a table. Furthermore, in [Style dataview table columns](https://s-blu.github.io/obsidian_dataview_example_vault/20%20Dataview%20Queries/Style%20dataview%20table%20columns/) @s-blu describes an alternate trick using `` to style various parts of table cells (and columns). diff --git a/src/api/data-array.ts b/src/api/data-array.ts index f07ccef6..8d27758b 100644 --- a/src/api/data-array.ts +++ b/src/api/data-array.ts @@ -38,7 +38,7 @@ export interface DataArray { /** Limit the total number of entries in the array to the given value. */ limit(count: number): DataArray; /** - * Take a slice of the array. If `start` is undefined, it is assumed to be 0; if `end` is undefined, it is assumbed + * Take a slice of the array. If `start` is undefined, it is assumed to be 0; if `end` is undefined, it is assumed * to be the end of the array. */ slice(start?: number, end?: number): DataArray; @@ -62,7 +62,7 @@ export interface DataArray { /** * 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(key: ArrayFunc, direction?: "asc" | "desc", comparator?: ArrayComparator): DataArray; @@ -108,7 +108,7 @@ export interface DataArray { /** * Recursively expand the given key, flattening a tree structure based on the key into a flat array. Useful for handling - * heirarchical data like tasks with 'subtasks'. + * hierarchical data like tasks with 'subtasks'. */ expand(key: string): DataArray; @@ -183,7 +183,7 @@ class DataArrayImpl implements DataArray { ]); private static ARRAY_PROXY: ProxyHandler> = { - get: function (target, prop, reciever) { + get: function (target, prop, receiver) { if (typeof prop === "symbol") return (target as any)[prop]; else if (typeof prop === "number") return target.values[prop]; else if (prop === "constructor") return target.values.constructor; diff --git a/src/api/inline-api.ts b/src/api/inline-api.ts index 79753d0b..a1a0c51a 100644 --- a/src/api/inline-api.ts +++ b/src/api/inline-api.ts @@ -171,7 +171,7 @@ export class DataviewInlineApi { * Note that `this` is implicitly available and refers to the current file. * * This method returns a Result type instead of throwing an error; you can check the result of the - * execution via `result.successful` and obtain `result.value` or `result.error` resultingly. If + * execution via `result.successful` and obtain `result.value` or `result.error` accordingly. If * you'd rather this method throw on an error, use `dv.tryEvaluate`. */ public evaluate(expression: string, context?: DataObject): Result { @@ -208,7 +208,7 @@ export class DataviewInlineApi { return this.api.array(raw); } - /** Return true if theg given value is a javascript array OR a dataview data array. */ + /** Return true if the given value is a javascript array OR a dataview data array. */ public isArray(raw: any): raw is DataArray | Array { return this.api.isArray(raw); } diff --git a/src/api/plugin-api.ts b/src/api/plugin-api.ts index de304ca9..48408598 100644 --- a/src/api/plugin-api.ts +++ b/src/api/plugin-api.ts @@ -30,7 +30,7 @@ import { createFixedListView, createListView } from "ui/views/list-view"; import { createFixedTableView, createTableView } from "ui/views/table-view"; import { Result } from "api/result"; import { parseQuery } from "query/parse"; -import { tryOrPropogate } from "util/normalize"; +import { tryOrPropagate } from "util/normalize"; import { Query } from "query/query"; import { DataviewCalendarRenderer } from "ui/views/calendar-view"; import { DataviewJSRenderer } from "ui/views/js-view"; @@ -99,7 +99,7 @@ export class DataviewApi { this.io = new DataviewIOApi(this); } - /** Utilities to check the current Dataview version and comapre it to SemVer version ranges. */ + /** Utilities to check the current Dataview version and compare it to SemVer version ranges. */ public version: { current: string; compare: (op: CompareOperator, ver: string) => boolean; @@ -356,7 +356,7 @@ export class DataviewApi { * ``` * * This method returns a Result type instead of throwing an error; you can check the result of the - * execution via `result.successful` and obtain `result.value` or `result.error` resultingly. If + * execution via `result.successful` and obtain `result.value` or `result.error` accordingly. If * you'd rather this method throw on an error, use `dv.tryEvaluate`. */ public evaluate(expression: string, context?: DataObject, originFile?: string): Result { @@ -406,7 +406,7 @@ export class DataviewApi { return; } - let maybeQuery = tryOrPropogate(() => parseQuery(source)); + let maybeQuery = tryOrPropagate(() => parseQuery(source)); // In case of parse error, just render the error. if (!maybeQuery.successful) { diff --git a/src/data-import/inline-field.ts b/src/data-import/inline-field.ts index cc368749..556c4265 100644 --- a/src/data-import/inline-field.ts +++ b/src/data-import/inline-field.ts @@ -57,7 +57,7 @@ function findClosing( if (char == open) nesting++; else if (char == close) nesting--; - // Only occurs if we are on a close character and trhere is no more nesting. + // Only occurs if we are on a close character and there is no more nesting. if (nesting < 0) return { value: line.substring(start, index).trim(), endIndex: index + 1 }; escaped = false; @@ -74,7 +74,7 @@ function findSeparator(line: string, start: number): { key: string; valueIndex: return { key: line.substring(start, sep).trim(), valueIndex: sep + 2 }; } -/** Try to completely parse an inline field starting at the given position. Assuems `start` is on a wrapping character. */ +/** Try to completely parse an inline field starting at the given position. Assumes `start` is on a wrapping character. */ function findSpecificInlineField(line: string, start: number): InlineField | undefined { let open = line.charAt(start); diff --git a/src/data-import/markdown-file.ts b/src/data-import/markdown-file.ts index e223da88..74f3c939 100644 --- a/src/data-import/markdown-file.ts +++ b/src/data-import/markdown-file.ts @@ -179,7 +179,7 @@ export function parseMarkdown( return { fields, lists }; } -// TODO: Consider using an actual parser in leiu of a more expensive regex. +// TODO: Consider using an actual parser in lieu of a more expensive regex. export const LIST_ITEM_REGEX = /^[\s>]*(\d+\.|\d+\)|\*|-|\+)\s*(\[.{0,1}\])?\s*(.*)$/mu; /** @@ -266,7 +266,7 @@ export function parseLists( cache[item.line] = item; } - // Tree updating passes. Update child lists. Propogate metadata up to parent tasks. Update task `fullyCompleted`. + // Tree updating passes. Update child lists. Propagate metadata up to parent tasks. Update task `fullyCompleted`. let literals: Map = new Map(); for (let listItem of Object.values(cache)) { // Pass 1: Update child lists. @@ -275,11 +275,11 @@ export function parseLists( parent.children.push(listItem.line); } - // Pass 2: Propogate metadata up to the parent task or root element. + // Pass 2: Propagate metadata up to the parent task or root element. if (!listItem.task) { mergeFieldGroups(literals, listItem.fields); - // TODO (blacksmithgu): The below code properly propogates metadata up to the nearest task, which is the + // TODO (blacksmithgu): The below code properly Propagates metadata up to the nearest task, which is the // more intuitive behavior. For now, though, we will keep the existing logic. /* let root: ListItem | undefined = listItem; @@ -290,7 +290,7 @@ export function parseLists( */ } - // Pass 3: Propogate `fullyCompleted` up the task tree. This is a little less efficient than just doing a simple + // Pass 3: Propagate `fullyCompleted` up the task tree. This is a little less efficient than just doing a simple // DFS using the children IDs, but it's probably fine. if (listItem.task) { let curr: ListItem | undefined = listItem; diff --git a/src/data-model/serialized/markdown.ts b/src/data-model/serialized/markdown.ts index 7e5b10d7..6998eb56 100644 --- a/src/data-model/serialized/markdown.ts +++ b/src/data-model/serialized/markdown.ts @@ -41,7 +41,7 @@ export type SListItem = SListEntry | STask; /** Shared data between list items. */ export interface SListItemBase { - /** The symbo used to start this list item, like '1.' or '1)' or '*'. */ + /** The symbol used to start this list item, like '1.' or '1)' or '*'. */ symbol: string; /** A link to the closest thing to this list item (a block, a section, or a file). */ link: Link; diff --git a/src/data-model/value.ts b/src/data-model/value.ts index 834c54ac..6c0ef5eb 100644 --- a/src/data-model/value.ts +++ b/src/data-model/value.ts @@ -264,7 +264,7 @@ export namespace Values { } } - /** Find the corresponding Dataveiw type for an arbitrary value. */ + /** Find the corresponding Dataview type for an arbitrary value. */ export function typeOf(val: any): LiteralType | undefined { return wrapValue(val)?.type; } diff --git a/src/expression/functions.ts b/src/expression/functions.ts index d2b2d072..d6623773 100644 --- a/src/expression/functions.ts +++ b/src/expression/functions.ts @@ -29,7 +29,7 @@ interface FunctionVariant { /** * Allows for the creation of functions that check the number and type of their arguments, and dispatch - * to different implemenations based on the types of the inputs. + * to different implementations based on the types of the inputs. */ export class FunctionBuilder { variants: FunctionVariant[]; @@ -486,7 +486,7 @@ export namespace DefaultFunctions { .vectorize(2, [1]) .build(); - // Case insensitive contains which looks for exact word matches (i.e., boundry-to-boundry match). + // Case insensitive contains which looks for exact word matches (i.e., boundary-to-boundary match). export const containsword: FunctionImpl = new FunctionBuilder("containsword") .add2( "string", diff --git a/src/expression/parse.ts b/src/expression/parse.ts index dc657bad..e997aa08 100644 --- a/src/expression/parse.ts +++ b/src/expression/parse.ts @@ -495,7 +495,7 @@ export const EXPRESSION = P.createLanguage({ atomField: q => P.alt( - // Place embed links above negated fields as they are the special parser case '![[thing]]' and are generally unambigious. + // Place embed links above negated fields as they are the special parser case '![[thing]]' and are generally unambiguous. q.embedLink.map(l => Fields.literal(l)), q.negatedField, q.linkField, diff --git a/src/main.ts b/src/main.ts index 5d107a29..c60c74c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,7 @@ import { import { renderErrorPre } from "ui/render"; import { FullIndex } from "data-index/index"; import { parseField } from "expression/parse"; -import { tryOrPropogate } from "util/normalize"; +import { tryOrPropagate } from "util/normalize"; import { DataviewApi, isDataviewDisabled } from "api/plugin-api"; import { DataviewSettings, DEFAULT_QUERY_SETTINGS, DEFAULT_SETTINGS } from "settings"; import { DataviewInlineRenderer } from "ui/views/inline-view"; @@ -279,7 +279,7 @@ export default class DataviewPlugin extends Plugin { let potentialField = text.substring(this.settings.inlineQueryPrefix.length).trim(); if (potentialField.length == 0) continue; - let field = tryOrPropogate(() => parseField(potentialField)); + let field = tryOrPropagate(() => parseField(potentialField)); if (!field.successful) { let errorBlock = el.createEl("div"); renderErrorPre(errorBlock, `Dataview (inline field '${potentialField}'): ${field.error}`); diff --git a/src/settings.ts b/src/settings.ts index 289957d9..8998d93b 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -23,7 +23,7 @@ export interface QuerySettings { refreshInterval: number; /** The default format that dates are rendered in (using luxon's moment-like formatting). */ defaultDateFormat: string; - /** The default format that date-times are rendered in (using luxons moment-like formatting). */ + /** The default format that date-times are rendered in (using luxon's moment-like formatting). */ defaultDateTimeFormat: string; /** Maximum depth that objects will be expanded when being rendered recursively. */ maxRecursiveRenderDepth: number; diff --git a/src/test/function/functions.test.ts b/src/test/function/functions.test.ts index 288ce35d..8d2d289e 100644 --- a/src/test/function/functions.test.ts +++ b/src/test/function/functions.test.ts @@ -124,7 +124,7 @@ test("Evaluate choose()", () => { expect(parseEval("choice(false, 1, 2)")).toEqual(2); }); -test("Evaulate hash()", () => { +test("Evaluate hash()", () => { expect(DefaultFunctions.hash(simpleContext(), "2024-03-17", "")).toEqual(3259376374957153); expect(DefaultFunctions.hash(simpleContext(), "2024-03-17", 2)).toEqual(271608741894590); expect(DefaultFunctions.hash(simpleContext(), "2024-03-17", "Home")).toEqual(3041844187830523); diff --git a/src/test/util/paths.test.ts b/src/test/util/paths.test.ts index ffb01c26..f34df4e1 100644 --- a/src/test/util/paths.test.ts +++ b/src/test/util/paths.test.ts @@ -8,7 +8,7 @@ describe("getFileTitle()", () => { expect(getFileTitle("yes")).toEqual("yes"); }); - test("folder getFielTitle()", () => { + test("folder getFileTitle()", () => { expect(getFileTitle("ok/yes.md")).toEqual("yes"); expect(getFileTitle("/yes")).toEqual("yes"); }); diff --git a/src/ui/export/markdown.ts b/src/ui/export/markdown.ts index 3bae150f..4b7d5fb4 100644 --- a/src/ui/export/markdown.ts +++ b/src/ui/export/markdown.ts @@ -40,7 +40,7 @@ export function markdownTable( let table = `| ${headers.map((v, i) => padright(escapeTable(v), " ", maxLengths[i])).join(" | ")} |\n`; // Then the separating column. table += `| ${maxLengths.map(i => padright("", "-", i)).join(" | ")} |\n`; - // Then the data colunns. + // Then the data columns. for (let row = 0; row < values.length; row++) { table += `| ${mvalues[row].map((v, i) => padright(v, " ", maxLengths[i])).join(" | ")} |\n`; } diff --git a/src/ui/lp-render.ts b/src/ui/lp-render.ts index 77a03b19..4b384a20 100644 --- a/src/ui/lp-render.ts +++ b/src/ui/lp-render.ts @@ -34,7 +34,7 @@ import { DataviewSettings } from "../settings"; import { FullIndex } from "../data-index"; import { App, Component, editorInfoField, editorLivePreviewField, TFile } from "obsidian"; import { DataviewApi } from "../api/plugin-api"; -import { tryOrPropogate } from "../util/normalize"; +import { tryOrPropagate } from "../util/normalize"; import { parseField } from "../expression/parse"; import { executeInline } from "../query/engine"; import { Literal } from "../data-model/value"; @@ -302,13 +302,13 @@ export function inlinePlugin(app: App, index: FullIndex, settings: DataviewSetti if (text.startsWith(settings.inlineQueryPrefix)) { if (settings.enableInlineDataview) { code = text.substring(settings.inlineQueryPrefix.length).trim(); - const field = tryOrPropogate(() => parseField(code)); + const field = tryOrPropagate(() => parseField(code)); if (!field.successful) { result = `Dataview (inline field '${code}'): ${field.error}`; el.innerText = result; } else { const fieldValue = field.value; - const intermediateResult = tryOrPropogate(() => + const intermediateResult = tryOrPropagate(() => executeInline(fieldValue, currentFile.path, index, settings) ); if (!intermediateResult.successful) { diff --git a/src/ui/markdown.tsx b/src/ui/markdown.tsx index e4c62963..3d144ca1 100644 --- a/src/ui/markdown.tsx +++ b/src/ui/markdown.tsx @@ -233,7 +233,7 @@ export function ErrorMessage({ message }: { message: string }) { } /** - * Complex convienence hook which calls `compute` every time the index updates, updating the current state. + * Complex convenience hook which calls `compute` every time the index updates, updating the current state. */ export function useIndexBackedState( container: HTMLElement, diff --git a/src/ui/views/calendar-view.ts b/src/ui/views/calendar-view.ts index a849f2e9..f9a1df62 100644 --- a/src/ui/views/calendar-view.ts +++ b/src/ui/views/calendar-view.ts @@ -7,7 +7,7 @@ import { Query } from "query/query"; import { DataviewSettings } from "settings"; import { renderErrorPre } from "ui/render"; import { DataviewRefreshableRenderer } from "ui/refreshable-view"; -import { asyncTryOrPropogate } from "util/normalize"; +import { asyncTryOrPropagate } from "util/normalize"; import type { Moment } from "moment"; // CalendarFile is a representation of a particular file, displayed in the calendar view. @@ -31,7 +31,7 @@ export class DataviewCalendarRenderer extends DataviewRefreshableRenderer { async render() { this.container.innerHTML = ""; - let maybeResult = await asyncTryOrPropogate(() => + let maybeResult = await asyncTryOrPropagate(() => executeCalendar(this.query, this.index, this.origin, this.settings) ); if (!maybeResult.successful) { diff --git a/src/ui/views/inline-view.ts b/src/ui/views/inline-view.ts index 3a7befd5..73b6429a 100644 --- a/src/ui/views/inline-view.ts +++ b/src/ui/views/inline-view.ts @@ -5,7 +5,7 @@ import { executeInline } from "query/engine"; import { DataviewSettings } from "settings"; import { renderErrorPre, renderValue } from "ui/render"; import { DataviewRefreshableRenderer } from "ui/refreshable-view"; -import { tryOrPropogate } from "util/normalize"; +import { tryOrPropagate } from "util/normalize"; /** Refreshable renderer which renders inline instead of in a div. */ export class DataviewInlineRenderer extends DataviewRefreshableRenderer { @@ -27,7 +27,7 @@ export class DataviewInlineRenderer extends DataviewRefreshableRenderer { async render() { this.errorbox?.remove(); - let result = tryOrPropogate(() => executeInline(this.field, this.origin, this.index, this.settings)); + let result = tryOrPropagate(() => executeInline(this.field, this.origin, this.index, this.settings)); if (!result.successful) { this.errorbox = this.container.createEl("div"); renderErrorPre(this.errorbox, "Dataview (for inline query '" + this.fieldText + "'): " + result.error); diff --git a/src/ui/views/list-view.tsx b/src/ui/views/list-view.tsx index a90fc47a..ccb4f9fc 100644 --- a/src/ui/views/list-view.tsx +++ b/src/ui/views/list-view.tsx @@ -1,7 +1,7 @@ import { MarkdownRenderChild } from "obsidian"; import { executeList } from "query/engine"; import { Query } from "query/query"; -import { asyncTryOrPropogate } from "util/normalize"; +import { asyncTryOrPropagate } from "util/normalize"; import { useContext } from "preact/hooks"; import { DataviewContext, @@ -43,7 +43,7 @@ export function ListView({ query, sourcePath }: { query: Query; sourcePath: stri context.index, { state: "loading" }, async () => { - let result = await asyncTryOrPropogate(() => + let result = await asyncTryOrPropagate(() => executeList(query, context.index, sourcePath, context.settings) ); diff --git a/src/ui/views/table-view.tsx b/src/ui/views/table-view.tsx index 30251c95..570b6353 100644 --- a/src/ui/views/table-view.tsx +++ b/src/ui/views/table-view.tsx @@ -1,7 +1,7 @@ import { Literal } from "data-model/value"; import { executeTable } from "query/engine"; import { Query } from "query/query"; -import { asyncTryOrPropogate } from "util/normalize"; +import { asyncTryOrPropagate } from "util/normalize"; import { DataviewContext, DataviewInit, @@ -82,7 +82,7 @@ export function TableView({ query, sourcePath }: { query: Query; sourcePath: str context.index, { state: "loading" }, async () => { - let result = await asyncTryOrPropogate(() => + let result = await asyncTryOrPropagate(() => executeTable(query, context.index, sourcePath, context.settings) ); if (!result.successful) return { state: "error", error: result.error }; diff --git a/src/ui/views/task-view.tsx b/src/ui/views/task-view.tsx index c52750e6..b50d6055 100644 --- a/src/ui/views/task-view.tsx +++ b/src/ui/views/task-view.tsx @@ -18,7 +18,7 @@ import { useIndexBackedState, DataviewInit, } from "ui/markdown"; -import { asyncTryOrPropogate } from "util/normalize"; +import { asyncTryOrPropagate } from "util/normalize"; /** Function used to test if a given event correspond to a pressed link */ function wasLinkPressed(evt: preact.JSX.TargetedMouseEvent): boolean { @@ -215,7 +215,7 @@ export function TaskView({ query, sourcePath }: { query: Query; sourcePath: stri context.index, { state: "loading" }, async () => { - let result = await asyncTryOrPropogate(() => + let result = await asyncTryOrPropagate(() => executeTask(query, sourcePath, context.index, context.settings) ); if (!result.successful) return { state: "error", error: result.error, sourcePath }; diff --git a/src/util/normalize.ts b/src/util/normalize.ts index 68cd0e8a..b7958e37 100644 --- a/src/util/normalize.ts +++ b/src/util/normalize.ts @@ -71,7 +71,7 @@ export function extractSubtags(tag: string): string[] { } /** Try calling the given function; on failure, return the error message. */ -export function tryOrPropogate(func: () => Result): Result { +export function tryOrPropagate(func: () => Result): Result { try { return func(); } catch (error) { @@ -80,7 +80,7 @@ export function tryOrPropogate(func: () => Result): Result(func: () => Promise>): Promise> { +export async function asyncTryOrPropagate(func: () => Promise>): Promise> { try { return await func(); } catch (error) { diff --git a/test-vault/tasks/checklist.md b/test-vault/tasks/checklist.md index d3b31df7..1c9bdedc 100644 --- a/test-vault/tasks/checklist.md +++ b/test-vault/tasks/checklist.md @@ -1,9 +1,9 @@ - [x] Normal task, tags inherited from page [completion:: 2021-10-23] * [ ] Task with a #tag, adds to inherited page tags - * [ ] Task that inherits tag from above and page tagssss + * [ ] Task that inherits tag from above and page tags * [x] Completed task ✅ 2021-08-06 📅 2021-08-07 * [x] Completed task [completion::2021-08-06] [due::2021-08-07] -* [ ] task with [annotation::arbitrary] [completion:: 2021-10-23] +* [ ] task with [annotation::arbitrary] [completion:: 2021-10-23] * [ ] Scheduled task 📅 2021-08-07 * [ ] Task that overrides creation date of file ➕ 2021-08-06 * [ ] Repeating task 🔁Mondays