Skip to content

Commit 8e67a9c

Browse files
committed
chore: update README.md and license
Acknoledges Alex Qwxlea's contrubution. Thank You for this project.
1 parent a96ddbc commit 8e67a9c

File tree

9 files changed

+52
-55
lines changed

9 files changed

+52
-55
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Alex Qwxlea
3+
Copyright (c) 2022 Kilian Mio
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<!-- PROJECT LOGO -->
2828
<br />
2929
<div align="center">
30-
<a href="https://github.com/qWxleA/logseq-interstitial-heading-plugin">
31-
<img src="./img/icon.png" alt="Logo" width="80" height="80">
30+
<a href="https://github.com/Mikilio/logseq-interstitial-heading-plugin">
31+
<img src="./img/background.png" alt="Logo" width="420" height="240">
3232
</a>
3333

3434
<h3 align="center">Logseq Interstitial journaling</h3>
@@ -44,7 +44,13 @@
4444
</p>
4545
</div>
4646

47-
This plugin helps you quickly create time-stamps, without interupting your thought. As a bonus it can start your day with a quote, or a note to self.
47+
This plugin helps you quickly create time-stamps, without interupting your thought.
48+
49+
The features included are:
50+
- Automatic time-stamps on top-level blocks of your journal.
51+
- Automatic time-stamps on marked blocks. (Useful for templates)
52+
- Update or add timestamps with a configurable shortcut.
53+
4854

4955
> It is true. I am 217% happier now.
5056
>
@@ -85,61 +91,35 @@ This plugin helps you quickly create time-stamps, without interupting your thoug
8591

8692
## Using the plugin
8793

88-
This plugin makes it *just* a tiny bit easier to use Logseq as an interstitial journal. Two shortcuts that create timestamps, either as a header, or just (bold) text.
94+
This plugin makes it *just* a tiny bit easier to use Logseq as an interstitial journal.
8995

90-
Next, it makes it possible to send a note to yourself (write yesterday, see today), or just add a random note to a template.
96+
By default, it will add time stamps to top-level blocks of your journals, however, this can be turned off in the settings.
9197

92-
## Adding timestamps to your journal
98+
### Automatic timestamps on templates
9399

94-
![interstial journal example](./img/journal.png)
100+
![interstial journal example](./img/template.png)
95101

96-
- Use `Ctrl-t` to insert a timestamp in the current block/line.
97-
- Use `Ctrl-Shift-t` to insert a timestamped heading in the current block/line.
102+
You can mark block by adding the property `interstitial-template:: true` to blocks.
103+
The behavior will be the same as for the Journal page: Only top-level child blocks of that block get timestamped.
98104

99-
In the settings you can reverse this, so the default `Ctrl-t` becomes a timestamped heading.
105+
### Adding timestamps to your journal
100106

101-
### Configuration
102-
103-
![settings](./img/settings.png)
107+
![interstial journal example](./img/journal.png)
104108

105-
Under settings you can change the default timestamp, and if you want to use *bold* text.
109+
- By default, you can use `Ctrl-t` to insert a timestamp in the current block/line.
106110

107-
You can choose Markdown or Org-mode, depending on what you use.
111+
### Configuration
108112

109-
The level of the heading, where the timestamp is inserted, defaults to 3 (`### HH:MM <optional title>`)
113+
![settings](./img/settings.png)
110114

111-
**New:** It is possible to insert custom markup *around the time*.
115+
The recommended usage is to do pure interstitial journaling on your journal pages and link them to your actual "knowledge nodes" this plays nicely with the graph view as journal pages are automaticallly exluded. If you prefer another workflow however you can turn off the automatic timestamps.
112116

113-
Example: `[<time>]` this wil print: `[20:23]`
117+
Under settings, you can change the default timestamp (e.g. \*\*HH:MM\*\* if you want to use **bold** text).
114118

115119
Leave blank for default timestamp.
116120

117121
<p align="right">(<a href="#top">back to top</a>)</p>
118122

119-
## Templates
120-
121-
![insert templates](./img/demo.gif)
122-
123-
The default way to use the plugin is place one or more *placeholders* in your `daily` template. Then, when the template is run at midnight, a random note and a note to self are block-linked into place.
124-
125-
The plugin gives to commands to insert a "note to self" or a "random quote".
126-
127-
The idea is to put these in a template, and then, when the template is executed, the result will be a linked block to the not e or quote.
128-
129-
Usage:
130-
131-
type: `/Create Note to Self` or `/Create Random Quote`, and it will insert a code-snippet that will then be run with the template.
132-
133-
The default placeholder looks like this:
134-
135-
- `{{renderer :interstitial, yesterday, ntnds}}`
136-
- `{{renderer :interstitial, random, quote}}`
137-
138-
`yesterday` Will backlink a block from _yesterday_, `random` finds any block in your graph with the specified tag. Next you can alter `ntnds` and `quote`, you can choose any tag you use in your system, these are just the ones I use 😁.
139-
140-
These placeholder are _supposed_ to go in your (daily) template, but they will happily work anywhere you put them. If you put them in a template they will wait running, until the template is activated.
141-
142-
<p align="right">(<a href="#top">back to top</a>)</p>
143123

144124
## Licence
145125

@@ -154,18 +134,13 @@ Image from: [flickr](https://www.flickr.com/photos/kotomi-jewelry/33599728252) (
154134
[OFL](./OFL.txt)
155135
<p align="right">(<a href="#top">back to top</a>)</p>
156136

157-
<!-- CONTACT -->
158-
## Contact
159-
160-
Alex Qwxlea - [@twitter_handle](https://twitter.com/QwxleaA)
161-
162-
Project Link: [https://github.com/QWxleA/logseq-interstitial-heading-plugin](https://github.com/QWxleA/)
163-
164-
<p align="right">(<a href="#top">back to top</a>)</p>
165137

166138
## Acknowledgments
167139

168140
This plugin is a partially is inspired by [Obsidian rollover daily todo](https://github.com/shichongrui/obsidian-rollover-daily-todos), thanks!
141+
The project was started by Alex Qwxlea.
142+
The original version can be found at [https://github.com/QWxleA/logseq-interstitial-heading-plugin](https://github.com/QWxleA/)
143+
169144

170145
<!-- MARKDOWN LINKS & IMAGES -->
171146
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

icon.png

-40.8 KB
Binary file not shown.

img/demo.gif

-308 KB
Binary file not shown.

img/journal.png

-76.1 KB
Loading

img/settings.png

-133 KB
Loading

img/template.png

27.8 KB
Loading

index.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ import { BlockEntity, SettingSchemaDesc } from "@logseq/libs/dist/LSPlugin.user"
33
import dayjs from 'dayjs';
44

55
interface PluginSettings {
6+
timestampTopLevel: boolean;
67
timestampFormat: string;
78
timestampShortcut: string;
89
}
910

1011

1112
const pluginName = ["logseq-interstitial", "Logseq Interstitial"]
1213
const settingsTemplate: SettingSchemaDesc[] = [
14+
{
15+
key: "timestampTopLevel",
16+
type: "boolean",
17+
default: true,
18+
title: "Timestamp Top-Level Block",
19+
description: "Whether the plugin should automatically timestamp the top-level blocks of a journal page",
20+
},
1321
{
1422
key: "timestampFormat",
1523
type: "string",
@@ -101,15 +109,29 @@ async function insertInterstitional() {
101109
}
102110
}
103111

104-
async function maybeTimestampBlock(block: BlockEntity) {
105-
if (!block.parent?.id) return;
106112

113+
async function maybeTimestampBlock(block: BlockEntity) {
114+
const settings = logseq.settings as unknown as PluginSettings;
107115
const parent = await logseq.Editor.getBlock(block.parent.id, { includeChildren: false });
116+
const page = await logseq.Editor.getPage(block.page.id);
117+
console.log(`Parent: ${parent?.id}, Page: ${page?.id}, Journal: ${page?.['journal?']}`);
118+
119+
let shouldUpdate = false;
120+
108121
if (parent?.properties?.interstitialTemplate) {
122+
shouldUpdate = true;
123+
}
124+
125+
if (settings.timestampTopLevel && page?.['journal?'] && !parent) {
126+
shouldUpdate = true;
127+
}
128+
129+
if (shouldUpdate) {
109130
await updateBlock(block);
110131
}
111132
}
112133

134+
113135
const main = async () => {
114136
console.log(`Plugin: ${pluginName[1]} loaded`)
115137

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logseq-interstitial-heading-plugin",
3-
"version": "0.1.7",
3+
"version": "0.2.0",
44
"author": "@Mikilio",
55
"license": "MIT",
66
"description": "Interstitial Journaling plugin. Insert a (bold) timestamps, random notes, or notes to self.",
@@ -14,7 +14,7 @@
1414
},
1515
"logseq": {
1616
"main": "dist/index.html",
17-
"icon": "icon.png",
17+
"icon": "img/icon.png",
1818
"title": "Logseq Interstitial Journal",
1919
"id": "logseq-interstitial-heading-plugin"
2020
},

0 commit comments

Comments
 (0)