Skip to content

Commit

Permalink
chore: readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
benjypng committed Aug 8, 2024
1 parent eaf97f9 commit 2969ced
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[:gift_heart: Sponsor this project on Github](https://github.com/sponsors/hkgnp) or [:coffee: Get me a coffee](https://www.buymeacoffee.com/hkgnp.dev) if you like this plugin!

> This README has not been completely updated. Feel free to ask around Discord for a feature request!
# Overview

This super simple plugin uses NLP to parse your content for dates and times so that they can be easily tracked through your yournal pages.

## Toolbar

![](/screenshots/toolbar-demo.gif)

*Navigate*

Click on `Today`, or the left/right chevrons to navigate to today's journal page or the next or previous days'.
Expand All @@ -20,7 +20,8 @@ Click on `Today`, or the left/right chevrons to navigate to today's journal page
- A page in the format `YYYY/Week XX`
- Page embeds for all the dates in that week

![](/screenshots/toolbar-demo.gif)
![](/screenshots/toolbar.png)


## Simple Parsing

Expand Down
Binary file added screenshots/toolbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/features/toolbar/handle-append-page-embeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export const handleAppendEmbeds = async (
'success',
)
}
await logseq.Editor.exitEditingMode(false)
}
12 changes: 11 additions & 1 deletion src/features/toolbar/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getWeek, getYear } from 'date-fns'

import { handleAppendEmbeds } from './handle-append-page-embeds'
import { helpers } from './helpers'
import css from './toolbar.css?raw'
import { handleAppendEmbeds } from './handle-append-page-embeds'

export const handleToolbar = async () => {
logseq.provideStyle(css)
Expand All @@ -27,9 +27,19 @@ export const handleToolbar = async () => {
const year = getYear(new Date())
const week = getWeek(new Date())
const pageName = `${year}/Week ${week}`
await logseq.Editor.createPage(
pageName,
{},
{
redirect: false,
createFirstBlock: false,
journal: false,
},
)

// Create the page embeds
await handleAppendEmbeds(pageName, year, week)

// Go to page
logseq.App.pushState('page', {
name: pageName,
Expand Down

0 comments on commit 2969ced

Please sign in to comment.