stup 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
stup 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
stup 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !

软件简介

stup

A CLI tool to easily save, access and organize daily notes.

Version badge

All Contributors

The name derives from the Standup meetings since its initial purpose was to cover my need for keeping my Standup notes in a convenient way.

stup Gif demo

How it works

Notes are organized in categories.

When a new note is added, stup creates a markdown file and places it under the category's directory in a sub-directory with a path based on the date.

CATEGORIES_ROOT_DIRECTORY/CATEGORY/YEAR/MONTH/YYYY-MM-DD.md

# For example, the notes of a category named "programming" April 18th, 2020 are saved under
CATEGORIES_ROOT_DIRECTORY/programming/2020/04/2020-04-18.md

This allows users to retrieve any notes added on a specific date or in a specific period for a specific or for all categories.

# Fetch notes for all categories
$ stup show @ 2020-04-18

# Fetch notes for a specific category for previous week
$ stup log previous-week -c programming

# Fetch notes for all categories for a specific period
$ stup log --from 2020-04-01 --to 2020-04-15

Installation

For the moment, the installation is manual until this issue is resolved.

So you have to clone the repository and place the executable stup script in a directory included in your $PATH variable.

git clone https://github.com/iridakos/stup

cd stup

# Given that `~/.local/bin` is included in your $PATH variable
cp ./stup ~/.local/bin

Compatibility

The script has been tested in:

  • Ubuntu 18.04
  • Ubuntu 19.10
  • Debian 9

but it should be running without problems in other Linux Distros as well.

If you face any problems though, feel free to open an issue reporting your Distro and its version.

Configuration

Before you start using stup you have to configure it with:

stup --configure

Follow the wizard to define:

  • to which directory stup will be saving your notes
  • what is the name of the default category *
  • what is the editor you want to use to manually edit your notes when using the edit command
  • what is the pager you want to use for long outputs (log and usage)

It also asks you if you want to edit the file and change the defaults in case you omit some arguments.

* You can use stup with just a default category but in case you want to add your notes structured for example per project or per any type of section you want, you have the option to create and use multiple categories (see below).

Usage

Add notes

To add a new note use the add command.

$ stup add @ yesterday -n "A note" -n "Another note"

The full version of the command:

stup add @|--at|-@ <when> -n|--note "<note text>" -c|--category "<category-name>"

where:

  • <when>: specifies in which date the notes should be added. Its value can be:
    • any of the words: today, tomorrow, yesterday in which case you can omit the @|--at|-@ option
    • a date string in the form: YYYY-MM-DD, for example: 2020-04-12
    • if you omit this option, stup by default will save the notes in the current date
  • <note-text>: the text of the note, for example: "Reviewed PR related to..."
  • -c or --category: is the category option (optional). If omitted, notes will be saved to your default category
    • <category-name>: the name of the category in which the notes will be added

Examples

Add a note for current date (all of the following commands are equivalent)
# Implying today (if you don't define the date, the add action defaults to current date)
$ stup add -n "A new note"

# Explicit with date alias 'today' omitting the `@` option
$ stup add today -n "A new note"

# Explicit with date alias 'today'
$ stup add @ today -n "A new note"

# Explicit without the 'today' alias (suppose the date is April 17th, 2020)
$ stup add @ 2020-04-17 -n "A new note"
Add a note for yesterday

All of the following commands are equivalent.

# Explicit with date alias 'yesterday'
$ stup add @ yesterday -n "A new note"

# Explicit with date alias ommiting the `@` option
$ stup add yesterday -n "A new note"

# Explicit without alias (suppose the date is April 17th, 2020)
$ stup add @ 2020-04-16 -n "A new note"
Add a note for tomorrow

All of the following commands are equivalent.

# Explicit with date alias 'tomorrow'
$ stup add @ tomorrow -n "A new note"

# Explicit with date alias omitting the `@` option
$ stup add tomorrow -n "A new note"

# Explicit without alias (suppose the date is April 17th, 2020)
$ stup add @ 2020-04-18 -n "A new note"
Add two notes at once
$ stup add today -n "Reviewed PR ..." -n "Merged to master..."
Add to a non-default category
# Add a note to a category named 'blocking'
$ stup add -c "blocking" -n "Can't continue unless"

Show notes

To view your notes on a given date, use the show command.

$ stup show

The full version of the command is:

$ stup show @ <when> -c|--category "<category-name>"

