Fixes #364
parent
830ae9c83d
commit
1fbc9493f4
|
@ -1,5 +1,5 @@
|
||||||
import type { FunctionMap } from "../plug-api/types.ts";
|
import type { FunctionMap } from "../plug-api/types.ts";
|
||||||
import { niceDate, niceTime } from "./dates.ts";
|
import { niceDate, niceTime, safeTime } from "./dates.ts";
|
||||||
|
|
||||||
export const builtinFunctions: FunctionMap = {
|
export const builtinFunctions: FunctionMap = {
|
||||||
// String functions
|
// String functions
|
||||||
|
@ -83,6 +83,7 @@ export const builtinFunctions: FunctionMap = {
|
||||||
return niceDate(new Date());
|
return niceDate(new Date());
|
||||||
},
|
},
|
||||||
time: () => niceTime(new Date()),
|
time: () => niceTime(new Date()),
|
||||||
|
safeTime: () => safeTime(new Date()),
|
||||||
tomorrow: () => {
|
tomorrow: () => {
|
||||||
const tomorrow = new Date();
|
const tomorrow = new Date();
|
||||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||||
|
|
|
@ -12,7 +12,11 @@ export function niceDate(d: Date): string {
|
||||||
|
|
||||||
export function niceTime(d: Date): string {
|
export function niceTime(d: Date): string {
|
||||||
const isoDate = d.toISOString();
|
const isoDate = d.toISOString();
|
||||||
let [date, time] = isoDate.split("T");
|
const [_, time] = isoDate.split("T");
|
||||||
// hh:mm:ss
|
// hh:mm:ss
|
||||||
return time.split(".")[0];
|
return time.split(".")[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function safeTime(d: Date): string {
|
||||||
|
return niceTime(d).replace(/:/g, "-");
|
||||||
|
}
|
||||||
|
|
|
@ -6,14 +6,15 @@ release.
|
||||||
## Edge
|
## Edge
|
||||||
_These features are not yet properly released, you need to use [the edge builds](https://community.silverbullet.md/t/living-on-the-edge-builds/27) to try them._
|
_These features are not yet properly released, you need to use [the edge builds](https://community.silverbullet.md/t/living-on-the-edge-builds/27) to try them._
|
||||||
|
|
||||||
* Nothing yet since 0.8.3. Stay tuned!
|
* Nothing yet since 0.8.4. Stay tuned!
|
||||||
|
|
||||||
## 0.8.3
|
## 0.8.4
|
||||||
* [[Page Picker#Keyboard shortcuts]]: allow folder completion using Shift-Space (by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/961))
|
* [[Page Picker#Keyboard shortcuts]]: allow folder completion using Shift-Space (by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/961))
|
||||||
* New [[Page Decorations]]: ability to hide pages from the page picker and auto complete (by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/962))
|
* New [[Page Decorations]]: ability to hide pages from the page picker and auto complete (by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/962))
|
||||||
* The [[Expression Language]] now supports decimal numbers 🤯 (e.g. `3.14`)
|
* The [[Expression Language]] now supports decimal numbers 🤯 (e.g. `3.14`)
|
||||||
* Non-existing pages that have been previously linked to (so effectively: broken links) now appear in the [[Page Picker]] (with a “Create page” hint) as well as in [[Links]] auto complete (marked as “Linked but not created”). This should make it easier to “fill in the gaps”: you can liberally create page links, and create those pages later easily via the page picker.
|
* Non-existing pages that have been previously linked to (so effectively: broken links) now appear in the [[Page Picker]] (with a “Create page” hint) as well as in [[Links]] auto complete (marked as “Linked but not created”). This should make it easier to “fill in the gaps”: you can liberally create page links, and create those pages later easily via the page picker.
|
||||||
* New [[Space Script]] feature: [[Space Script#Custom HTTP endpoints]]: create custom endpoints on your SilverBullet server (under the `/_/` prefix).
|
* New [[Space Script]] feature: [[Space Script#Custom HTTP endpoints]]: create custom endpoints on your SilverBullet server (under the `/_/` prefix).
|
||||||
|
* Updated the [[^Library/Core/New Page/Quick Note]] template to now use a (Windows and Android) naming pattern using the new `safeTime` function, also tweaked the naming pattern slightly (put a `/` in between the date and time so that these are organized by date), updated [[Library/Core/Quick Notes]] to show full path.
|
||||||
* Added Ruby [[Markdown/Syntax Highlighting]] (by [Bo Jeanes](https://github.com/silverbulletmd/silverbullet/pull/966))
|
* Added Ruby [[Markdown/Syntax Highlighting]] (by [Bo Jeanes](https://github.com/silverbulletmd/silverbullet/pull/966))
|
||||||
* **Fix**: Due to some race conditions some situations pages would disappear from the index (e.g. from the [[Page Picker]]), this should now be fixed
|
* **Fix**: Due to some race conditions some situations pages would disappear from the index (e.g. from the [[Page Picker]]), this should now be fixed
|
||||||
* New [[SETTINGS]]: `pwaOpenLastPage` and `useSmartQuotes` (latter by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/960))
|
* New [[SETTINGS]]: `pwaOpenLastPage` and `useSmartQuotes` (latter by [Marek S. Łukasiewicz](https://github.com/silverbulletmd/silverbullet/pull/960))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
description: "Create a quick note"
|
description: "Create a quick note"
|
||||||
tags: template
|
tags: template
|
||||||
hooks.newPage:
|
hooks.newPage:
|
||||||
suggestedName: "Inbox/{{today}} {{time}}"
|
suggestedName: "Inbox/{{today}}/{{safeTime}}"
|
||||||
confirmName: false
|
confirmName: false
|
||||||
command: "Quick Note"
|
command: "Quick Note"
|
||||||
key: "Alt-Shift-n"
|
key: "Alt-Shift-n"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
tags: template
|
||||||
|
description: A page reference link as a list item showing the full page path
|
||||||
|
---
|
||||||
|
* [[{{name}}|{{name}}]]
|
|
@ -1,5 +1,5 @@
|
||||||
This is your {[Quick Note]} inbox.
|
This is your {[Quick Note]} inbox.
|
||||||
|
|
||||||
```query
|
```query
|
||||||
page where name =~ /^Inbox\// render [[Library/Core/Query/Page]]
|
page where name =~ /^Inbox\// render [[Library/Core/Query/Full Page]]
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue