diary

Text-based journaling program
git clone https://git.in0rdr.ch/diary.git
Log | Files | Refs | README | LICENSE

commit c0f3b214533682e96241b6763042b81516606554
parent d1db734ca5eca02bc71d4ae903a527523cbeaf15
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Sun, 21 Aug 2022 02:39:54 +0200

feat: change code uri

Diffstat:
MAUTHORS.md | 5++---
MCHANGELOG.md | 1+
MREADME.md | 9++++-----
Mman1/diary.1 | 150+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mman1/diary.1.html | 12+++++-------
Mman1/diary.1.scd | 8+++-----
Msrc/diary.c | 2+-
7 files changed, 90 insertions(+), 97 deletions(-)

diff --git a/AUTHORS.md b/AUTHORS.md @@ -1,10 +1,10 @@ # Authors -- Andreas Gruhler (https://codeberg.org/in0rdr/diary) +- Andreas Gruhler (https://code.in0rdr.ch/diary) - Matthias Beyer (https://github.com/matthiasbeyer) - Johnathan Jenkins (https://github.com/shaggytwodope) - Yu-Jie Lin (https://github.com/livibetter) - Balduin Dettling (https://github.com/mbjd) - Avindra Goolcharan (https://github.com/avindra) - Oliver Blanthorn (https://github.com/bovine3dom) -- Jonny Burger (https://github.com/JonnyBurger) -\ No newline at end of file +- Jonny Burger (https://github.com/JonnyBurger) diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -6,6 +6,7 @@ * #11: Fix repeated 'S' key press * #10: Fix malloc for google_tokenfile * #3: Improve handling for tokenfile when offline (Caldav sync) +* Move source code from Codeberg ### Added * #6/7: LTTng instrumentation for development and debugging purposes diff --git a/README.md b/README.md @@ -3,7 +3,7 @@ This is a text-based diary, inspired by [khal](https://github.com/pimutils/khal). Journal entries are stored in text files. ## Demo -![Diary Demo](https://codeberg.org/in0rdr/diary/raw/branch/master/img/demo.gif) +![Diary Demo](https://code.in0rdr.ch/diary/file/img/demo.gif.html) [Quickstart Tutorial](https://diary.in0rdr.ch) @@ -54,7 +54,7 @@ This is a text-based diary, inspired by [khal](https://github.com/pimutils/khal) Keybinding Cheat Sheet: -![diary cheat sheet](https://codeberg.org/in0rdr/diary/raw/branch/master/img/diary-cheat-sheet.png) +![diary cheat sheet](https://code.in0rdr.ch/diary/file/img/diary-cheat-sheet.png.html) ## Install @@ -194,7 +194,7 @@ The most recently modified entry is considered up to date and is automatically r No sync is performed, when both files (local/remote) have the same last modified timestamp or no files exists on the server and on disk at all (i.e., no entry for that date). -Currently, only the Google Calendar is supported as remote provider. Please open an [issue](https://codeberg.org/in0rdr/diary/issues) to implement support for additional remote calendar servers. +Currently, only the Google Calendar is supported as remote provider. The calender for synchronization can be defined with the [configuration](#Configuration-File) key `google_calendar`: ``` @@ -239,4 +239,4 @@ For a list of contributors see the [AUTHORS.md](./AUTHORS.md). ## Community and Support -For question and support visit [#diary/libera](https://web.libera.chat/gamja/#diary) on IRC. -\ No newline at end of file +For question and support visit [#diary/libera](https://web.libera.chat/gamja/#diary) on IRC. diff --git a/man1/diary.1 b/man1/diary.1 @@ -1,11 +1,11 @@ -.\" Generated by scdoc 1.10.1 +.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: -.TH "DIARY" "1" "2022-01-17" +.TH "DIARY" "1" "2022-08-21" .P .SH NAME .P @@ -13,13 +13,13 @@ diary - text-based journaling program .P .SH SYNOPSIS .P -\fBdiary\fR [OPTION]... [DIARY_DIR]... +\fBdiary\fR [OPTION].\&.\&.\& [DIARY_DIR].\&.\&.\& .P .SH DESCRIPTION -Open the \fBdiary\fR journal for entries stored in \fBDIARY_DIR\fR. +Open the \fBdiary\fR journal for entries stored in \fBDIARY_DIR\fR.\& .P \fBDIARY_DIR\fR is required, if not set as environment variable or defined in the -\fBCONFIGURATION FILE\fR. +\fBCONFIGURATION FILE\fR.\& .P .SH OPTIONS .P @@ -50,58 +50,58 @@ Text editor used for opening the journal files \fB-f, --fmt\fR=FMT .P .RS 4 -FMT is a custom date and file format. Change with care, because the -diary reads and writes to files with file name FMT. The new FMT is only -applied to newly saved entries. Existing entries with the old FMT are +FMT is a custom date and file format.\& Change with care, because the +diary reads and writes to files with file name FMT.\& The new FMT is only +applied to newly saved entries.\& Existing entries with the old FMT are not automatically migrated to the new FMT and do not show up with a new -FMT specifier. Consequently, a change in FMT shows an empty diary at -first. Rename all files in the \fBDIARY_DIR\fR to migrate to a new FMT. +FMT specifier.\& Consequently, a change in FMT shows an empty diary at +first.\& Rename all files in the \fBDIARY_DIR\fR to migrate to a new FMT.\& .P .RE \fB-F, --fmt-cmd\fR=FMT_CMD .P .RS 4 -Journal entries are formatted with this command. If not set (default), +Journal entries are formatted with this command.\& If not set (default), the characters are printed to the preview screen character by character -(without word wrap). For example, to enable word wrap after 75 -characters, use "fmt -s" as FMT_CMD. To format markdown, use "mdcat -c" -or similar, see \fBCUSTOM FORMATTING\fR. +(without word wrap).\& For example, to enable word wrap after 75 +characters, use "fmt -s" as FMT_CMD.\& To format markdown, use "mdcat -c" +or similar, see \fBCUSTOM FORMATTING\fR.\& .P .RE \fB-p, --no-pty\fR .P .RS 4 -No pseudo terminal (pty) for entry preview. Only effective in -combination with \fB--fmt-cmd\fR. If set, the output of \fB--fmt-cmd\fR is displayed -with Ncurses. If not set (default), the result of \fB--fmt-cmd\fR (journal +No pseudo terminal (pty) for entry preview.\& Only effective in +combination with \fB--fmt-cmd\fR.\& If set, the output of \fB--fmt-cmd\fR is displayed +with Ncurses.\& If not set (default), the result of \fB--fmt-cmd\fR (journal entry preview) is printed on a pseudo-terminal (pty) and not processed -with Ncurses. The pty supports the ANSI escape sequences (e.g. colors, -font types, etc.) of the native terminal. +with Ncurses.\& The pty supports the ANSI escape sequences (e.\&g.\& colors, +font types, etc.\&) of the native terminal.\& .P .RE \fB-m, --no-mouse\fR .P .RS 4 -Disable mouse, don't listen for mouse events. Mouse events are enabled -by default. Without \fB--no-mouse\fR flag (default), native text selection and +Disable mouse, don'\&t listen for mouse events.\& Mouse events are enabled +by default.\& Without \fB--no-mouse\fR flag (default), native text selection and right-click in the preview window requires holding down the SHIFT key, -see \fBMOUSE EVENTS\fR. +see \fBMOUSE EVENTS\fR.\& .P .RE \fB-r, --range\fR=RANGE .P .RS 4 -The number of years to show before/after today. Defaults to 1 year. +The number of years to show before/after today.\& Defaults to 1 year.\& .P .RE \fB-f, --weekday\fR=DAY .P .RS 4 -First day of the week. DAY is an integer in range (0..6), interpreted as -0 or 7 = Sun, 1 = Mon, ..., 6 = Sat. If glibc is installed, the first +First day of the week.\& DAY is an integer in range (0.\&.\&6), interpreted as +0 or 7 = Sun, 1 = Mon, .\&.\&.\&, 6 = Sat.\& If glibc is installed, the first day of the week is derived from the current locale setting ($LANG, see -man locale). Without glibc, the first weekday defaults to 1 (Monday), -unless specified otherwise with this option. +man locale).\& Without glibc, the first weekday defaults to 1 (Monday), +unless specified otherwise with this option.\& .P .RE .SH NAVIGATION @@ -211,12 +211,12 @@ T} T{ \fBi\fR T} T{ -import entries from .ics file +import entries from .\&ics file T} T{ \fBE\fR T} T{ -export entries to .ics file +export entries to .\&ics file T} T{ \fBq\fR @@ -231,21 +231,21 @@ T} \fBDIARY_DIR\fR .RS 4 If this variable is set to a directory that can be opened, diary will -use it to store diary files. Diary files are simple text files named -after their date, formatted according to \fBFMT\fR (see \fB--fmt\fR option). The -format defaults to "%Y-%m-%d", which is "YYYY-MM-DD" (see man strftime). -All other files different from FMT are ignored. +use it to store diary files.\& Diary files are simple text files named +after their date, formatted according to \fBFMT\fR (see \fB--fmt\fR option).\& The +format defaults to "%Y-%m-%d", which is "YYYY-MM-DD" (see man strftime).\& +All other files different from FMT are ignored.\& .P .RE \fBEDITOR\fR .RS 4 -The program used to edit journal entries inside \fBDIARY_DIR\fR. +The program used to edit journal entries inside \fBDIARY_DIR\fR.\& .P .RE \fBLANG\fR .RS 4 The default locale used to display the first day of the week, see -\fB--weekday\fR option. +\fB--weekday\fR option.\& .P .P .RE @@ -253,7 +253,7 @@ The default locale used to display the first day of the week, see .P If the argument \fBDIARY_DIR\fR is given, diary files are read from and stored to that directory, ignoring the $DIARY_DIR environment variable, any \fB--dir\fR option -or the \fBdir\fR value set in the \fBCONFIGURATION FILE\fR. +or the \fBdir\fR value set in the \fBCONFIGURATION FILE\fR.\& .P .SH FILES .P @@ -262,15 +262,15 @@ ${PREFIX:-/usr/local/bin}/\fBdiary\fR The diary binary .P .RE -${XDG_CONFIG_HOME:-~/.config}/diary/\fBdiary.cfg\fR +${XDG_CONFIG_HOME:-~/.\&config}/diary/\fBdiary.\&cfg\fR .RS 4 An optional diary \fBCONFIGURATION FILE\fR .P .RE .SH CONFIGURATION FILE .P -The \fBdiary.cfg\fR configuration file can optionally be used to persist diary -configuration. Use the "#" or ";" characters to comment lines. +The \fBdiary.\&cfg\fR configuration file can optionally be used to persist diary +configuration.\& Use the "#" or ";" characters to comment lines.\& .P Create default configuration location: .P @@ -314,73 +314,71 @@ EOF .P .SH CUSTOM FORMATTING .P -The preview of the journal entries can be processed with a custom \fB--fmt-cmd\fR. +The preview of the journal entries can be processed with a custom \fB--fmt-cmd\fR.\& The result of this formatting command is printed to a pseudo-terminal (pty) by -default. This behavior can be changed with the \fB--no-pty\fR flag. The output +default.\& This behavior can be changed with the \fB--no-pty\fR flag.\& The output processed on the pty (without Ncurses) includes all ANSI escape characters -supported by the terminal (colors, font types, etc.). Thus, formatters like +supported by the terminal (colors, font types, etc.\&).\& Thus, formatters like "fmt", or any "cat like program" ("mdcat" to process Markdown) can be plugged in -for \fB--fmt-cmd\fR. +for \fB--fmt-cmd\fR.\& .P .SH MOUSE EVENTS .P -Mouse events are listened for by default (\fBno_mouse\fR=false configuration). This +Mouse events are listened for by default (\fBno_mouse\fR=false configuration).\& This behavior can be disabled with the \fB--no-mouse\fR flag or in the \fBCONFIGURATION -FILE\fR (\fBno_mouse\fR=true). With \fBno_mouse\fR=false (default), use the SHIFT key for -native text selection and right-click in the preview window. +FILE\fR (\fBno_mouse\fR=true).\& With \fBno_mouse\fR=false (default), use the SHIFT key for +native text selection and right-click in the preview window.\& .P .SH IMPORT .P The import functionality can be triggered by pressing \fBi\fR and expects a path to -an ics file. Files in the \fBDIARY_DIR\fR are overwritten with the entries from the -imported ics file. +an ics file.\& Files in the \fBDIARY_DIR\fR are overwritten with the entries from the +imported ics file.\& .P .SH EXPORT .P The export functionality can be triggered by pressing \fBE\fR and asks for a file -path to an ics file for storing the journal entries. The ics file will be -created if it does not exist. Existing ics files are overwritten. +path to an ics file for storing the journal entries.\& The ics file will be +created if it does not exist.\& Existing ics files are overwritten.\& .P .SH CALDAV SYNC .P -The journal files can be synced via CalDAV by pressing \fBs\fR. Pressing \fBS\fR syncs -all journal entries of the active month. +The journal files can be synced via CalDAV by pressing \fBs\fR.\& Pressing \fBS\fR syncs +all journal entries of the active month.\& .P The most recently modified entry is considered up to date and is automatically -replaced on the remote side. If the remote file is more recent, the local file -can be replaced with the remote content after confirmation. +replaced on the remote side.\& If the remote file is more recent, the local file +can be replaced with the remote content after confirmation.\& .P No sync is performed, when both files (local/remote) have the same modification -timestamp or no files exists on the server and on disk at all (i.e., no entry -for that date). +timestamp or no files exists on the server and on disk at all (i.\&e.\&, no entry +for that date).\& .P -Use the EXPORT/IMPORT functionality for more batch oriented processing. Making +Use the EXPORT/IMPORT functionality for more batch oriented processing.\& Making a network request and deciding the most recently modified entry (local/remote) -takes quite some time for large batches. +takes quite some time for large batches.\& .P -Currently, only the Google Calendar is supported as remote provider. Please -open an [issue](https://codeberg.org/in0rdr/diary/issues) to implement support -for additional remote calendar servers. +Currently, only the Google Calendar is supported as remote provider.\& .P The calender for synchronization can be defined with the configuration key -"google_calendar", see \fBCONFIGURATION FILE\fR. This key is empty by default. +"google_calendar", see \fBCONFIGURATION FILE\fR.\& This key is empty by default.\& .P -Read GOOGLE CALENDAR OAUTH2 to setup authorization with the Google server. +Read GOOGLE CALENDAR OAUTH2 to setup authorization with the Google server.\& .P .SH GOOGLE CALENDAR OAUTH2 .P The Google Calendar CalDAV API is protected with OAuth2: .P -https://developers.google.com/identity/protocols/oauth2 +https://developers.\&google.\&com/identity/protocols/oauth2 .P The credentials and the consent screen can be redefined at compile time (export "GOOGLE_OAUTH_CLIENT_ID"/"GOOGLE_OAUTH_CLIENT_SECRET" to environment) or during runtime with the keys "google_clientid"/"google_secretid" in the \fBCONFIGURATION -FILE\fR. The token used to authenticate with the Google API is stored in the file -specified by "google_tokenfile" and renewed automatically. +FILE\fR.\& The token used to authenticate with the Google API is stored in the file +specified by "google_tokenfile" and renewed automatically.\& .P The application requires two OAuth2 scopes -(https://developers.google.com/calendar/auth) for CalDAV requests: +(https://developers.\&google.\&com/calendar/auth) for CalDAV requests: .P .RS 4 .ie n \{\ @@ -389,7 +387,7 @@ The application requires two OAuth2 scopes .el \{\ .IP 1. 4 .\} -"https://www.googleapis.com/auth/calendar": read/write access to Calendars - +"https://www.\&googleapis.\&com/auth/calendar": read/write access to Calendars - required to discover the unique hyperlink/URI for the calendar specified by config key "google_calendar" .RE @@ -400,13 +398,13 @@ config key "google_calendar" .el \{\ .IP 2. 4 .\} -"https://www.googleapis.com/auth/calendar.events.owned": read/write access to +"https://www.\&googleapis.\&com/auth/calendar.\&events.\&owned": read/write access to Events owned by the user - allows diary to create/read/update/delete events in "google_calendar" .RE .P -The user is asked for consent during the first CALDAV SYNC. +The user is asked for consent during the first CALDAV SYNC.\& .P .SH PRECEDENCE RULES .P @@ -429,7 +427,7 @@ T} T{ 1 T} T{ -No default for \fBDIARY_DIR\fR. Defaults for "range", "weekday", "fmt" and "editor" are provided in "diary.h". If \fBEDITOR\fR is unset and no editor is provided in the \fBCONFIGURATION FILE\fR or \fB--editor\fR option, the diary works read-only. Journal files cannot be opened. If \fBDIARY_DIR\fR is not provided, the diary won't open. +No default for \fBDIARY_DIR\fR.\& Defaults for "range", "weekday", "fmt" and "editor" are provided in "diary.\&h".\& If \fBEDITOR\fR is unset and no editor is provided in the \fBCONFIGURATION FILE\fR or \fB--editor\fR option, the diary works read-only.\& Journal files cannot be opened.\& If \fBDIARY_DIR\fR is not provided, the diary won'\&t open.\& T} T{ 2 @@ -457,7 +455,7 @@ T} .P If glibc is installed, the first weekday defaults to the locale defined in the current shell environment ($LANG, see man locale), unless specified otherwise -with the \fB--weekday\fR option. +with the \fB--weekday\fR option.\& .P Start with weekday=3(Wed), overrule any other configuration value: .nf @@ -510,10 +508,10 @@ diary .P .SH DEVELOPMENT AND SUPPORT .P -Contributions are always welcome! All source code is available at -https://codeberg.org/in0rdr/diary. +Contributions are always welcome!\& All source code is available at +https://code.\&in0rdr.\&ch/diary.\& .P -For question and support visit https://web.libera.chat/gamja/#diary. +For question and support visit https://web.\&libera.\&chat/gamja/#diary.\& .P .SH AUTHORS .P @@ -593,4 +591,4 @@ Jonny Burger .P .SH License .P -MIT License, https://codeberg.org/in0rdr/diary/raw/branch/master/LICENSE +MIT License, https://code.\&in0rdr.\&ch/diary/file/LICENSE.\&html diff --git a/man1/diary.1.html b/man1/diary.1.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <!-- This is an automatically generated file. Do not edit. - Generated by scdoc 1.10.1 + Generated by scdoc 1.11.2 Complete documentation for this program is not available as a GNU info page --> <head> @@ -295,8 +295,7 @@ EOF</pre> processing. Making a network request and deciding the most recently modified entry (local/remote) takes quite some time for large batches.</p> <p class="Pp">Currently, only the Google Calendar is supported as remote - provider. Please open an [issue](https://codeberg.org/in0rdr/diary/issues) - to implement support for additional remote calendar servers.</p> + provider.</p> <p class="Pp">The calender for synchronization can be defined with the configuration key &quot;google_calendar&quot;, see <b>CONFIGURATION FILE</b>. This key is empty by default.</p> @@ -415,7 +414,7 @@ EOF</pre> <h1 class="Sh" id="DEVELOPMENT_AND_SUPPORT"><a class="permalink" href="#DEVELOPMENT_AND_SUPPORT">DEVELOPMENT AND SUPPORT</a></h1> <p class="Pp">Contributions are always welcome! All source code is available at - https://codeberg.org/in0rdr/diary.</p> + https://code.in0rdr.ch/diary.</p> <p class="Pp">For question and support visit https://web.libera.chat/gamja/#diary.</p> </section> @@ -434,13 +433,12 @@ EOF</pre> </section> <section class="Sh"> <h1 class="Sh" id="License"><a class="permalink" href="#License">License</a></h1> -<p class="Pp">MIT License, - https://codeberg.org/in0rdr/diary/raw/branch/master/LICENSE</p> +<p class="Pp">MIT License, https://code.in0rdr.ch/diary/file/LICENSE.html</p> </section> </div> <table class="foot"> <tr> - <td class="foot-date">2022-01-17</td> + <td class="foot-date">2022-08-21</td> <td class="foot-os"></td> </tr> </table> diff --git a/man1/diary.1.scd b/man1/diary.1.scd @@ -239,9 +239,7 @@ Use the EXPORT/IMPORT functionality for more batch oriented processing. Making a network request and deciding the most recently modified entry (local/remote) takes quite some time for large batches. -Currently, only the Google Calendar is supported as remote provider. Please -open an [issue](https://codeberg.org/in0rdr/diary/issues) to implement support -for additional remote calendar servers. +Currently, only the Google Calendar is supported as remote provider. The calender for synchronization can be defined with the configuration key "google_calendar", see *CONFIGURATION FILE*. This key is empty by default. @@ -339,7 +337,7 @@ diary # DEVELOPMENT AND SUPPORT Contributions are always welcome! All source code is available at -https://codeberg.org/in0rdr/diary. +https://code.in0rdr.ch/diary. For question and support visit https://web.libera.chat/gamja/#diary. @@ -356,4 +354,4 @@ For question and support visit https://web.libera.chat/gamja/#diary. # License -MIT License, https://codeberg.org/in0rdr/diary/raw/branch/master/LICENSE +MIT License, https://code.in0rdr.ch/diary/file/LICENSE.html diff --git a/src/diary.c b/src/diary.c @@ -384,7 +384,7 @@ void usage() { printf(" -w, --weekday DAY : First day of the week, 0 = Sun, 1 = Mon, ..., 6 = Sat\n"); printf("\n"); printf("Full docs and keyboard shortcuts: 'man diary'\n"); - printf("or online at <https://codeberg.org/in0rdr/diary>\n"); + printf("or online at <https://code.in0rdr.ch/diary>\n"); } int main(int argc, char** argv) {