27 Commits

Author SHA1 Message Date
657721adc6 Update dart-git and stop using the Result class
Instead we're going to move back to standard exceptions.

Using a custom Result class has created far far more problems
- The Stacktraces aren't always right
- Sometimes one forgets to check the Result error
- All other exception throwing code needing to be converted to Results
- Non idiomatic Dart code

I think it's better to just go back to exceptions. They have their
problems, but overall, I think it's a better approach.
2023-11-24 14:03:30 +01:00
6237161a28 Enable logging in tests
It makes it easier to diagnose issues on the CI
2022-02-20 01:24:07 +05:30
f9271edad3 Upgrade to latest dart-git
Most of dart-git's operations are synchronous by default now. The async
functions run on another isolate.
2022-01-13 18:14:01 +01:00
e1ea7a4953 Fetch the modified + created time from git
Fixes #78

This is probably the largest commit that I have ever made. From now on -
every File always has an mtime and ctime which is fetched from git.
Notes can optionally override that time by providing yaml metadata.

Additionally the 'filePath' and 'folderPath' is now relative to the
repoPath instead of being the full path.

This will slow down GitJournal like crazy as all the mtimes and ctime
still need to be cached. For my test repo it takes about 23 seconds for
GitJournal to become responsive.
2021-10-26 17:49:08 +02:00
6a915864f2 Move NotesFolder's code to their own folder
The 'core' folder is becoming way too huge.
2021-10-15 12:31:35 +02:00
641b4f80f5 Add a failing test for normal links with a space
This isn't valid markdown syntax but Obsidian seems to allow it.

Related to #392
2021-09-17 12:06:09 +02:00
fb2ebcdd6c Reuse: Add licenseing to the tests 2021-09-15 13:11:50 +02:00
2505d00dfb Replace dart:io with universal_io
Platform from dart:io cannot be used on the web for reasons. And this
way we get a fake File/Directory class which we can use for atleast
running the web version, even if it won't work.
2021-07-30 11:39:26 +02:00
c6665fa63e Simplify Settings/Config classes 2021-07-29 12:45:33 +02:00
c66eaf1052 NotesFolderConfig: Read directly from the SharedPref
It's super annoying that we have this class which reading from the
settings, so adding any new value involves updating some 12 new things.
2021-07-27 16:33:16 +02:00
d6e2f09a72 Move all settings code to its own folder
Jumping around between the widgets / screens and outside is bit
confusing. Also this way, I can add the stories right here.
2021-06-05 12:23:28 +02:00
9b4a67ba08 LinkResolver: Null Safety++ 2021-05-19 12:17:57 +02:00
d008f0d982 First version of dart migrate
Most of the files haven't been migrated. Lets work on this bit by bit
2021-04-10 22:18:35 +02:00
f75e119995 Make Settings take the folderName as a parameter 2020-10-23 02:29:48 +02:00
9499cea164 Remove Settings global
Stop it being a singleton. This means it needs to be passed around a
lot. This sucks, but it's how it should be. I shouldn't be using a
global variable to get around this.

This is needed as Settings will soon become repo specific when we
support multiple repos.

This breaks saving the settings in a file, that feature was toggled off
anyway. It needs to be thought over again.
2020-10-09 00:59:19 +02:00
4be9520ae6 LinkResolver: Add another test 2020-09-26 19:25:07 +02:00
289182b12e Fix Parent relative links not working
Fixes #256
2020-09-24 16:46:24 +02:00
a28fc308c0 Resolve "normal links" without a file extension
This is against the markdown spec, but the foam documentaiton seem to
have this in a number of places.
2020-09-14 17:41:53 +02:00
d2326658d4 LinkResolver: Make sure wiki link objects are properly resolved
There was no test for this, so it wasn't caught when I accidently broke
it today morning.
2020-09-14 17:39:20 +02:00
c94ff85804 Overhaul Link parsing
We were mixing up header links with wiki links and the alt text. It was
a bit messy. We currently do not support linking to a particular part of
a note. Nor do we support wiki links as link references.

Fixes APP-A0
2020-09-14 12:20:15 +02:00
1e0fdb9f06 Fix WikiLink resolution
I apparently wasn't following exactly what Obsidian was doing. This
algorithm is getting a bit complex and should be documented, also now
I'm not sure how other apps are doing it, and maybe I should have
specific link resolvers per 'app'.
2020-08-16 15:05:16 +02:00
bf97887e10 Fix relative Markdown links
While implementing Wiki Links, I seem to have accidentally broken them.
2020-08-14 16:14:00 +02:00
71b3d841da LinkResolve: Handle complex paths such as ../foo/../bah.md
Also add some more tests for other cases.
2020-08-11 13:33:50 +02:00
7e6a74dbba WikiLinks: Always resolve from the base path
Fixes #212

With this [[Fire]] will always resolve the rootFolder/Fire.md
irrespective of which note it appears in. This is analogous to the way
Obsidian works.
2020-08-11 00:11:45 +02:00
3d23d2b343 LinkResolver: Resolve links with extra spaces 2020-08-11 00:07:38 +02:00
5779fd380e LinkResolver: Add more tests 2020-08-11 00:04:42 +02:00
0c467e6b01 Move LinkResolving code to its own class
It has become sufficiently complex that a number of edge cases need to
be tested.
2020-08-10 23:49:09 +02:00