diff --git a/.gitignore b/.gitignore index 1377554..57f1248 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +doc/memo.1 diff --git a/doc/memo.1 b/doc/memo.1 deleted file mode 100644 index e4c029f..0000000 --- a/doc/memo.1 +++ /dev/null @@ -1,112 +0,0 @@ -.\" Text automatically generated by txt2man -.TH memo 1 "10 August 2018" "doc" "Linux Reference Manual" -.SH NAME -\fBmemo -\fB -.SH SYNOPSIS -.nf -.fam C -\fBmemo\fP [\fIarguments\fP] - -.fam T -.fi -.fam T -.fi -.SH DESCRIPTION -A tool to memorize stuff. -It saves files $MEMO_DIR ($HOME/\fBmemo\fP by default). -The structure is $MEMO_DIR//memo.md -You can also copy files in the topic folder as well. -.PP -We call the folder $MEMO_DIR/ a 'topic folder'. -.RE -.PP - -.SH COMMANDS -.TP -.B -add [text] -adds text to the memo.md in the topic folder. -if text is not given it will read from stdin. -.TP -.B -rm -remove $MEMO_DIR/topic folder with all it's content. -.TP -.B -copy -copy a file to the topic folder. -.TP -.B -search -search for a term in $MEMO_DIR using ack. -.TP -.B -show -shows memo.md in the topic folder. -also showes a list of all files in the topic folder -.TP -.B -edit -opens your favorite editor to edit the \fBmemo\fP topic -.TP -.B -list -prints a list of all topics. -.TP -.B -git -run git command in $MEMO_DIR. -Once $MEMO_DIR is a git repository all \fBmemo\fP commands create commits. -.RE -.PP - - -.SH CONFIGURATION - -.TP -.B -$MEMO_DIR -holds the folder where to store the \fBmemo\fP files. -Default is $HOME/\fBmemo\fP -.TP -.B -$EDITOR -Your favorite editor. Must be set for the edit command -.SH EXAMPLE - - -Append the string "A search-engine" to the memo.md file -in the topic "google". -.PP -.nf -.fam C - $> memo add google A search-engine - -.fam T -.fi -Appends the content of "www.google.com" to the memo.md file -the topic "google". -.PP -.nf -.fam C - $> curl www.google.com | memo add google - -.fam T -.fi -Copy the "Invoice.pdf" file to the "lawsuit" topic. -.PP -.nf -.fam C - $> memo copy lawsuit ~/Downloads/Invoice.pdf - -.fam T -.fi -Make $MEMO_DIR a git repository. -.PP -.nf -.fam C - $> memo git init - - - diff --git a/doc/memo.1.md b/doc/memo.1.md new file mode 100644 index 0000000..2b75d90 --- /dev/null +++ b/doc/memo.1.md @@ -0,0 +1,71 @@ +% memo +% +% 10 August 2018 + +# NAME +memo + +# SYNOPSIS +`memo [arguments]` + +# DESCRIPTION +A tool to memorize stuff. +It saves files `$MEMO_DIR` (`$HOME/memo` by default). +The structure is `$MEMO_DIR//memo.md` +You can also copy files in the topic folder as well. + +We call the folder `$MEMO_DIR/` a 'topic folder'. + +# COMMANDS + +`add [text]` +: Adds text to the `memo.md` in the topic folder. If text is not given it will read from stdin. + +`rm ` +: Remove `$MEMO_DIR/topic` folder with all its content. + +`copy ` +: Copy a file to the topic folder. + +`search ` +: Search for a term in `$MEMO_DIR` using `ack`. + +`show ` +: Shows `memo.md` in the topic folder. Also shows a list of all files in the topic folder. + +`edit ` +: Opens your favorite editor to edit the memo topic. + +`list` +: Prints a list of all topics. + +`git ` +: Run a git command in `$MEMO_DIR`. Once `$MEMO_DIR` is a git repository, all memo commands create commits. + +# CONFIGURATION + +`$MEMO_DIR` +: holds the folder where to store the memo files. Default is `$HOME/memo`. + +`$EDITOR` +: Your favorite editor. Must be set for the edit command. + +# EXAMPLE + +Append the string "A search-engine" to the `memo.md` file +in the topic "google". + + $ memo add google A search-engine + +Appends the content of `www.google.com` to the `memo.md` file +the topic "google". + + $ curl www.google.com | memo add google + +Copy the "Invoice.pdf" file to the "lawsuit" topic. + + $ memo copy lawsuit ~/Downloads/Invoice.pdf + +Make `$MEMO_DIR` a git repository. + + $ memo git init diff --git a/doc/memo.txt b/doc/memo.txt deleted file mode 100644 index 0a141a0..0000000 --- a/doc/memo.txt +++ /dev/null @@ -1,67 +0,0 @@ -NAME - memo - -SYNOPSIS - memo [arguments] - -DESCRIPTION - A tool to memorize stuff. - It saves files $MEMO_DIR ($HOME/memo by default). - The structure is $MEMO_DIR//memo.md - You can also copy files in the topic folder as well. - - We call the folder $MEMO_DIR/ a 'topic folder'. - - -COMMANDS - add [text] adds text to the memo.md in the topic folder. - if text is not given it will read from stdin. - - rm remove $MEMO_DIR/topic folder with all it's content. - - copy copy a file to the topic folder. - - search search for a term in $MEMO_DIR using ack. - - show shows memo.md in the topic folder. - also showes a list of all files in the topic folder - - edit opens your favorite editor to edit the memo topic - - list prints a list of all topics. - - git run git command in $MEMO_DIR. - Once $MEMO_DIR is a git repository all memo commands create commits. - - - -CONFIGURATION - - $MEMO_DIR holds the folder where to store the memo files. - Default is $HOME/memo - - $EDITOR Your favorite editor. Must be set for the edit command - -EXAMPLE - - - Append the string "A search-engine" to the memo.md file - in the topic "google". - - $> memo add google A search-engine - - Appends the content of "www.google.com" to the memo.md file - the topic "google". - - $> curl www.google.com | memo add google - - Copy the "Invoice.pdf" file to the "lawsuit" topic. - - $> memo copy lawsuit ~/Downloads/Invoice.pdf - - Make $MEMO_DIR a git repository. - - $> memo git init - - - diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..acf295d --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +{ pkgs ? import {} }: +let manPath = doc/memo.1; +in pkgs.stdenv.mkDerivation { + name = "memo"; + buildInputs = [ + (pkgs.writeShellScriptBin "make-man" '' + ${pkgs.pandoc}/bin/pandoc --standalone --to man -o ${toString manPath} doc/memo.1.md + '') + (pkgs.writeShellScriptBin "view-man" '' + ${pkgs.man-db}/bin/man ${toString manPath} + '') + ]; +}