From f2ee41ebe247e82862a8382320f335c2b17ac685 Mon Sep 17 00:00:00 2001 From: Liam Cain Date: Thu, 29 Apr 2021 23:31:08 -0400 Subject: [PATCH] More readme updates --- README.md | 56 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 98f2b99..96fd561 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,11 @@ Insert timestamps and cross-link your daily notes with the flexibility of natura - [Custom `nldates` Obsidian URI](#nldates-uri-action) - [Date Picker](#natural-language-dates-date-picker) -You can try with any of the standard dates, i.e. today, tomorrow, in 3 weeks, in 5 months, etc. -The only behaviours I changed were the following: - -| Write | Date | -| -------------- | --------------------- | -| next week | next Monday | -| next [month] | 1st of next month | -| mid [month] | 15th of the month | -| end of [month] | last day of the month | - If a date is not recognized, the link won't be created. -### Date Autosuggest +## Date Autosuggest -![date-autosuggest](assets/date-autosuggest.png) +autosuggest-demo Expand dates using natural language inline within the editor view. @@ -36,7 +26,7 @@ Typing `@today` Enter will automatically be expanded to the current d | Trigger phrase | Character(s) required to open the autosuggest | `@` | | Insert as link? | Dates will be inserted as wikilinks (i.e. `[[]]`) | Yes | -### `nldates` URI Action +## `nldates` URI Action It's now possible to use the [Obsidian URI](https://publish.obsidian.md/help/Advanced+topics/Using+obsidian+URI) to open daily notes using natural language by using the nldates action `obsidian://nldates?day=`. Don't forget to [encode space characters](https://publish.obsidian.md/help/Advanced+topics/Using+obsidian+URI#Encoding) appropriately. @@ -45,7 +35,7 @@ It's now possible to use the [Obsidian URI](https://publish.obsidian.md/help/Adv | `day` | natural language date string | | `newPane` | open note in new pane, default is `yes` | -## Commands and hotkeys +### Commands and Hotkeys Starting on v0.3.2, in addition to the hotkey to parse the selected date, the following commands are also available (note that hotkeys are unset by default starting on v0.4.1): @@ -55,7 +45,7 @@ Starting on v0.3.2, in addition to the hotkey to parse the selected date, the fo Opens the date picker menu -### Other Commands +#### Other Commands | Setting | Description | Default | | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | @@ -69,13 +59,27 @@ Opens the date picker menu **Note:** You can of course add hotkeys to each of these commands. -## Demo +## Usage + +### Examples + +The parser supports most date/time formats, including: + +- Today, Tomorrow, Yesterday, Last Friday, etc +- 17 August 2013 - 19 August 2013 +- This Friday from 13:00 - 16.00 +- 5 days ago +- 2 weeks from now +- Sat Aug 17 2013 18:40:39 GMT+0900 (JST) +- 2014-11-30T08:15:30-05:30 + +### Demo demo -**Note**: -The parser will replace all the selected text, meaning that in a sentence you should only select the dates to be parsed and not the full sentence. -In the example sentence `Do this thing by tomorrow`, only the word `tomorrow` should be selected. Alternatively, keep in mind that you can place your cursor **on** or **next to** the word tomorrow, and it will be replaced: +> **Note**: +> The parser will replace all the selected text, meaning that in a sentence you should only select the dates to be parsed and not the full sentence. +> In the example sentence `Do this thing by tomorrow`, only the word `tomorrow` should be selected. Alternatively, keep in mind that you can place your cursor **on** or **next to** the word tomorrow, and it will be replaced: Supported selections @@ -89,8 +93,18 @@ Unzip the [latest release](https://github.com/argenos/nldates-obsidian/releases/ ## About -Create date links using natural language processing using [chrono](https://github.com/wanasit/chrono) and some custom parsing. -To create a date link, select the text you want to change (e.g. `today`), and use the `NLP date` command. You can use the shortcut or the command palette (`Ctrl + P`). +Powered by the [chrono](https://github.com/wanasit/chrono) library and some custom parsing. + +### Custom Parsing + +The only behaviours I changed were the following: + +| Write | Date | +| -------------- | --------------------- | +| next week | next Monday | +| next [month] | 1st of next month | +| mid [month] | 15th of the month | +| end of [month] | last day of the month | ## For Developers