where:

  • @ or --at or -@: is the date option
    • <when>: specifies which date's notes should be shown. Its value can be:
      • any of the words: today, tomorrow, yesterday in which case you can omit the @ option
      • a date string in the form: YYYY-MM-DD, example: 2020-04-12
    • if you omit this option, stup by default will show you your yesterday's notes
  • <category-name>: the name of the category whose notes will be shown. You may omit this option if you want to see notes from all the categories.

If you don't specify a category and you have more than one, the default behaviour is to show notes only from the categories that have notes the specified day. If you prefer though to show the "empty" categories as well, you may use the --include-empty.

Notes:

  • the default action of stup is to show you your notes so you may write the command without the show directive (see the examples).

  • if you request to view your notes on a date that you haven't added anything, stup will ask if you want to see the notes of the latest date on which something was added before the one you specified.

    For example, if it is Monday and you didn't add any notes during the weekend, when you type stup yesterday you'll be prompted to see the notes added on Friday.

Examples

Show yesterday's notes

All of the following commands are equivalent.

# Imply "show" as action and "yesterday" alias as date
$ stup

# Imply "yesterday" as date
$ stup show

# Explicit date set to "yesterday" date alias
$ stup yesterday

# Explicit date (given that current date is April 17th, 2020)
$ stup @ 2020-04-16
Show today's notes

All of the following commands are equivalent.

# Imply "show" as action
$ stup today

# Show today's notes for the category "meetings"
$ stup today -c "meetings"

# Show today's notes for the category "meetings" by explicitly setting action to "show"
$ stup show today -c "meetings"
Show notes on a past date
# Show notes on April's Fool Day
$ stup show @ 2020-04-01
Show notes of a specific category
# Show today's notes added in category "pull-requests"
$ stup show today -n "pull-requests"

Log notes

To list your notes for a given period, use the log command.

$ stup log previous-week

The full version of the command:

$ stup log --from <from-date> --to <to-date> -c <category-name>

# or using an alias

$ stup log <week|previous-week|month|previous-month|year|previous-year>

where:

  • <from-date>: is a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is optional and if omitted the notes to be displayed won't have be added after a specific date
  • <to-date>: is also a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is also optional and if omitted the notes to be displayed won't have be added before a specific date
  • -c or --category: is the category option (optional). If omitted, you will view the notes of all categories
    • <category-name>: the name of the category whose notes you want to see

In the second version of the command, you can use the temporal aliases that will be translated to proper from/to dates.

In both cases, you may skip the log literal given that you set either an alias or one of the from and to flags.

Examples

Log of this week's notes
$ stup log week

# or

$ stup week
Log of previous week's notes
$ stup log previous-week

# or

$ stup previous-week
Log of notes added in a specific period
$ stup log --from 2020-01-15 --to 2020-02-01

# or

$ stup --from 2020-01-15 --to 2020-02-01
Log of notes added in a specific period in the category "blocking"
$ stup log --from 2020-01-15 --to 2020-02-01 -c blocking

# or

$ stup --from 2020-01-15 --to 2020-02-01 -c blocking
Log of notes added after a specific date in the category "blocking"
$ stup log --from 2020-01-15 -c blocking

# or

$ stup --from 2020-01-15 -c blocking

Search notes

To search your notes, use the search command.

$ stup search 'jira' previous-week

The full version of the command:

$ stup search <search-text> --from <from-date> --to <to-date> -c <category-name>

# or using an alias

$ stup search <search-text> <week|previous-week|month|previous-month|year|previous-year> -c <category-name>

where:

  • <search-text>: the text you want to find in notes
  • <from-date>: is a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is optional and if omitted the notes to be searched won't have to be added after a specific date
  • <to-date>: is also a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is also optional and if omitted the notes to be searched won't have to be added before a specific date
  • -c or --category: is the category option (optional). If omitted, you will search the notes of all categories
    • <category-name>: the name of the category whose notes you want to see

In the second version of the command, you can use the temporal aliases that will be translated to proper from/to dates.

Examples

Search this week's notes
$ stup search "jira" week

# or

$ stup week search "jira"
Search in previous week's notes
$ stup search "reviewed" previous-week

# or

$ stup previous-week search "linux"
Search notes added in a specific period
$ stup search "cli" --from 2020-01-15 --to 2020-02-01

# or

$ stup --from 2020-01-15 --to 2020-02-01 search "cli"
Search notes added in a specific period in the category "blocking"
$ stup search "SSD" --from 2020-01-15 --to 2020-02-01 -c blocking

# or

