mnbi / rbnotes Goto Github PK
View Code? Open in Web Editor NEWA simple utility to write a note
License: MIT License
A simple utility to write a note
License: MIT License
In 0.4.11, show
command can show multiple notes at once. Then, it should accept keywords those list
command accepsts, like today
, yesterday
, this_week
, or last_week
.
When the keyword is specified, show
commands will show all notes belong to the keyword period.
In 0.3.1, the add command always attaches a newly created timestamp to a note.
It works fine in the most cases. However, it seems to be convenient to specify a timestamp in some cases, such import text from other applications (not via a file but clipboard).
The usage should be:
rbnotes add -t TIMESTAMP
TIMESTAMP
is a string to represent a date and time. The feature should accept timestamp notations in the following styles:
20201101180900_012
(full qualified timestamp string)20201101180900
(full qualified but no suffix)202011011809
(date and time but omit sec par)11011809
(omit year and sec part)Suffix, second, and year part may be omitted.
If those are omitted, the command assumes that;
nil
,00
,Any other patterns would cause to fail the command.
Try use rbnotes
with fzf
like the following command line:
$ rbnotes list | fzf | rbnotes show
Then, quit during the fzf
selection, rbnotes
at the end of the pipe crashes.
The traceback says "read_arg
: undefined method split
for nil:NilClass (NoMethodError)".
When the intermediate program in a pipeline quit or terminate abnormally, nil
seems to be read in the next program.
There is no description for search
command in the current help message (in 0.4.0).
And, one more thing I found about the current help. That is, the description for the timestamp pattern is not enough. "yyyymo" pattern is not described there.
So, this issue points 2 missing help text:
search
command,No help about add/update/delete commands.
It is sure that "this_mont" is too long to type. However, the shortcut "tm" is enough to short to type instead of "202012".
Add the following keywords for list
(and pick
) command:
When specify a non-existing file with "-c" option, no error occurs. It should fail to execute.
In 0.4.7, the output of search
command is messy.
Here is usage:
rbnotes commands
It shows all command names into a single line like this:
add delete export ...
General syntax is:
rbnotes commands [-d|--deve-commands]
When -d
option was specified, it would show development commands in addition to general ones.
0.2.1 is available from rubygems.org.
Install instruction should be updated.
Do as following,
rbnotes show
Ctrl-D
Then, rbnotes
fails to execute and print the message, "invalid string as timestamp: (nil)".
It seems to annoying to see the error message.
It should exit with no message.
It looks like:
rbnotes list --week 1117
This means to display all entries in the week which contains 17th Nov. in this year.
General syntax of list
is:
rbnotes list [-w|--week] [timestamp_pattern]
When the --week
option was specified without stamp_pattern, it would assume the target week is this week.
List
command accepts -w
(or --week
) option to enumerate notes written in a week which is contains a specified date. Pick
command also should behave as same as list
.
In the first version of the command, it just counts the number of notes in the repository.
It will shows in three different forms:
The following command line fails:
rbnotes list --week 2020
Traceback says;
Invalid timestamp pattern: cannot convert to a date [2020] (Rbnotes::InvalidTimestampPatternError)
Is it convenient to be able to specify the configuration file in the command line?
Like;
> rbnotes -c ~/somewhere/config.yml ...
The symptom occurs when:
emacsclient
as the editorrbnotes add
emacsclient
)The back trace says:
Errno::ENOENT: No such file or directory @ rb_sysopen - /var/folders/...
Run rbnotes
with the following command line:
rbnotes add foo
Nothing happens and rbnotes
never returns.
Since add
command accepts no argument, passing foo
is wrong syntax. However, hanging up is a buggy behavior even if the wrong syntax calling.
Export command writes out a given note into a file.
General syntax should be:
rbnotes export TIMESTAMP [FILENAME]
rbnotes
doesn't have enough privilege to write, the execution fails.In 0.4.6, the output of search
command seems to be hard to see.
It should be:
list
command output.The line causes an error during release process to rubygems.org.
Some configuration must be specified by users, such the location of the repository or the pager command.
The default location of the configuration file should be:
$HOME/.config/rbnotes/config
The environment variable XDG_CONFIG_HOME
should override the default location.
rbnotes
v0.1.0 cannot create a note from scratch. It also cannot edit or delete a note.
There should be the following commands:
All specification of a note is done with a timestamp, such "20201012231300".
In 0.4.0, the help
command shows only usage.
Should each command have its help? It could be showed with the following command line:
rbnotes help add
It shows help text for the add
command.
Textrepo 0.5.0 has a new API to perform full text search.
It can be used to add search
command to rbnotes.
rbnotes search hogemoge 20101101
This command line means that search the word hogemoge in notes those have timestamp of 2010-11-01. Syntax is:
rbnotes search PATTERN [TIMESTAMP_PATTERN]
PATTERN
could be a regular expression. TIMESTAMP_PATTERN
is optional. If none, the entire notes of the repository are target of the search.
In 0.4.1, update
command always updates the timestamp. However, in sometimes, it is better that the timestamp is kept unchanged since the modification is very little.
textrepo
has such feature from 0.5.4, the feature is usable to implement the behavior described in above.
The usage should be:
rbnotes update [-k|--keep] [TIMESTAMP]
A template file should be specified by the following ways:
add
commandThe priority is in this order.
rbnotes add -t some/where/file.md
:template: "/absolute/path/of/template/file.md"
Template directory is;
$XDG_CONFIG_HOME/rbnotes/templates
(if $XDG_CONFIG_HOME
is defined), or$HOME/.config/rbnotes/templates
.If a file, default.md
, exists in the above directory, it will be used as a template.
Any type of text file can be used. It just inserted into the editing text to invoke a editor.
See mnbi/textrepo#44 about the option.
README.md
should be updated.
It is very convenient to use rbnotes
with fzf
.
Typical usage looks like:
rbnotes list this_week | fzf | rbnotes show
Is it more convenient that rbnotes
has a new command pick
?
It looks like:
rbnotes pick this_week | rbnotes show
Is it convenient that the show
command can work with a picker program such fzf
?
The assuming usage is as:
$ rbnotes list | fzf | rbnotes show
When those commands are issued, the first rbnotes
print a list of the current notes in the repository and it goes to the input of fzf
. User can select one entry of the list with fzf
. Then, the entry goes to the input of the last rbnotes
. It shows the note selected by the user.
In the above scenario, the show
command read an argument from the standard input.
The similar situation may occur with the command update
and delete
.
textrepo
is now available from rubygems.org.
README.md should be updated.
To handle non-ascii character's display width, the gem seems to be suitable.
Think about to use the gem to update code of list
command.
According to the development plan, the version is up to 0.2.0 when the add/update/delete commands are implemented.
In the verbose
mode of the list
command, it prints the output like as follows:
2020-11-27 (2):
20201127113600 Foo
20201127121314 Bar
2020-11-25 (1):
20201125123344 Hoge
2020-10-30 (5):
20201030204050 Hogege
:
That is, in this mode, list
add a heading before printing a list of notes. The general syntax of the heading is:
YYYY-MO-DD (N)
YYYY-MO-DD
- dateN
- number of notes attached to the dateDo the following:
rbnotes list | head -1
Then, rbnotes
fails.
Traceback says:
...lib/rbnotes/commands/list.rb:58:in `write': Broken pipe @ io_writev - <STDOUT> (Errno::EPIPE)
In 0.4.0, a new search
command is available.
A searcher program can be specified in the configuration file.
Currently (just after release 0.4.0), there is no description about how to set a favorite searcher.
It should be described in README.md
or wiki page.
In textrepo
examples, the sample version of rbnotes
has 3 commands:
Those 3 commands are fundamentals of rbnotes
.
And they already exists in the sample version.
Just move them into this repository. They would work immediately (I hope so).
The following list is the output by rbnotes list this_week
:
20201109173000 : Rbnotes: feat #47 (accept some keywords in `list`)
20201109124121 : Textrepo: idea note
20201109121214 : Rbnotes: 1.0.0
20201110231011 : Textrepo: #42 (enrich Timestamp class)
20201111102106 : Apple Event - Nov 10: One More Thing
The order is weird.
Now, some wiki pages are created.
A link to those pages should be in README.md.
A timestamp pattern is looks like:
The API of textrepo
(Textrepo::Repository#entries
) is suitable for this feature.
Run bundler
in the working space.
It will generate all files to develop a gem.
In 0.4.10, import
command uses birthtime
of a target file to generate a timestamp of a note.
In some cases, it is favorable to use mtime
for a timestamp. The command should have an option to specify to use mtime
.
It should look like:
rbnotes import -m foo/hoge.md
The option is -m
or --use-mtime
.
In 0.4.11, show
command can show multiple notes at once. If pick
command could pick multiple notes, it is convenient to specify multiple notes like the following:
rbnotes pick | rbnotes show
From 0.5.1, textrepo
doesn't update the timestamp if the content is identical.
However, rbnotes update
still update even if it is unnecessary.
Why? It seems to be a bug in rbnotes
not textrepo
.
It seems to convenient to show multiple notes at once.
The command syntax looks like:
rbnotes show 202012051044 202012041234 202012031617
It show the three notes in the order specifying in the command line.
In my iMac, Emacs.app is always up and ready to edit. So, I specify emacsclient
as an external editor of rbnotes
. When I issue the command, such add
or update
, Emacs.app receives the content of note and is able to edit it. Then, rbnotes
waits to end editing.
After editing the note with Emacs.app, I press the key, C-x #
which send the message to notify rbnotes
the end of editing. Then, rbnotes
do some stuff to finish the command.
The mechanism works well. However, rbnotes
which is waiting for Emacs.app to finish editing occupies the terminal. Is it neat that rbnotes
goes background and releases the terminal after starting emacsclient
?
Issue ri
to view the documentation for search
command like:
ri Rbnotes::Commands::Search
The document seems to be empty.
Is it convenient to pass multiple timestamp patterns to list
command?
It will look like:
rbnotes list 1112 1111 1110
The command will display the notes those are made on 2020-11-12, 2020-11-11, and 2020-11-10.
There is the 'conf' command to show the current configuration.
However, the help message which the help
command shows is lack of any description for the conf
command.
It must be there.
It seems to me that it is useful to specify keyword as an argument for list
command, such today
, or yesterday
.
Like as:
rbnotes list today
keyword | meaning |
---|---|
today or to |
a timestamp string for today |
yesterday or ye |
a timestamp string for yesterday |
this_week or tw |
timestamps of this week |
last_week or lw |
timestamps of last week |
I don't think that "month" (short for "this month") or "year" (short for "this year") is so useful, since it is easy enough to specify "202011" or "2020".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.