Rewrite without regex crate.
The regex approach was broken. If the following _content_ was provided
in the entry:
foo
---
bar
The regex approach parsed the header until the "---" in the content.
This is, of course, not the way to do that.
Now, the parsing is implemented by hand. Should be faster as well,
though I don't care about this.
This fixes a severe bug.
This patch adds kairos support in the "list" subcommand for the "-f" and
"-t" parameters which limit the entries to show.
Something like
imag timetrack list --from yesterday
is now possible.
One trait is implemented on the Store, it retrieves BookmarkCollection
objects.
The other is implemented on `libimagstore::store::Entry` which then
represents a BookmarkCollection.
This patch is a rewrite for the imag-link commandline to automatically
recognize whether an internal or an external link is about to be made
and automatically do the right thing.
The commandline got a lot easier and also smaller in size (as in number
of commands), but the functionality should remain the same.
Before the configuration object (the raw TOML object) was provided via a
wrapper object `Configuration`. This was ugly and not very nice to use.
Now, we only have the `toml::Value` object we lend out from
`Runtime::config()`.
The changes included libimagrt internal rewrites, which are not visible
to the user. Anyways, this change changes the API for config-fetching
from the runtime, so fixes for all other crates may follow.
The changes also removed the support for reading the "editor" setting
from the configuration file, which was not used anyways (in the example
imagrc.toml file).
The CLI-reading and ENV-reading are still supported, though.
Before the iterator did also yield storeids for directories, which was a
bug.
This change introduces a new if_file() function in the store-internal
backend, which is needed to check whether a path actually points to a
File, be it inmemory or on the real filesystem.
That's because tests might fail if they check via PathBuf::is_file() as
in tests, the entries only exist inmemory.
The logger was not able to handle multiple destinations before. Now it
is possible for the logger.
The file must be held behind an Arc<Mutex<_>> so we can use the logging
from multiple threads but also because we need to borrow mutably, so
that bit changes whith this commit.
The imag-view command was redesigned with this change. It now looks up
view-templates in the config and calls them with the "in" subcommand.
This way, an entry can be viewed with editor, browser or whatever one
likes.
Compiling markdown is not supported yet.
This patch fixes a problem where the Store::delete() function only
checked the store-internal cache whether an entry exists, but not the
Filesystem. After this patch is applied, the Store::delete() function
also checks the filesystem whether the entry exists.
Also change that the implementation uses toml_query::set instead of
toml_query::insert.
Inserting values creates intermediate tables, set doesn't. And we really
want that convenience here, as the code is complex enough on its own.