49 Commits

Author SHA1 Message Date
a9f3001798 Use StackTrace library to make the traces shorter
And hopefully add some more context to some async stack traces that
don't make any sense.
2020-11-18 12:53:12 +01:00
767d890a55 Avoid logging logger errors
causes a bit of a recursion
2020-11-10 18:47:30 +01:00
a11fe63983 Report Bug: Attach logs from the last 2 days 2020-11-10 18:37:54 +01:00
eac5a296ab Logger: Add more logging statements 2020-11-09 11:41:12 +01:00
2c11185e0b DateTime doesn't support operator + or - 2020-11-08 10:34:14 +01:00
071f15b067 Bug Report: Send logs for today and yesterday 2020-11-07 15:31:16 +01:00
5e74f75ebd Logs: Show today and yesterday's logs
Fixes APP-8T
2020-11-07 15:24:43 +01:00
bc06efc446 Create new note when clicking on non existing Wiki Link
Fixes #240
2020-10-22 23:57:53 +02:00
289182b12e Fix Parent relative links not working
Fixes #256
2020-09-24 16:46:24 +02:00
365afb4abc Add leading zero to minutes < 10
Fixes #247
2020-09-15 01:29:22 +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
a3f556df47 Actually implement the Zettelkasten filename format
I like an idiot only exposed it in the Settings.
2020-08-30 15:16:03 +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
2fcdfa0d6c Note Backlinks: Use the linkResolver
The backlinks should use the same algorithm for determining the links as
is used when clicking on a link.
2020-08-14 16:44:54 +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
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
215f12d4d8 MarkdownStrip: Support all languages
We were only supporting English, and even if we use the regexp \w, that
seems to only work for English and not all languages.
2020-06-19 13:09:25 +02:00
88552fe8e9 Revert "Workaround intl bug by harding 'en' locale"
This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329.
This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9.

GitJournal is used by non-English speakers (a lot in China and Russia)
and while we don't support those languages completely, we do support
them a little bit. I don't want to loose this functionality. It would be
better for us to fix the bug in intl.
2020-06-10 09:31:08 +02:00
cd9d128b47 Workaround intl bug by harding 'en' locale
https://github.com/dart-lang/intl/issues/266

This is strange since Intl.getLocale() returns 'en_US' in my case.

Currently, GitJournal only supports 'english' anyway, so this shouldn't
be a big problem.
2020-06-09 18:23:43 +02:00
2a35ea7c38 BugReport: Send bug reports with new logs
Earlier we used to call 'adb logcat' and get all the logs and send
those. This didn't work on iOS and we wouldn't get all the logs even in
android at times as the logcat buffer can be unreliable.

Since now we log all the messages to a file, we can just send that file.
The disadvtange is that we only get Dart level logs, and not iOS or Java
or NDK or our C libraries logs.

I should really dump libgit2 ASAP.
2020-05-31 02:42:58 +02:00
68d3aa1a2b Disable Fimber logging in release mode
No point debugging to adb and writing it to a file.
2020-05-31 02:32:51 +02:00
012c3b067d Fimber: Show proper log tag
Now that we're wrapping Fimber in our own logging system, we should get
the correct tag.
2020-05-31 02:30:44 +02:00
a324d0f755 Logging: Allow logging structured fields
Display this in the Debug Screen app. Additionally, add a reason why a
file was not loaded.
2020-05-17 19:47:11 +02:00
804254cb2e Fix crash while parsing logs
So ironic
2020-05-16 20:59:11 +02:00
ea733aacb5 Add a very simple Debug screen
This will show all the debug messages, which include when a file is
being ignored and not loaded, and hopefully all the exceptions. So the
user should be able to better understand why a file has been ignored.

It's not an ideal solution, but it's a quick fix.

Fixes #122
2020-05-06 01:09:57 +02:00
63e7d0e927 Logger: Log all messages to a file
For Bug reports we were calling 'adb logcat' and fetching the logs, but
the amount of logs we got was quite arbitrary, also this wasn't possible
in iOS.

With this approach, we don't get the lower level logs of Android/iOS or
from libgit2, but since we're slowly moving away from libgit2 anyway, it
will have to do.
2020-05-06 00:17:46 +02:00
557f3c217e Allow DateTime parsing to fail 2020-05-02 13:52:56 +02:00
441202af48 StripMarkdownFormatting: Support new checklist format 2020-05-02 01:29:43 +02:00
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
64e3d36130 Improve stripMarkdown formatting
At some point this will need to be done in another thread.
2020-04-02 18:19:50 +02:00
1ff3075a1c MicroOptimization: Avoid rebuilding the regexp 2020-03-19 23:38:12 +01:00
2c361172c6 Avoid recreating DateFormats
They only need to be created once. This should result in a minor
performance gain while building the folder views.
2020-03-19 15:23:30 +01:00
8e9b23982c Add support for a simpler filename format
Also make this the default when one doesn't have a title.

This is important as now the filename is far more visible with the new
standard view.
2020-03-05 19:14:27 +01:00
0d5793d097 strip_markdown: Use a handbuilt stripper
It's not perfect, but it runs faster at about 35 us vs 650 us.
2020-02-17 15:51:37 +01:00
ec959ebbed Add a helper file to resolve merge conflicts
I'm not sure how to integrate this into our merging code.
2020-01-27 23:28:13 +01:00
14e7f344d1 Add an explicit serializer from Note -> NoteData
This is so that we can start configuring what the yaml metadata keys
should be called, and not have them hardcoded.

This also allows the note.created to be null. Earlier we were always
setting it to some value. That's doesn't seem right.
2020-01-01 19:29:57 +01:00
bc6f7c1b8f Note: Load the modified tag properly 2019-12-14 12:05:52 +01:00
ad6d47ef0f Fix dateTime to string with timezone
We should just use the 'timezone' dart package and not handle this
ourselves as we're probably fucking it up in other places.

This fixes #42
2019-12-09 01:56:46 +01:00
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00
3fd801b4a1 Fix "Value not in range: -1" error
Fixes #4
2019-05-29 17:34:47 +02:00
ad2e4ac9b1 Rename markdownToPlainText -> stripMarkdownFormatting
It better reflects what the function actually does
2019-05-13 22:57:49 +02:00
f2af5c9c75 Improve markdown to text conversion
Use a proper markdown parser to convert the text. This way more of the
formatting is correctly removed.
2019-05-13 22:36:32 +02:00