Skip to content

Commit 6d071f7

Browse files
author
Scott Shipp
committed
Initial commit
- Add noted script - Add README - Add .gitignore
1 parent 8734d65 commit 6d071f7

File tree

7 files changed

+595
-1
lines changed

7 files changed

+595
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

README.md

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,207 @@
11
# noted
2-
Powerful CLI for taking markdown notes in a journal-like (time-seried) fashion
2+
3+
_Lightweight CLI for taking markdown notes in a journal-like (time-seried) fashion on macOS._
4+
5+
## Contents
6+
7+
- [Features](#features)
8+
- [Getting Started](#getting-started)
9+
* [Required steps](#required-steps)
10+
* [Optional steps](#optional-steps)
11+
- [Typical usage](#typical-usage)
12+
- [Subcommand reference](#subcommand-reference)
13+
- [Configuration guide](#configuration-guide)
14+
* [Default values](#default-values)
15+
* [Configuring custom values](#configuring-custom-values)
16+
* [Custom template file](#custom-template-file)
17+
- [Recommended aliases](#recommended-aliases)
18+
19+
## Features
20+
21+
_Noted_ can do the following and more:
22+
23+
- Automatically create a markdown file for you, named with today's date (in a customizable date format)
24+
- Append note entries from the command line automatically, formatted with a Markdown template you can customize
25+
- Timestamp all entries with a customizable timestamp format
26+
- Quickly open the notes from any given date for you to view or edit
27+
- Work with any text editor, with no interference between `noted` and the editor
28+
29+
## Getting Started
30+
31+
### Required steps
32+
33+
Getting started with _Noted_ only requires that `noted` is placed on your path.
34+
35+
A good standard way to do this is to symlink the `noted` script to `/usr/local/bin` as follows.
36+
37+
1. Open a terminal.
38+
2. Change to your `Documents` directory.
39+
40+
```shell
41+
cd $HOME/Documents
42+
```
43+
44+
3. Clone this repository to your Documents folder.
45+
46+
```shell
47+
git clone git@github.com:scottashipp/noted.git -C $HOME/Documents
48+
```
49+
50+
4. Symlink the file:
51+
52+
```shell
53+
ln -s $HOME/Documents/noted/noted /usr/local/bin/noted
54+
```
55+
56+
6. Verify that it is visible on the path:
57+
58+
```shell
59+
noted version
60+
```
61+
62+
If the above outputs `noted v0.0.1` then all is well. Check out the [Typical usage](#typical-usage) section below to take your first notes!
63+
64+
### Optional steps
65+
66+
You may want to follow the [configuration guide](#configuration-guide) if you do not like the defaults.
67+
68+
## Typical usage
69+
70+
You're a developer. It's 8am and you start work on a new project. From your terminal, you type:
71+
72+
```shell
73+
noted 'Begin creating Foo'
74+
```
75+
76+
A new Markdown file is automatically created with today's date in your configured directory.
77+
78+
> Note: The default directory is $HOME/Documents/noted. It will be created for you if it doesn't exist.
79+
80+
Second, `noted` also creates the following _automatic entry:_
81+
82+
```markdown
83+
---
84+
8:00:44 UTC
85+
86+
# Begin creating Foo
87+
88+
---
89+
```
90+
91+
At 9am, you have a meeting with the Foo team. You type `noted` in your terminal to start a new note. Your default editor opens to today's file, the template is
92+
automatically appended to the end, and it is timestamped for you. You use this entry to take notes during your meeting, which include links, images, and code.
93+
94+
Later, you start work again, and note this:
95+
96+
```shell
97+
noted 'Working on foo again.'
98+
```
99+
100+
You're trying to remember what your team talked about in last week's meeting, so you view the notes for that day:
101+
102+
```shell
103+
noted view 2021-09-27
104+
```
105+
106+
This opens the file from that date with your default editor.
107+
108+
After a bit, you open a pull request for Foo. You type:
109+
110+
```shell
111+
noted
112+
```
113+
114+
This automatically opens today's file in your default editor, and appends a new entry using the template. In the resulting new entry, you record the link to the
115+
PR.
116+
117+
The rest of the day goes similarly. At the end of the day, you check in your notes to Git.
118+
119+
Your notes page, when viewed as HTML looks [just like this](example-notes-page.md):
120+
121+
![](example-notes-page.jpeg)
122+
123+
You now have a source-controlled, time-seried journal of events. Most importantly, these notes look great and include links, snippets of code, and images.
124+
125+
## Subcommand reference
126+
127+
_Noted_ works like many other CLI's, through the use of subcommands. It currently supports config, create, edit, version, and view. These are fully-specified in
128+
the [subcommand reference](subcommands.md)
129+
130+
## Configuration guide
131+
132+
### Default values
133+
134+
The following default values are configured.
135+
136+
| Property | Description | Default Value |
137+
| :-- | :-- | :-- |
138+
| NOTED_MARKDOWN_HOME | The place where markdown files are automatically generated. | `$HOME/Documents/noted` |
139+
| NOTED_FILE_NAME_DATE_FORMAT | The date format string used as the file name for new notes. | `"+%Y-%m-%d"` |
140+
| NOTED_TIMESTAMP_FORMAT | The timestamp format for the timestamp placed on new entries. | `"+%H:%M:%S UTC"` |
141+
| NOTED_TEMPLATE_FILE | A file containing a Markdown-formatted entry template to use. | `""` <br /> (It is empty by default. Which means the script's own default template will be used.) |
142+
143+
### Configuring custom values
144+
145+
To configure custom values, you may place a `.notedconfig` file in your `$HOME` directory.
146+
147+
For example, saving the following contents into `$HOME/.notedconfig` will alter the behavior of `noted` accordingly:
148+
149+
```text
150+
# Save my notes here instead
151+
NOTED_MARKDOWN_HOME=$HOME/Documents/mynotes
152+
# Use month-date-year instead of year-month-date as the file names
153+
NOTED_FILE_NAME_DATE_FORMAT="+%m-%d-%Y"
154+
# Use Pacific time
155+
NOTED_TIMESTAMP_FORMAT="+%H:%M:%S Pacific"
156+
# Use my own template file
157+
NOTED_TEMPLATE_FILE=$HOME/Documents/mynotes/template.md
158+
```
159+
160+
Both the `NOTED_FILE_NAME_DATE_FORMAT` and the `NOTED_TIMESTAMP_FORMAT` are format strings as specified by the `date` shell command. You can learn more about
161+
this format by reading the man page for `date`.
162+
163+
### Custom template file
164+
165+
_Noted_ templates only support the variables `TIMESTAMP` and `HEADERTEXT`.
166+
167+
`TIMESTAMP` is replaced with the output of `date` as formatted by `NOTED_TIMESTAMP_FORMAT`.
168+
169+
'HEADERTEXT' is the value of any argument passed to `noted` when quick-creating a note. Place it in your template so that this value is output.
170+
171+
By default, `noted` uses the following template:
172+
173+
```markdown
174+
---
175+
TIMESTAMP
176+
177+
# HEADERTEXT
178+
179+
---
180+
```
181+
182+
Another valid custom template might be:
183+
184+
```markdown
185+
# HEADERTEXT
186+
187+
<small>_TIMESTAMP_</small>
188+
189+
190+
```
191+
192+
## Recommended aliases
193+
194+
Besides supplying a custom configuration, you probably want to add the following aliases to make using `noted` even easier:
195+
196+
| Alias | Description |
197+
| :-- | :-- |
198+
| n | Alias for `noted` itself. |
199+
| ne | Alias for `noted edit`. |
200+
| nv | Alias for `noted version`. |
201+
| nc | Alias for `noted config`. |
202+
203+
## Usage with a static site generator
204+
205+
Some people may prefer to use `noted` with a static site generator like [mkdocs](https://www.mkdocs.org)
206+
, [Maven site](https://maven.apache.org/plugins/maven-site-plugin/), or [Hugo](https://gohugo.io/). Those are just a few examples. Doing so will allow you to
207+
view your notes in HTML format locally.

example-notes-page.jpeg

47.8 KB
Loading

example-notes-page.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
7:45:44 UTC
3+
4+
# This is the example notes page
5+
6+
It comes from the [Typical Usage](README.md#typical-usage) section of the README.
7+
8+
---
9+
10+
---
11+
8:00:44 UTC
12+
13+
# Begin creating Foo
14+
15+
16+
---
17+
18+
---
19+
9:00:44 UTC
20+
21+
# Meet with the Foo team
22+
23+
Whiteboarded over our virtual meeting. We came out with some great ideas! Check it out:
24+
25+
![](nice-diagram.png)
26+
27+
Also Dom showed us a really nice trick with Java:
28+
29+
```java
30+
System.out.println("Hello, World!"
31+
```
32+
33+
---
34+
35+
---
36+
11:22:44 UTC
37+
38+
# Foo's first pull request!
39+
40+
🎉 We opened [Foo's first pull request today](https://github.com/scottashipp/noted/pulls/1)!
41+
42+
---
43+

nice-diagram.png

26.2 KB
Loading

0 commit comments

Comments
 (0)