Commit graph

934 commits

Author SHA1 Message Date
6b8c236b67 Merge branch 'libimaghabit-dont-copy-comment-to-instance' into master 2019-06-30 13:14:36 +02:00
f3c41915fd Do not create comment in habit instance
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 11:34:50 +02:00
191b535479 Change HabitInstance implementation to not contain comment in instance
This patch changes the HabitInstance implementation so that the comment
is not expected to exist in the instance object itself.

This is done for less data duplication.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 11:31:49 +02:00
a21d4b7122 Add DiaryId::get_date_representation() function
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-30 10:56:55 +02:00
0d5027051d Fix: Location of tags should not change in the refactoring
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
bd564ad209 Add tests
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
3eff42be5a Update dependency: toml-query: 0.9.2 for index-out-of-bounds fixes
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
ae9fbe866f Add test whether setting tags works
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
c5519da011 Tagable should not be implemented for Value
Oh my dear, what was I thinking?

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
51dad94cc9 Simplify implementation of has_tags()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
08ba6c68a6 Remove unused imports
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
59bea23004 Simplify implementation of has_tag()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
87bfb422dc Simplify implementation of remove_tag()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
e95a4cd15d Simplify implementation of add_tag()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
061c5beb85 Simplify implementation of set_tags()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
2ef57a69ed Simplify implementation using toml-query Partial
This patch rewrites the get_tags() function to use toml_query::read::Partial.

The helper functions is_tag_str and is_tag are rewritten for
compatiblity.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-29 21:36:59 +02:00
1047a06a64 Add trace output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-26 20:27:38 +02:00
8912939e29 libimagentrylink: Add debugging output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-26 20:27:35 +02:00
99da4b777a Rename module: timetrackingstore -> store 2019-06-26 20:27:06 +02:00
0eac6d9931 Add support for directional links
This patch adds support for directional links in libimagentrylink.

A directional link is added to the same header as the "internal" links,
which are unidirectional.

The "outgoing" link is added in "links.to", the "incoming" links are
added to "links.from".

This way we can always traverse all linkage. The `Linkable::links()`
method is changed to always return _all_ link.
The `Link` type was extended for notions of "to" and "from" links.

Also adds testing.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-26 20:26:41 +02:00
c9414d944d Fix expected link in test
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 21:43:07 +02:00
64b1d9c79c Add more debug output 2019-06-23 21:07:32 +02:00
45d0d2d3bb Add test whether adding an URL works
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 21:07:29 +02:00
ad3c2c6249 Rewrite UrlLinker
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 21:07:13 +02:00
ed8546c7dd Reimplement link module with header Partial
This patch reimplements the "link" module using the
`toml_query::read::Partial` feature.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 21:06:45 +02:00
cdc90f7be7 Refactor: Remove notion of "external link"s
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 13:11:49 +02:00
59ddb70345 Fix: Make sure links are sorted and deduplicated 2019-06-23 11:06:19 +02:00
d89a700fd1 Remove annotateable linking
This patch removes the annotateable linking feature from libimagentrylink.
It was not used anyways.

Also, this patch rewrites the complete linking code to use the
toml-query "typed" feature rather than constructing everything by
itself.

This removes a lot of unmaintainable boilerplate code.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-23 10:35:14 +02:00
11c2cab916 Allow unused variable here 2019-06-22 12:00:07 +02:00
1ffdb72315 Remove obsolete (internal) function 2019-06-22 12:00:02 +02:00
5dc6829354 Rename module: linker -> linkable
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-21 23:22:48 +02:00
ef17930c29 Rename interface
With this patch, the libimagentrylink library interface gets renamed.

The trait gets renamed to the more descriptive name "Linkable", the
functions get renamed to not contain any notion of "internal" anymore.

This patch also adapts the whole source tree for the new libimagentrylink
interface, also renaming variables to not contain "_internal_" anymore.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-06-21 23:22:47 +02:00
f21b6e53a2 Merge branch 'libimagentrylink-split' into master 2019-06-15 16:48:50 +02:00
2268fd8091 Import toml-query with typed feature
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
901502b67e Split "internal" module into several submodules
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
d02d53594e Fix debug output message 2019-05-31 12:48:00 +02:00
d2a5e8fb59 Rename functions: *_external_link -> *_url
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
7f2e4c8442 Adapt tested path 2019-05-31 12:48:00 +02:00
8b66672772 Fix libimagentrymarkdown for new url lib 2019-05-31 12:48:00 +02:00
8a5bc09b62 Fix libimagbookmark for new url library 2019-05-31 12:48:00 +02:00
c33c29e8e2 Fix import for new libimagentryurl lib
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
098d25db89 Move code from external libimagentrylink module to libimagentryurl
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-31 12:48:00 +02:00
5cb641044f Add libimagentryurl
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 17:51:33 +02:00
3e22fbe352 Fix imports for new viewer interface
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 11:12:44 +02:00
11955f699f Change interface of Viewer to propagate io errors
Because we need to catch errors that are caused by a borken pipe when
writing to stdout (for example), this patch changes the interface of the
Viewer trait to return an error enum that can be used to check whether
an IO error happened.

The calling code can then decide whether to ignore a broken pipe error
or whether to handle it properly.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 11:12:43 +02:00
151e4d0aa8 Replace deprecated functioncall
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 10:09:43 +02:00
5f5ce54edb Rewrite to use derive macro
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 09:39:22 +02:00
a3f771ca65 Add comment why we do this
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 09:32:07 +02:00
fb8b50fa9a Remove boilerplate by enabling serde in "log" dependency
This patch adds the "serde" feature to the "log" dependency, so we can
deserialize logging levels directly into "log" types.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 09:32:07 +02:00
185ec25b9e Rewrite logging config deserialization
This patch rewrites the logging config deserialization. It removes the
manual traversing of the config toml structure and replaces it with
types which implement `Deserialize`, which is way more convenient and
easy to read (and extend).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-05-30 09:32:07 +02:00