Pandoc would output warnings about a lack of title, although we are not
using it in the template.
Also, the tool would fail to do some git commands because it was
checking the wrong folder
Issue #14
I still want, at some point, to add to other formats but this is fine
for now.
The tool uses pandoc to do the conversion from md to html
A sample template (without any styling) is provided. This can be
overwritten in $HOME/.config/kb/templates/main.html or in the
knowledgebase directory under `templates`.
FZF exits with a status of 1 if nothing was selected. This is often the
case though if we are creating a new file so I added `|| true` to make
bash continue anyway
Instead of using $1 for file names, $* is used which results in spaces
being allowed without quoting.
This is in line with how the new command works.
As an example, it means the command
```
kb edit this is a test
```
will try and edit a file with the title "this is a test" rather than
"this"
The first bug output an error if trying to stage the deletion of the
yaml file if the file never existed. The error is now piped to /dev/null
and `|| true` is appended to the line which causes the script to carry
on execution
The second change is when deleting a file, you no longer have to quote
the file name if it is a multi word file. This puts it in line with the
new command
Work on #16
This was a relatively large amount of work. It introduces assets which
are stored in the assets sub directory and stored in the database with
the asset type in the database.
Due to bat also reading the $PAGER environment variable, I first look to
see if bat is available. If it is, I use that. If it isn't, I use the
$PAGER environment variable. If that's not available, I use cat.
I also added the --editor flag to the help output which had clearly been
missed
Close#12
This can be used when a file is modified externally. It will update the
sqlite database and potentially run git commands for the change.
If there are 2 files provided, it assumes that the file was moved. The
first filename should be the old file.
The new, edit and delete functions were also re factored slightly to use
this new update function.
Relevant to #4Close#2Close#1
This will list the tags along with the number of number of times it is
used.
An optional --noheader flag can be passed after the command to prevent
the header being printed.
e.g.
```
$ kb list-tags
name count
---------------- -----
Linux 2
Authentication 1
Pentesting 1
Enumeration 3
Network Protocol 2
```
```
$ kb list-tags --noheader
Linux 2
Authentication 1
Pentesting 1
Enumeration 3
Network Protocol 2
```
This --noheader flag was also added to the list command
Close#10