Skip to content

Commit

Permalink
Improve markdown files (#30)
Browse files Browse the repository at this point in the history
- files need final newline
- standardize format and language
- improve text for clarity, style, and flow
- fix markdown lint items

Co-authored-by: Stanislav (Stas) Katkov <[email protected]>
  • Loading branch information
philoserf and skatkov committed Sep 26, 2023
1 parent 6f8a960 commit e1a874b
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 66 deletions.
39 changes: 28 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
Expand All @@ -7,40 +8,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## [0.5] - 2022-08-23

### Refactoring

- Remove use of 'ioutil' deprecated class
- Refactor main and list classes to use switch statement
- Upgrade target for golang to 1.19
- Updating all dependencies
- Update dependencies

### Added

### Add
- Styling "quote" command with lipgloss
- Styling `-quote` command with lipgloss

## [0.4] - 2022-06-18
### Adds
- adding "quote" command to pick a random encouragement to journal

### Added

- add `-quote` command to pick a random encouragement to journal

## [0.3.2] - 2022-06-12
### Adds
- adds ability to edit entries through -edit command

### Added

- add ability to edit entries through `-edit` command

## [0.3.1] - 2022-06-12
### Change

### Changed

- proper exit status for edit files in list

## [0.3.0] - 2022-06-12

### Added
- Adding a basic 'list' command.

- Add a basic `-list` command.

## [0.2.1]
### Changed

### Changed

- Code refactoring, simplification

## [0.2]

### Added
- 'about' command was added

- `-about` command was added

## [0.1]

### Added

- First version that opens a current journal entry
3 changes: 3 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ notifications on [Github](https://github.com/skatkov/stoic) (at the top right:
“Watch”→“Custom”→“Releases”).

## MacOS

1. Download the latest version and unzip
- [**Download for Intel**](https://github.com/skatkov/stoic/releases/latest/download/stoic-mac-intel.zip)
- [**Download for M1 (ARM)**](https://github.com/skatkov/stoic/releases/latest/download/stoic-mac-arm.zip)
Expand All @@ -13,9 +14,11 @@ notifications on [Github](https://github.com/skatkov/stoic) (at the top right:
3. Copy to path, e.g. `mv stoic /usr/local/bin/stoic` (might require `sudo`)

## Linux

1. [**Download**](https://github.com/skatkov/stoic/releases/latest/download/stoic-linux.zip)
the latest version and unzip
2. Copy to path, e.g. `mv stoic /usr/local/bin/stoic` (might require `sudo`)

## Windows

Is not supported
111 changes: 59 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,109 +1,116 @@
# Stoic

![stoic](./demo.png)

`stoic` is a command line app for daily journaling with plain-text files. It helps maintain day-to-day journaling habbit by allowing you to:
- Instantly edit current day entry
- Journal using any plain-text format (txt, md, [xit](https://xit.jotaen.net/) or anything else)
- Basic templates support
- Works on Linux and OSX
- Overview/filtering of existing entries
Stoic is a command-line application for daily journaling with plain-text files. It helps maintain day-to-day journaling habits by allowing you to:

- Instantly edit the current day's entry
- Journal using any plain-text format (txt, md, [xit](https://xit.jotaen.net/), or anything else)
- Use journal file template support
- Work on Linux and OSX
- Review and filter existing entries

## Installation
Fast installation is possible through [brew](https://brew.sh/) on Linux or MacOS.

Installation is possible through [Homebrew](https://brew.sh/) on Linux or MacOS.

`brew install skatkov/tap/stoic`

If you want to download executable on your own, then there is another 📥 [Installation](INSTALL.md) instruction that comes with release.
You can also download the executable directly. See the 📥 [Installation](INSTALL.md) instructions.

## Usage
Run following commands in a terminal:

* `stoic` - opens todays journal entry in editor
* `stoic -list` (beta) - lists all existing entries and allows to pick one for edit.
* `stoic -edit "yesterday"` - will open or create file for previous days. Tries to understand natural dates ("2 days ago", "yesterday" and etc.)
* `stoic -quote` - shows random quote to encourage journaling habit
* `stoic -about` - shows information about cli app
In a terminal:

- `stoic`: open today's journal entry in the editor
- `stoic -list` (beta): list existing entries and pick one for editing
- `stoic -edit "<natural date>"`: open or create the previous day's file using natural dates like "2 days ago" and "yesterday"
- `stoic -quote`: shows a random quote encouraging the journaling habit
- `stoic -about`: shows information about the application

## Configuration

- Editor could be changed by setting $EDITOR global variable. (default: nano)
- Directory for journal could be changed by setting $STOIC_DIR global variable. (default: ~/Journal/)
- Provide file template through $STOIC_TEMPLATE global variable.
- Provide new extension format through $STOIC_EXT global variables. (default: md)
- The editor could be changed by setting the `$EDITOR` global variable. (default: `nano`)
- The directory for a journal could be changed by setting the `$STOIC_DIR` global variable. (default: `~/Journal/`)
- Provide file template through `$STOIC_TEMPLATE` global variable.
- Provide new extension format through `$STOIC_EXT` global variables. (default: `md`)

```
```shell
export EDITOR="neovim"
export STOIC_DIR="~/MEGAsync/journal/"
export STOIC_TEMPLATE="~/MEGAsync/journal/template.md"
export STOIC_EXT="md"
```

## Motivation
There is a recurring theme through biographies of great people - they all had journaling as a hobby.

I've been battling my inner demons with different methods in the past with varying success. But journaling has helped me keep these demons permanently at bay. My sleep will be peaceful, if it follows after careful and honest self-examination in my journal.
There is a recurring theme in biographies of great people. They had journaling as a hobby.

Existing software for journaling and note taking is too slow to load and filled with features I don'
t really need. Plain-text files stored in cloud storage and edited througn nano is more than enough. But some recurring manual work was still required - create new daily file and modify according to my template. This command line utility completely removes that manual work for me.
I've been battling my inner demons with different methods with varying success. But journaling has helped me keep these demons permanently at bay. My sleep will be peaceful if it follows after careful and honest self-examination in my journal.

Epictetus, great Stoic philospher and slave, once told to his students that "philosophy is something one should write down day by day". Hence name of this tool is a reference to this great human and hat tip to practical philosophy called Stoicism.
Existing software for journaling and note-taking needs to be faster to load and filled with features I don't need. Plain-text files stored in cloud storage and edited through Nano are more than enough. However, some recurring manual work was still required: creating a new daily file and modifying it according to my template. This command line utility completely removes that manual work for me.

Epictetus, the great Stoic philosopher and slave, once told his students that "philosophy is something one should write down day by day". Hence, the name of this tool is a reference to this great human and a hat tip to the practical philosophy called Stoicism.

## Obsidian integration
I wrote this tool our of frustration with existing note taking apps (everything has to be in the cloud these days), but there are other apps that followed similar design choices as `stoic` did.

I'm now using [Obsidian](https://obsidian.md/) as a fully featured writing app. Obsidian comes with some core plugins that you can enable, one of those is "Daily Notes" that does something similar to `stoic`. Notherless I still keep using `stoic` as a companion cli app to Obisidian, with light configuration changes they play perfectly together.
I wrote this tool out of frustration with existing note-taking apps (everything has to be in the cloud these days), but other apps followed similar design choices as Stoic did.

With 0.6 version of stoic a lot of settings are aligned with those Obsidian defaults to. In my case, only two settings are tweaked:
```
I'm now using [Obsidian](https://obsidian.md/) as a fully featured writing app. Obsidian comes with some core plugins that you can enable. One is "Daily Notes", which does something similar to Stoic. Nonetheless, I still keep using Stoic as a companion CLI application to Obsidian; with light configuration changes, they play perfectly together.

With the 0.6 version of Stoic, many settings align with those Obsidian defaults. In my case, only two settings are tweaked:

```shell
export STOIC_DIR="~/Obsidian/journal"
export STOIC_TEMPLATE="~/Obsidian/journal/template.md"
export STOIC_TEMPLATE="~/Obsidian/journal/template.md"
```

This closely corresponds to settings I have in obsidian daily notes:
![obsidian daily notes config](./obsidian-daily-notes.png)

The only thing that Stoic doesn't allow you to tweak is the date format. So, if you have that customized in obsidian, lousy luck.

The only thing that stoic doesn't allow you to tweak is date format. So if you have that customized in obsidian - bad luck.

but PR's are welcome, everything is fixable.
PRs are welcome. Everything is fixable.

## Development
As prerequisite, you need to have the [Go compiler](https://golang.org/doc/install).
Please check the [`go.mod`](go.mod) file to see what Go version stoic requires.

As a prerequisite, you need to have the [Go compiler](https://golang.org/doc/install).
Please check the [`go.mod`](go.mod) file to see what Go version Stoic requires.

Fetch the sources:

```
```shell
git clone https://github.com/skatkov/stoic.git
cd stoic
```

In order to build the project, run:
To build the project, run:

```
make build
```
`make build`

This automatically resolves the dependencies and compiles the source code into an
executable for your platform.
This automatically resolves the dependencies and compiles the source code into an executable for your platform.

## Contributions
This project is my little golang playground. It would be awesome to learn about any improvements that are appropriate for this codebase.

This project is my little Go playground. It would be awesome to learn about any appropriate improvements for this codebase.

Everyone is welcome to contribute.

## TODO's
I've been brainstorming for possible improvements and here is a rough list of ideas with no particular order:

- Calendar view for existing records )show dates, mark with green dots if there is a record for that day) - `stoic -cal` (with `bubbletea` tui framework + `cal` utility.
- Use GoReleaser to automate all the routine (homebrew tap, building)
- Handle Errors better
- Use normal CLI framework ([cobra](https://github.com/spf13/cobra) seems popular)
- add support for Windows
- Add ability to store configuration in dotfiles (not just ENV variables), Including ability to add custom editor, not one defined in $EDITOR
- `stoic -stats` to receive statistics about journaling (how much % you didn''t journal, average journal lenght and etc)
I've been brainstorming for possible improvements, and here is a rough list of ideas in no particular order:

- `stoic -cal`: perhaps with the `bubbletea` TUI framework and the `cal` utility. A calendar view for existing records showing dates marked with green dots if there is a record for that day.
- Use GoReleaser
- Improve error handling
- Use a CLI framework like [cobra](https://github.com/spf13/cobra)
- Add Windows support
- Add the ability to store configuration in dotfiles (not just ENV variables), including the ability to add a custom editor, not one defined in `$EDITOR`
- `stoic -stats`: statistics about journaling, % of days journaled, average journal length, etc.

## Feedback

Got some feedback or suggestions? Please open an issue or drop me a note!

* [Twitter](https://twitter.com/5katkov)
* [Personal Website](https://skatkov.com)
- [Twitter](https://twitter.com/5katkov)
- [Personal Website](https://skatkov.com)
2 changes: 1 addition & 1 deletion test/data/journal_with_entry/2022-just-name.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
random text
random text
2 changes: 1 addition & 1 deletion test/data/journal_with_various_entries/1984-01-25.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
random text
random text
2 changes: 1 addition & 1 deletion test/data/journal_with_various_entries/random.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
random text
random text

0 comments on commit e1a874b

Please sign in to comment.