$ stup --from 2020-01-15 --to 2020-02-01 -c blocking search "SSD"
Search notes added after a specific date in the category "blocking"
$ stup --from 2020-01-15 -c blocking search "SSD"

# or

$ stup --from 2020-01-15 -c blocking search "SSD"

Edit notes

To manually edit notes added in a specific date use the edit command.

$ stup edit yesterday

The full version of the command as below:

stup edit @|--at|-@ <when> -c|--category "<category-name>"

where:

  • <when>: specifies in which date the notes should be added. Its value can be:
    • any of the words: today, tomorrow, yesterday in which case you can omit the @|--at|-@ option
    • a date string in the form: YYYY-MM-DD, for example: 2020-04-12
    • if you omit this option, stup by default will edit the notes in the current date
  • -c or --category: is the category option (optional). If omitted, you will edit the notes of your default category
    • <category-name>: the name of the category in which the notes will be added

Note: If there are no notes for a specific date and category, you will be asked if you want to create and edit the file anyway.

Examples

Editing yesterday's notes
# Omitting category option, implying the default one
$ stup edit yesterday

# Editing yesterday's notes for the category with name "blocking"
$ stup edit @ yesterday -c "blocking"
Editing notes on specific date
# Omitting category option, implying the default one
$ stup edit @ 2020-03-24

# Editing notes saved on March 24th, 2020 for the category with name "blocking"
$ stup edit @ 2020-03-24 -c "blocking"

Copy notes

To copy notes from one date to another use the copy command.

$ stup copy --from today --to tomorrow

The full version of the command:

stup copy --from <copy-from-date> --to <copy-to-date>  -c|--category "<category-name>"

where:

  • <copy-from-date>: is a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is optional and if omitted defaults to yesterday
  • <copy-to-date>: is also a date alias (today, yesterday, tomorrow) or a specific date using the format YYYY-MM-DD, for example: 2020-04-18
    • this is optional and if omitted defaults to today
  • -c or --category: is the category option (optional). If omitted, notes will be copied between the default category of the two dates specified
    • <category-name>: the name of the category to which the notes will be copied

stup will prompt you for each line to be copied:

stup copy


- Worked on some PRs


>>> Copy this note [y,n,q,a]?:

Examples

Copy notes from yesterday to today, in the default category
$ stup copy
Copy notes from a specific date, to a specific date
$ stup copy --from 2020-01-15 --to 2020-02-01
Copy notes from yesterday to tomorrow in the category "blocking"
$ stup copy --to tomorrow -c blocking

Add a new category

To add a new category to save notes into use the following command.

$ stup add-category --category-name "<category-name>" --category-description "<category-description>"

where:

  • <category-name>: the name of the category to be created. This is going to be a directory so make sure it's a valid directory name.

  • <category-description>: the description of this category. Even though this is optionally set, it is highly recommended to be defined. Whenever stup shows your notes, the title of each category will default to the category name if the category doesn't have a description.

    # Without a description for category with name mobile
    $ stup yesterday
    
    Displaying notes for Friday, April 16th 2020.
    
    >>> mobile
    
    - A note
    - Another note
    - ...
    

    vs

    # With mobile's category description set to "Mobile related notes"
    
    $ stup yesterday
    
    Displaying notes for Friday, April 16th 2020.
    
    >>> Mobile related notes
    
    - A note
    - Another note
    - ...
    
    

Set a category's description

To set a new description or change the existing description of a category use the following command.

$ stup set-category-description --category-name "<category-name>" --category-description "<category-description>"

where:

  • <category-name>: the name of the category whose description will be set. If you omit this options, you will change the description of your default category.
  • <category-description>: the description to set

List your categories

To see all your categories use the list-categories command as shown below:

$ stup list-categories

# or the equivalent

$ stup --list-categories

Change the order of categories

To change the order of your categories (affecting the order with which the notes are shown) use the order-categories command as shown below:

$ stup order-categories

# or the equivalent

$ stup --order-categories

This command opens the categories registry file in your editor and you can change the order by moving the category names up and down.

Future work

New features that are on the top of my list for stup:

You can find more information about what is planned to be implemented browsing the GitHub repository's issues labeled as new feature

