A text-to-markdown list generator in go
!
lmd
is a tool written by me to:
- Practice the
go
programming language with a small project - Solve a problem in that I need an easy way to manage my task lists and have some way to archive them for future reflections
It just takes any plain text files and saves it into a markdown list. See the Input Format section in this document for details how that is represented.
As of now, there is a prebuilt binary for macOS in the bin
folder. If you want to build a custom version, you can
follow this section.
You will need:
- Most recent version of the
go
compiler. - A
bin
folder within the project root. It is recommended that the binary is placed here. - Computer in UNIX environment to run scripts. This means, macOS, Linux or Windows with WSL.
To build, just navigate to the project root and execute the following command:
go build -o bin/lmdsh
Now, lmd
will be the binary that lives in the bin
folder.
⚠️ The script on the project root makes assumptions that the binary is already in thebin
folder.
The lmdsh
script is very opinionated. You'll have to edit it yourself to make it work the way you want.
lmdsh
looks like this:
DATE=$(date '+%Y-%m-%d')
./bin/lmd $1 > output/$DATE.md
cp output/$DATE.md ~/code/work-log
cd ~/code/work-log
git add . && git commit -m "$DATE log" && git push
lmd
is executed and is assumed to be in thebin
folder.- A file with the filename format
$DATE.md
is output. - Once an output markdown file is generated, the output markdown file is copied to a
git
repository within~/code/work-log
. - Go to the
git
repository and commit things.
Notice that you can modify any step in the script. Most likely you'll want to modify the part where the output file is copied to a git
repo.
Feel free to hack around.
Execute the lmdsh
script with a path to the input text file as an argument:
./lmdsh /path/to/input.txt
Input files are just regular text files with the assumption that the first line is the title of the list. Every line following the first line is a list item.
So something like this:
my list
wake up
brush teeth
read
breakfast
Turns into this:
# my list
* [ ] wake up
* [ ] brush teeth
* [ ] read
* [ ] breakfast
Reach out to me if you have issues. This was written as a personal project and I just wanted to share so that others may use it or get some inspiration on their own. 😄
Website: https://roger.lol
Email: [email protected]