140 Commits

Author SHA1 Message Date
9380f3cc06 Allow YAML tags to be a string 2020-08-19 10:12:07 +02:00
9859aa6106 Allow custom metadata to be specifiec for any note
This way we can add 'draft: true' to all new notes.

Fixes #168
2020-08-18 10:47:26 +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
d5ce4e1110 FlattenedNotesFolderTest: Fix it
Occasionally the random number generator would generate the same number
and we wouldn't check if the file existed.

Also, we were accidentally creating all the notes in the root dir, so
this test was a bit useless.
2020-08-15 13:22:05 +02:00
850e9c7826 MarkdownToolBar: Make bold work with newlines 2020-08-15 12:36:13 +02:00
22985ea500 MarkdownToolbar: Implement navigation between words 2020-08-15 11:58:39 +02:00
745d59e570 MarkdownToolbar: Add buttons to navigate between words 2020-08-14 22:00:34 +02:00
440ee96639 MarkdownToolbar: Bold: Add more tests 2020-08-14 21:21:08 +02:00
c6d5ebc0b2 MarkdownToolbar: Add tests for surrounding the current word with ** 2020-08-14 21:17:29 +02:00
46269dd94a Implementing controlling of the sorting order
The dialog looks quite ugly right now, but at least everything works. I
can work on making it prettier after this.
2020-08-14 19:17:38 +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
c38f823ae3 MarkdownToolBar: Test h1 removal
And fix cursor position after removing of the header
2020-08-13 01:14:06 +02:00
8668b88a95 MarkdownToolBar: Test h1 removal 2020-08-13 00:54:24 +02:00
ed08672ee2 Simplify tests 2020-08-13 00:51:54 +02:00
d4b201f7ef MarkdownToolbar: Replace current line
Add a few more tests
2020-08-13 00:44:12 +02:00
f3ad0144c5 Add a test for MarkdownToolbar's replace current line
The logic is non trivial
2020-08-13 00:29:17 +02:00
01f1b8481f Add scaffolding for an inline tag processor
This is just a simple test to extract the inline tags, it hasn't been
hooked up to anything.

Related to #44
2020-08-11 13:58:52 +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
bf0c9d1dfd Support piped wikilinks
Fixes #203
2020-08-10 21:10:55 +02:00
3e2306801b Add a test for the markdown node parsing
This way we will clearly know when the Markdown parsing fails because of
bugs in the markdown package.
2020-08-10 21:04:13 +02:00
cd9ae57a71 Fix tests 2020-08-10 09:59:20 +02:00
9c01b8a931 NoteSerializer: Avoid using Settings.instance 2020-08-09 01:50:52 +02:00
633d9f5744 Remove more instances of Settings.instance
Use the Provider
2020-08-09 01:50:36 +02:00
2fa475e10a Add an extra test for txt files and the title
Just to make sure it's never parsed.
2020-07-29 16:29:27 +02:00
30f9f86ad3 Fix all the broken tests because of title change 2020-07-29 15:58:43 +02:00
4a97d03bd8 Title Codec: Support empty starting lines in the body 2020-07-29 15:25:17 +02:00
417f0414f2 Setting: Note metadata change subtitle 2020-07-29 15:13:37 +02:00
41447027f2 Allow 'title' saving to be configured
We now allow it be to either saved as the H1 or in the YAML metadata.
I'm not sure what the default should be. Still deciding.

Fixes #112
2020-07-28 17:26:42 +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
309917d165 Move links parsing from the markdown string to another thread
This can be very expensive and the UI hands for a large number of notes,
otherwise.
2020-07-09 11:09:03 +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
303192d9d5 Initialize intl in tests
This sucks.
2020-06-09 18:44:37 +02:00
67c2777d9b Parse links in wiki syntax [[term]]
This way we can use this faster syntax which is also supported by
Obsidian.
2020-06-08 00:52:03 +02:00
a43498ef6d Editor Heurisitics: Should work even if the items have spaces 2020-06-08 00:28:14 +02:00
991af6e1fb Add a test to make sure new notes always have a file extension
This bug has appeared way too many times
2020-06-06 13:52:23 +02:00
f957e7c441 Remove print statements from tests 2020-06-04 13:51:24 +02:00
c50e8ad999 Add more editor heuristics 2020-06-03 12:10:06 +02:00
42d6386096 Add basic txt file support
With this 'txt' files are now read and written. However, they don't have
any metadata so they don't show up correctly in the sort order and
currently the Markdown Editor is still available for them.

Related to #55
2020-06-02 00:15:18 +02:00
47e8ac8b08 Auto add numbered lists when typing
Since we're using markdown it's kinda awesome that we can re-use the
same last number and markdown will arrange the numbers properly.
2020-06-01 23:26:49 +02:00
a5a7211788 Bullet Lists: Auto add bullets lists even when modifying in the middle 2020-06-01 21:14:59 +02:00
f4cc8e2b47 Refactor Auto bullet list in Editor
The earlier code base was a bit fragile, I prefer having this
unit-tested as the logic is a bit tricky, and I still don't support all
the use-cases.
2020-06-01 20:55:04 +02:00
e740bd2223 FlattenedNotesFolder: Test reset 2020-05-31 03:16:17 +02:00
772c3320b6 Add another test for FlattenedNotes 2020-05-31 03:03:11 +02:00
af69dd6e48 Note: Allow returning the links in the document
This isn't perfect as we aren't handling referenced links and maybe even
autolinks, but it's a start.

Related to #141
2020-05-26 14:50:23 +02:00