Giter Club home page Giter Club logo

logseq-datenlp-plugin's Introduction

[💝 Sponsor this project on Github or ☕ Get me a coffee 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.

Simple Parsing

Complex Parsing with Scheduled and Deadline options

Auto Inline Parsing

As per the video, use %enable auto-parsing% to turn on auto parsing (off by default) and %disable auto-parsing% to turn it off.

Or, you can just use the hotkey combination a p to toggle auto-parsing on and off.

Semi-auto Inline Parsing

Like auto inline-parsing, but this time the parsing is triggered only if the date/time language is prefixed with an @, % or ^. Without the prefix, the block will not auto-parse. The available prefixes are:

  • @ is to simply parse the date
  • % converts it to a scheduled item
  • ^ converts it to a deadline item

You can use the hotkey combination s p to toggle semi-auto-parsing on and off. See the video below for instructions:

Using the Command Palette

Use Ctrl + Shift + p for Windows or Cmd + Shift + p for Mac. Then type @goto and select the first option that comes up. You will be presented with a search box to enter the day or date you want to go to.

Changing languages

Currently, the following languages are supported:

  1. German: de
  2. French: fr
  3. Japanese: ja
  4. Dutch: nl
  5. Portuguese: pt
  6. Russion: ru
  7. Chinese: zh

Add the following line inside the plugin settings, and change the language accordingly:

    {
        "lang": "ja"
    }

Installation

If the plugin is not available in the marketplace, you can load it manually by downloading the latest release here and manually loading it into Logseq.

Credits

SherlockJS

Chrono

Darwis once again for his out of the box thinking

logseq-datenlp-plugin's People

Contributors

hkgnp avatar jonasdiemer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logseq-datenlp-plugin's Issues

Additional languages?

How are the languages implemented? Is it very difficult to add more? I’d like to use it in German.

If it’s necessary for adding the language to do some translation work, I’m ready to help.

Notification feature for timed blocks

It would be great if the plugin could initiate a notification popup upon a time-defined schedule or deadline is reached.
For instance, I'd type
- TODO remember to call my mom %today 3pm

And by 3pm I would have a notification popup to remind it to me if still TODO. Notification would be a screen pop-up with a sound visualization. It seems this is managed by https://www.electronjs.org/docs/latest/tutorial/notifications at best, or at minimum a start with logseq.ui.ShowMsg.

Ideally, I could either: [snooze the notification], [jump to the original block], or [simply close it].

Feature Request: Inline date parsing

Would it be possible to add an option to parse dates inline?

For example, I type the following bullet
- TODO this task needs to be completed by July 31st.

When I /parse date it adds a date attribute under the bullet.
- TODO this task needs to be completed by July 31st.
date:: [[Jul 31, 2023]]

What I'd like for it to do instead is replace the date inline so the bullet reads:
- TODO this task needs to be completed by [[Jul 31, 2023]]

Processed dates use different format from Logseq default.

Scheduled date via regular LogSeq /Scheduled method:
SCHEDULED: <2022-01-21 Fri>
Scheduled date shown by plugin with /parse scheduled:
SCHEDULED: <2022-21-1 Friday>
I have made no changes to my date format since I started using Logseq. So, it's the default: MMM do, yyyy
Version 1.8 of the plugin and latest LogSeq beta 0.5.9.

Originally posted by @rosslaird in #2 (comment)

Semi parsing, decoding in the past

Hello Hkgnp,

I found something you would not expected when semi-parsing this line.
=> "perform something @15sept"

Result is "15 September", but for year 2021 instead of future.
I am puzzled because other dates work fine, such as "@5july" fits well in 2022.

Semi parsing, won't parse

Hello again Hkgnp,

I get blocks sent from telegram to my journal. They are written in the format "(HH:MM) text, then I am back on my computer and I take care of scheduling the tasks. It seems that (HH:MM) prefix is breaking the semi auto paring.

For instance, the following is not parsed:
(13:32) Followup email **done** pending @tomorrow
=> Tomorrow is not parsed

feature request on reminders

  • Show reminder with the task name
  • Clicking reminder should take it the task block
  • Ignoring reminder should auto snooze for given time
    I think this may be great for the reminder option

Others languages ?

Hi,

Thanks for this plugin . It is very useful! I even think it would be ideal in different languages. Is it in your goals? Or only in English?

Marketplace version is stuck on 3.31

Updating the plugin from the marketplace is stuck on v3.31. The marketplace supposedly interprets that version to be newer than the current v3.8.4.

Perhaps by accident, the version number 3.31 was assigned between v3.5 and v3.6?

Slash commands broken since 3.12.2

they all fail to parse and replace, an error is thrown (looks like a null object ref when accessing chronos?)

ncaught (in promise) TypeError: Cannot read properties of undefined (reading 'en')
    at b (index.64944076.js:1:382543)

快捷键好像不起作用

简介里说a ps p分别是打开自动和半自动解析日期时间,但我试了下,没有成功打开/关闭的notification,快捷键-plugins里也没有看到有相应的设置

所以如果想用这个快捷键的话应该如何设置呢,我觉得这个快捷键真的很不错会方便很多

image

Plugin not unregistered when uninstalled and trying to install again

when uninstalling plugin and installing from market place without restarting logseq I am getting this error

image

Not sure if this is logseq error how it handle uninstalled plugins unregistering of processes or this plugin specific, this plugin is the first time I am getting this error

plugin 3.10.2 logseq 0.6.5

Parsing multiple tokens in one block

Hey!

I noticed that the plugin fails to parse multiple dates in one block. With following block and Semi-auto Parsing enabled only the first @yesterday token gets expanded correctly when exiting the block. Revisiting and exiting the block again does resolve the second @today token.

- @yesteday and @today

After one visit:

- [[2023-03-05]] and @today

After second visit:

- [[2023-03-05]] and [[2023-03-06]]

Would be great to have them all parsed at one go =)

