40 Commits

Author SHA1 Message Date
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
442d9d2b4e Allows Notes to have a different modified yaml key
Possible Options - modified, mod, lastModified, lastMod, lastmodified or
lastmod. When read the the note we will figure out which one is being
used and accordingly write back that value.

This makes it easier to use GitJournal for editing Hugo websites as they
usually use the 'lastmod' field to indicate when the post was last modified.
2020-01-05 18:12:35 +01:00
36d1ae43c3 Split NoteData and its serializer into its own file 2020-01-01 19:50:31 +01:00
4f2fcb0b72 Fix flutter analyze: Add missing const 2019-12-09 02:01:24 +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
a33fb88fb0 Fix tests paths 2019-12-09 01:42:01 +01:00
5b8fc6342a Connect the AppState to the Folders
Now when adding/editing/removing a note, it gets modified from the
directory it was present in. There is no longer a just a plain list of
all notes, but always a tree of notes, which are inside Folders.
2019-12-04 15:33:30 +01:00
464b7512e9 Move Note and NoteFolder class into a core folder 2019-12-04 14:18:11 +01:00
702da72a51 Note serializer: Add yet another edge case 2019-12-01 16:43:13 +01:00
41526868ff Note Serialization: Handle more edge cases
Apparently parsing a YAML Header + body isn't as trivial as I expected.
2019-12-01 16:30:40 +01:00
3cf951f8dd Improved note parsing
We now handle markdown files without any YAML Headers, and different
variations of the yaml header.

This should also fix a crash.
2019-11-01 23:00:54 +01:00
f694536469 YAML: Serialize nodes properly
This fixes the error where a YamlList is not of type string.
2019-10-19 12:53:28 +01:00
06824ccee3 Note: Setting the 'created' property should update the NoteData
We shouldn't just do it when saving the note, this way when viewing the
raw editor, the created field is show for new notes.
2019-10-11 02:18:34 +02:00
69003cf0ac Rename package from journal -> gitjournal
It's about time.
2019-10-07 19:30:50 +02:00
475251df61 Preserve the YAML sorting order
Also refactor this a bit so Note contains a NoteData. I'm really not
convinced about today's abstractions, and feel I might have made this
entire thing much much worse.
2019-09-26 18:52:01 +02:00
2b43de6e93 Test out Note deletion 2019-09-26 16:46:41 +02:00
6f8a149d57 Refactor Note class
The loading/saving/deleting of the Note class is now inbuilt. It's not
offloaded to a NoteRepo. We're always going to be storing them on disk,
for now. It's also way easier to manage them this way.
2019-09-26 16:42:52 +02:00
ef2ad7466f Port Serializers to handle NoteData
This completely breaks the app, as it is part of a large refactor to
make Note loading asyncrhnous and not block. Additionally this removed
JSON serialization for Notes as that isn't something we care about any
more.
2019-09-26 15:51:16 +02:00
0dc75c4ff4 Serializers: Ignore empty yaml metadata
No point giving out a horrible stack trace in this case. This is clearly
not worth an "exception".
2019-05-29 11:03:58 +02:00
f7aeb3527d Handle invalid markdown
In these cases we just try to fetch the body the best we can and ignore
all the keys.

This should give us more info about #4
2019-05-27 10:10:17 +02:00
ad2e4ac9b1 Rename markdownToPlainText -> stripMarkdownFormatting
It better reflects what the function actually does
2019-05-13 22:57:49 +02:00
4f939c662e MarkdownToText: Add another test
Just for my own curiosity
2019-05-13 22:55:26 +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
8345f1424e Note: Rename 'fileName' to 'filePath'
A note can reside in a subfolder, so lets just use the path as an
identifier instead of using just the fileName.
2019-02-14 12:07:23 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
519de8fcff Remove onboarding screen
For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.

This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
2019-01-21 13:43:33 +01:00
215197ca25 YAML Serializer: Add a test which currently fails
It would be nice to preserve the order of the YAML metadata, but the
YAML package does not currently support that.
2019-01-18 18:06:19 +01:00
c99fe854a1 Note: Replace 'id' with 'fileName'
It all just makes far more since when each Note has a fileName.

Though we don't save the fileName in the YAML header. It seems quite
redundant to do that.

Another advantage of this is that if we can read any file ending with a
'.md' in a git repo. It doesn't need to be named exactly how we want it,
and we will still save the details correctly.
2019-01-18 16:12:03 +01:00
652ed6ffe5 File_Storage: Fix tests
I should really be running the tests more often. I'd clearly broken
things and hadn't noticed.
2019-01-18 15:40:30 +01:00
f7e2253f55 Fix serializer tests
* Map equality does not exist in Dart - how sucky!
* We no longer care about the micro-seconds
2019-01-18 15:37:19 +01:00
315414ae73 Fix datetime to string conversion 2019-01-15 15:35:41 +01:00
075d353447 Write the date time in iso8601 + timezone
This is not perfect as when parsing the datetime, we're ignoring the
timezone.
2019-01-15 15:10:43 +01:00
917a0a38fc Fix flutter tests
It seems like we need to explicitly mention the test package in the
dev dependencies. This is strange, since the documentation does not
reflect that.
2019-01-07 11:04:32 +01:00
4c59471da1 tests: Update variable name
Easier to read
2018-09-08 21:45:40 +02:00
104d54efc3 Fix tests 2018-06-03 20:19:20 +02:00
eb2c9eb33f Note: Rename 'createdAt' to 'created'
My notes already use the key 'created', and I don't want to have to
change that.
2018-06-01 19:04:48 +02:00
fdf8c06c24 Add Note serializers
This way we don't only need to use json.
2018-06-01 18:57:53 +02:00
0cb36b2981 Make the state global and connect the add note screen
This is a huge work in progress, but it finally seems to kinda work.
2018-05-21 16:51:29 +02:00
4fcc6d9120 Add a FileStorage class
With a test!
2018-05-21 15:31:34 +02:00
72712bd4de Initial import from 'flutter create' 2018-05-12 18:45:42 +02:00