Contributing

  1. Create an issue describing the purpose of the pull request unless there is one already
  2. Fork the repository ( https://github.com/iridakos/stup/fork )
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

License

This tool is open source under the MIT License terms.

[Back To Top]

Contributors

Thanks goes to these wonderful people (emoji key):


Bohdan Potměkleč

💻 🐛 🤔 💬

Brendan Hagan

💬 💻 🤔

Giannis Poulis

🤔 💻

Nikhil Mutalik

📖

sylvandb

👀

This project follows the all-contributors specification. Contributions of any kind welcome!

展开阅读全文

代码

评论 (0)

加载中
更多评论
暂无内容
发表了博客
2018/08/09 18:54

C++中的类

class 1、C++中的 class与struct 一样,是一种复合数据类型 2、里面可以有变量用来表达属性,函数用来表示行为 3、在C++中的class与struct ,几乎没有任何区别 4、struct 中默认访问属性是public ,class 中默认的访问属性是 private 5、在C++中默认使用class,以示与C语言中的class 进行区分 class的构造函数 1、在创建对象时自动调用的函数,在整个对象的生命周期中一定会被调用一次,且只能被调用一次 2、在构造函数中负责对成...

0
0
发表了博客
2019/09/22 10:52

C语言基础知识

## C语言关键字: unsigned signed bool void char short int long double float struct enum union typedef sizeof if else for switch case default while do break continue goto extern register volatile auto const static return ## 常用的Linux系统命令: touch/cat/more/head/tall/rm/cp/mv mkdir/rmdir/cd/ls/tar ifconfig/ping/telnet/ssh/ftp ## vim文本编辑器: 在终端下依靠键盘操作使用的文本编辑器。 三大主要模...

0
0
发表了博客
2018/05/21 20:35

FPGA设计中的异步复位、同步释放思想

1.一个简单的异步复位例子: module test(   input clk,   input rst_n,   input data_in,   output reg out ); always@(posedge clk or negedge rst_n)   if(!rst_n)     out <= 0;   else     out <= data_in; endmodule 综合结果如下: 我们可以看到,FPGA的寄存器都有一个异步清零端(CLR),在异步复位设计中,低电平有效的rst_n复位信号就可以直接连在这个端口上。(如果是高有效的复位...

0
0
2021/01/19 08:00

校园网多核心(OSPF)的拓扑实现和配置实例

OSPF(开放式最短路径优先open shotest path firsh)协议是一种链路状态路由选择协议。 所谓链路状态是指路由器接口的状态,如UP,DOWN,IP及网络类型等。 链路状态信息通过链路状态公告(LSA)发布到网上的每台路由器。 每台路由器通过LSA信息建立一个关于网络的拓扑数据库。 每台路由器通与与其直连的路由器交换Hello报文,建立邻居关系. OSPF区域(Area) 在OSPF中使用区域来为自治系统分段,OSPF是一种层次化的路由选择协议,区域...

0
0
发表于数据库专区
2016/12/01 17:16

有名PLSQL

有名PLSQL 1、存储过程 ---用来完成用户的某种特定操作,如DDL,DML 可以被用户调用,DBA的某些操作,开发人员的调用 create or replace procedure <> [(in out in out)] is|as .. //申明变量,常量 ,游标 begin .. exception //可选 .. end [procedurename]; / exec procedure; //调用过程 show error;//查看我们的错误 过程在第一次运行的时候,会被分析,后面直接被调用 SQL> create or replace procedure psal 2 is ...

0
1
发表了博客
2019/05/22 00:08

spark源码阅读--SparkContext启动过程

##SparkContext启动过程 基于spark 2.1.0 scala 2.11.8 spark源码的体系结构实在是很庞大,从使用spark-submit脚本提交任务,到向yarn申请容器,启动driver进程,启动executor进程,到任务调度,shuffle过程等等,模块众多,而且每个模块都很大,所以要全部看完啃透几乎不可能,一是经历不允许,而是有些边缘性的模块主要起到辅助的功能,没有什么高深的技术含量,花时间性价比不高。因此我决定略去前面提交任务,向yarn提交任务...

0
0
发表了博客
2019/06/15 15:16

C语言中函数参数传递

C语言中函数参数传递的三种方式 (1)值传递,就是把你的变量的值传递给函数的形式参数,实际就是用变量的值来新生成一个形式参数,因而在函数里对形参的改变不会影响到函数外的变量的值。 (2)地址传递,就是把变量的地址赋给函数里形式参数的指针,使指针指向真实的变量的地址,因为对指针所指地址的内容的改变能反映到函数外,能改变函数外的变量的值。 (3)引用传递,实际是通过指针来实现的,能达到使用的效果如传址,可...

0
0
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
暂无内容
0 评论
0 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部