Unexpected behavior of "@from" after today’s upgrade

Edit I just found out that this is the behaviour on today’s page.

After upgrading to the newest version, blocks with @from disappear if entered in today’s journal page

I can reproduce it with the following block:

[[datenlp]] @from 11 to 12

The page datenlp is not created and the block’s contents are deleted. In the graph’s git history I can see that the block was cleared without any other page being modified.

Reminder not working if manually updating the time on scheduled task

When we have task created with datenlp plugin and then later if we update the time or date manually it's not working. sometime we when we have to postpone the task if the plugin show the reminder that will be great.

Currently when we update time manually reminder is not working

Sidebar data processing

Hello,
I am a bigfan of the plugin. I am migrating over my Todoist logic to this plugin.
I noticed another bug. If you open a page on side bar (shift click), the DateNlp events are not processed.
See example:
image

Doing the same in the main view works fine.
Hope this is just a simple fix for you.
Thanks !

Adding a date to the end of a block with a logbook removes a newline, breaking the logbook

  1. Type in a block
  2. Toggle it to NOW
  3. Leave the block
  4. Move back into it, toggle it to DONE. This creates a logbook entry.
  5. Then type an @-date like @nov 11 at the end of the block
  6. Press down to leave the block
  7. The result is that it will consume the newline at the end of the block, merging the block with its logbook text, and duplicating the logbook text
datenlp-logbook-bug.mov

This does not happen if there is text after the date, or if you use @today.

Recognize the time in French

Hi,

I would like to use more systematically the "parse date" function to insert a date but also a time.

If I try to add a discussion today at such and such a time only the date is recognized (not the time). Several questions:

  1. What is the expected format for the French language? I tried 17:15 or 17h15 but it does not work.
  2. Once it works, would it be possible to insert start-time instead of time in the block for a better combination with your other calendar plugin?

Thanks in advance for your answer. Great job with these plugins!

Stopped working 🤷

This is one of my favourite logseq plugins. Today it stopped working, I don't know why. I tried to update but still doesn't work. How to proceed? Should I uninstall and try to reinstall?

time stamp parses to date

I'm not sure if this is expected behaviour but when automatic parsing is on, a time stamp parses to today's date.

feature request: Date ranges

It would be awesome if we can have date ranges expansion. For example:

Specifying the exactly range:

@2022-02-02_2022-02-10 -> [[Feb 2nd, 2022]], [[Feb 3rd, 2022]], [[Feb 4th, 2022]], [[Feb 5th, 2022]]... [[Feb 10th, 2022]]

OR:

@2022-02-(02, 26) -> [[Feb 2nd, 2022]], [[Feb 3rd, 2022]], [[Feb 4th, 2022]], [[Feb 5th, 2022]]... [[Feb 28th, 2022]]
@2022-02-(02, -5) -> - [[Feb 1st, 2022]], [[Jan 31st, 2022]], [[Jan 30th, 2022]], [[Jan 29th, 2022]], [[Jan 28th, 2022]]

