commit c4a5b5d8d296f9c14f63906642065b0b376e30a9
parent 2b1201788f43de2647196d154d069578fb6d588e
Author: Andreas Gruhler <andreas.gruhler@uzh.ch>
Date: Wed, 28 Dec 2016 20:26:16 +0100
Merge pull request #40 from mbjd/man-page
Man page
Diffstat:
M | Makefile | | | 5 | +++++ |
A | diary.1 | | | 62 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -3,6 +3,9 @@ SRC = diary.c
PREFIX ?= /usr/local
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
+MANDIR := $(PREFIX)/share/man
+MAN1 = diary.1
+
CC = gcc
CFLAGS = -Wall
UNAME = ${shell uname}
@@ -30,6 +33,8 @@ clean:
install: $(TARGET)
cp $(TARGET) $(BINDIR)/$(TARGET)
+ install -D -m 644 $(MAN1) $(MANDIR)/man1/$(MAN1)
uninstall:
rm -f $(BINDIR)/$(TARGET)
+ rm -f $(MANDIR)/man1/$(MAN1)
diff --git a/diary.1 b/diary.1
@@ -0,0 +1,62 @@
+.TH DIARY 1
+.SH NAME
+diary \- Simple text-based diary program
+
+.SH SYNOPSIS
+.B diary
+[\fIDIRECTORY\fR]
+.br
+
+.SH DESCRIPTION
+.B diary
+is a simple text-based program for managing diary entries.
+
+.SH ENVIRONMENT
+
+.IP DIARY_DIR
+If this variable is set to a directory that can be opened,
+.B diary
+will use it to store diary files. Diary files are simple text files named
+after their date, formatted like YYYY-MM-DD. All other files are ignored.
+
+.IP EDITOR
+The program used to edit diary entries.
+
+
+.SH ARGUMENTS
+
+If the argument \fIDIRECTORY\fR is given, diary files are read from and
+stored to that directory, ignoring the DIARY_DIR environment variable.
+
+.SH NAVIGATION
+Navigation is done using the following vim-inspired keyboard shortcuts:
+
+.TS
+tab(|);
+l l.
+Key(s) | Action
+====== | ======
+k, up | go backward by 1 week
+j, down | go forward by 1 week
+h, left | go backward by 1 day
+l, right | go forward by 1 day
+J | go forward by 1 month
+K | go backward by 1 month
+
+e, enter | edit current entry
+d, x | delete current entry
+q | quit the program
+
+N | go to the previous diary entry
+n | go to the next diary entry
+g | go to the first date
+G | go to the last date
+
+t | jump to today
+s | jump to specific day
+.TE
+
+
+.SH DEVELOPMENT
+All source code is available in this github repository:
+<https://github.com/in0rdr/diary/>. Contributions are always welcome!