GithubHelp home page GithubHelp logo

rbnotes's People

Contributors

mnbi avatar

Stargazers

 avatar

Watchers

 avatar

rbnotes's Issues

`Show` command should accept keywords as its arguments

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.

add command should accept to specify a timestamp

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:

  1. 20201101180900_012 (full qualified timestamp string)
  2. 20201101180900 (full qualified but no suffix)
  3. 202011011809 (date and time but omit sec par)
  4. 11011809 (omit year and sec part)

Suffix, second, and year part may be omitted.
If those are omitted, the command assumes that;

  • suffix is nil,
  • second is 00,
  • year is the current year.

Any other patterns would cause to fail the command.

Show command crashes when reads `nil` from the standard input

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.

Help text for `search` command is missing

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:

  • for search command,
  • about "yyyymo" pattern.

Add new keyword, "this_month" and "last_month" for `list` command

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:

  • "this_month" or "tm" for all notes written in this month
  • "last_month" or "lm" for all notes written in last month

Add a new command, "commands"

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.

List command option, `--week`

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.

rbnotes hangs when passed needless arguments

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.

Add new command `export` which works as opposed to `import`

Export command writes out a given note into a file.

General syntax should be:

rbnotes export TIMESTAMP [FILENAME]
  • TIMESTAMP must be fully qualified one.
  • FILENAME is optional.
    • When it omitted, the filename would be "#{TIMESTAMP}.md" in the current working directory.
  • FILENAME could be an absolute path or a relative path.
    • Intermediate directory will be created
    • If rbnotes doesn't have enough privilege to write, the execution fails.
  • When no argument was passed, tries to read a timestamp string from the standard input.
    • In this case, FILENAME is regarded as omitted.

Prettify `search` command output

In 0.4.6, the output of search command seems to be hard to see.

It should be:

  • sorted by timestamp,
  • justify column like list command output.

Refer an external configuration file

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.

More commands (add/update/delete)

rbnotes v0.1.0 cannot create a note from scratch. It also cannot edit or delete a note.
There should be the following commands:

  • add - create a new note in the repository
  • update - replace the content of the specified note with given text
  • delete - remove the specified note from the repository

All specification of a note is done with a timestamp, such "20201012231300".

Each command should have individual help

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.

add search command to perform full text search

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.

A feature to keep the timestamp unchanged in `update` command

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]

`Add` command should be able to use a template file

A template file should be specified by the following ways:

  1. command line option for add command
  2. configuration file setting
  3. a particular name file in the template directory

The priority is in this order.

command line option

rbnotes add -t some/where/file.md

configuration file setting

:template: "/absolute/path/of/template/file.md"

a particular name file in the template directory

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.

format of a template file

Any type of text file can be used. It just inserted into the editing text to invoke a editor.

Some command should read an argument from the standard input

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.

Bump version to 0.2.0

According to the development plan, the version is up to 0.2.0 when the add/update/delete commands are implemented.

Add a new mode, `verbose` for `list` command

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 - date
  • N - number of notes attached to the date

List command fails when used with a pipeline

Do 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)

How to set a favorite searcher should be described in README.md

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.

Implement the fundamental commands (import/list/show)

In textrepo examples, the sample version of rbnotes has 3 commands:

  • import
  • list
  • show

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).

Notes list does not sort correctly (list with a keyword)

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.

List command should accept a pattern of timestamp as its argument

A timestamp pattern is looks like:

  • "20201025" -> matches all stamps made in "2020-10-25"
  • "1025" -> matches all stamps made in "Oct. 25th"
  • "2020" -> matches all stamps made in "2020"

The API of textrepo (Textrepo::Repository#entries) is suitable for this feature.

Add an option for `import` to use `mtime` instead of `birthtime`

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.

Show multiple notes at once

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.

Emacsclient should be invoked asynchronously

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?

List command should accept multiple arguments

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.

Help for the `conf` command is missing

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.

Add some keyword as an argument for `list` command

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".

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.