Preferred date format in config file is not used

Below is my config.json for the plugin (the date format is also set the same way in my config.edn file).

{
  "auto": false,
  "semiAuto": true,
  "lang": "",
  "notifications": false,
  "defaultSnooze": 5,
  "useBlockAsAlarmTitle": true,
  "disabled": false,
  "preferredDateFormat": "EEEE, MMMM do, yyyy"
}

Per this setting, I would expect the dates created by the plugin would follow this format:

[[Wednesday, July 19th, 2023]] but instead they are generated as [[Jul 19th, 2023]].

Elements in code blocks and inline code should not parsed

The plugin picks up dates from inside code blocks and inline code, and some code can easily contain text that looks like a date to the plugin; for example

```go
fmt.Printf("%03d\n", rnt1)
```

will create a scheduled block set to 3 days in the future and will remove the %03d from the block when semi-auto parsing is enabled.

I don't think wanting to parse dates from within code blocks is common and I would not even expect the plugin to anyways, even when using slash commands - so perhaps inline code/code blocks should be ignored completely both when using slash commands and (semi-)auto parsing?

Processed date is correct until bullet is no longer active

With version 1.8 of the plugin and Logseq 0.5.9, the processed date for a scheduled or deadline item shows as intended until I click away, then a different date is shown. For example, this is the result when I create a bullet and use the plugin to insert a scheduled item using tomorrow /parse scheduled:

Item that I want to schedule for [[Jan 21st, 2022]] SCHEDULED: <2022-21-1 Friday>

This is what I see when a click away from that bullet:

Item that I want to schedule for [[Jan 21st, 2022]] SCHEDULED: <2023-09-1 Friday>

Note that the scheduled date now shows September 1, 2023. If I click back into the bullet, the date changes to the intended date again (tomorrow); if I click away, it reverts to 2023 on the scheduled line. This only happens with scheduled or deadline items; parse dates works as intended.

Adding date on task completion is incorrect with scheduled/deadline/logbook

I absolutely love the new functionality of task completion with adding a date reference to the task. There is one thing that is not quite working with it, however.

If I have a task that is already scheduled (using /schedule), or has a deadline, or has been in the DOING state for a while and has a logbook associated with it, and I use cmd-shift-d to complete the task and add a link to today's date, it adds the link at the end of the entire block rather than at the end of the task description. Logseq does not seem to recognize this task on the journal page, unfortunately.

Example:
Screen Shot 2022-03-26 at 5 23 58 PM

Observed behavior:
Screen Shot 2022-03-26 at 5 24 07 PM

Desired behavior:
Screen Shot 2022-03-26 at 5 27 34 PM

Allow Config to choose Special Char in Semi Parsing.

Hi,
I mostly use schedule rather than direct date or Deadline. Hence i would want to use @ for Scheduled and % can go for dates.

If Plugin can make this configurable it would be great help as i would change @ for Schedule which i use the most and is easy to type.
Hopefully this would be small change in plugin setting.

Thanks for the Great Plugin.

typed times erased when @date is parsed

hi,
Issue, sometimes a @Date is parsed but the time is erased after enter

I use the plugin in language NL.

Example issue:
I type: meeting planned @morgen om 11.30 uur
I hit enter
result is that it now says:
meeting planned [[25-05-2023]]

Comment: the " om 11.30 uur" has been erased automatically.

To avoid this issue, I type the date, then hit enter and then go back to add the hours.

plugin failed to load plugin

When I open the logseq, the plugin doesn't work at all, if I close and re-open the plugin in logseq, it works again.
logseq version 0.6.9-0.7.0
image

Adapting parsing to date format

Hi,

Date recognition is very useful for making references to days in the calendar but currently the inserted date does not respect the date format chosen by the user.

image

Instead of 21-01-2022 ...
Here again the issue is the internationalization that your plugin calls for (IMHO).

Plugin not capturing anymore some simple string

Hello Hkgnp,

I see today that some nlp basic scheduling is not working anymore.
I am pretty sure this worked in the past. Any reason you'd see for regression or it never worked?
Remember to bring milk %in 3 days

I checked my language, and will set to "en"
Thanks

Time is not being prased

Hi I am new to logseq so I might be doing something wrong but I followed the step you outlined I believe see screenshots below and as you can see time is not being parse just the date.
image

image

image

Similarly with semi and auto parsing
image
image

I am using logseq 0.6.1 on Windows 10.

Thank you for this plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.