← Back to team overview

rednotebook-users team mailing list archive

Re: Console-based mini-client?

 

On 11.11.21 18:53, Michael Fierro wrote:
I had mentioned this once, way back in rednotebook's history, but I wanted to revisit it to see if this is possible or if we can get a conversation going around it: is there a way to enter entries into rednotebook from a console window? That would be fantastic if it were possible - I don't know how to make that work, my python skills are very lacking.

I do have a work-around, that mostly works but is very kludjey:

From a console, cd to the location of your journal
cd ~/my_rednotebook_journal

Find the text file that contains the month you are interested in:
ls 2021*.txt

Make a copy of the file
cp 2021-10.txt 2021-10.txt.backup

Edit that file
vim 2021-10.txt

First, look through previous journal entries so you understand the format. It is basically:
Day number followed by a colon
Open-brackets followed by {text:
Your journal text in between double-quotes
End that day's entry with a closing-bracket.

A very basic example using filename 2021-10.txt (for October 2021) is:

1: {text: "This is the start of October!\n"}
15: {text: "How is this month already over?"}
31: {text: "Trick or \\treat\\.\nStart a new costume line!"}

BUT what would be easier is having a small python function that goes through the above steps and makes it so you just have to enter your text. The UX would be something like:

    *Welcome to Rednotebook Console!*
    Using October 2021 (2021-10.txt)
    *Input day of the month for the new entry: *[e.g. 31 for the last
    day of October]
    *Type your entry below, txt2tags are allowed*
    *-----------------------------*
    *----------------------------*
    *----------------------------*
    *----------------------------*
    *
    *
    *Press <CTRL>+S to save, <CTRL>+Q to exit*


Any possibility that something similar to this could be implemented?
Hi,

I like the idea! RedNotebook already has a --date commandline option, all that's needed is to add a --message option. If a message is given via this option, append it to the given date or today's entry (default) and exit. I don't think an interactive editing UX is needed. If somebody wants to prepare a pull request for this, I'd be happy to review the work.

Cheers,
Jendrik

References