Commit graph

28 commits

Author SHA1 Message Date
Aaron Lichtman
47e0305aa0
Pretty print journal entries (#692)
* Pretty print journal entry titles and dates.

Changes appearance of all jrnl viewing commands, such as $ jrnl --short and
$ jrnl -n {NUM}.

Fix #508

* Removed extra newline at end of title

* Use ansiwrap to properly wrap strings with ANSI escapes

* Add ansiwrap to pyproject.toml

* Allow configuration of colors

- Replaced raw escapes with colorama
- Added colors key to config
- Add checks for validity of color values

* Add color configuration documentation

* Fix broken tests due to config change

* Add tests for colors in configs

- Identifying invalid color configs
- Upgrading config from no colors -> colors

* Add colorama dependency for all platforms

* Allow users to disable colorization of output

* Update poetry.lock

* Add tag and body color customization options

* Fix colorization of tags in title and body

* Updated tests to use no color by default

* Change pass to continue in verify_config()

* Better style in Entry.py

* Reduce code duplication for tag highlighting

- Breaks "unreadable date" regression test for unknown reason

* Properly colorize tags and print body

* Reformatting and clean up

* Replace list comprehension with generator

* Handle invalid colors by not using a color

* Process ANSI escapes properly with behave

* Fixed the 'spaces after tags directly next to punctuation' bug

Broke processing of tags next to any punctuation at all

* Closer to working tag colorization but not perfect

* Add tests printing for multiline journals

Fix #717

* Correctly indent first line of multiline entry

* Add test for multiline entries with tags

* Remove redundant UNICODE flag

* Progress towards proper tag colorization and body formatting

* Fix newline colorization bug

Debug code left intact since there are more bugs to fix :/

* And now the space just ends up before the tag instead of after it

* Fix assertion syntax warning

* Moved tag test to tagging.feature file

* Strip out debug code and clean up

* Bold datetimes in title

* Bold all titles

Fix #720

* Remove PY2 and PY3 constants

* Fix regression in features/steps/core.py

* Fix tag_regex

* Remove redundant re.UNICODE flag

* Remove extraneous code
2020-02-29 15:29:16 -08:00
Jonathan Wren
97cf65e516
Merge branch 'develop' into v2.5 2020-02-08 14:29:10 -08:00
MinchinWeb
e5d7845f18 Listing all entries in DayOne Classic journal throws IndexError (#786)
* Reproduce bug in #780
🎵 I have no body, no body to love me... 🎵
The bug is cause by a DayOne entry that has to entry body.

* Deal with empty bodies
Close #780.

* [Travis-CI] add "tree" command to debug missing files
* Fix file location
I have no idea why, but it ran locally fine without issue. Travis is more particular...
2020-02-08 13:14:33 -08:00
Peter Schmidbauer
1fa851ed0c Fix handling of little-endian date format
Ever since version 2.0, when parsing a journal file, jrnl would not use the custom date format string anymore. Instead, it relied on the dateutil library to get the parsing right. This change was made to allow people to change their date format without having to manually change their file. However, this broke some existing date formats like %d.%m.%Y, as it would falsely interpret the month as day and vice versa. This commit adds some tests to catch this error and fixes it by trying to parse the dates using the custom format first, only falling back to dateutil when needed.
2019-10-26 21:58:15 +02:00
Craig Moyer
866634035a Fix failed test scenarios for folder journal. 2019-09-23 17:20:07 -04:00
Jonathan Wren
1350bcad1b #631 Escape data in square brackets 2019-08-10 13:37:03 -07:00
Micah Jerome Ellison
f3b9a91c9b [GH-614] resolving issues around unreadable dates and unparsed dates 2019-07-20 14:51:46 -07:00
flight16
06a9ed2026 Merged PR 2015-12-28 21:36:17 -08:00
MinchinWeb
2d49aaa1a0 Add testing for increasing Headings on Markdown export 2015-04-14 15:13:00 -06:00
Manuel Ebert
b41b5d3376 Tests for parsing issue fix 2015-04-05 18:38:37 +02:00
Manuel Ebert
f459dd5bc2 Tests for #333 2015-04-05 03:27:09 +04:00
Manuel Ebert
812d289740 Update all tests to new time format 2015-04-05 03:25:39 +04:00
Manuel Ebert
dd79639095 Hardcoded salt to fix crypto 2015-04-04 17:50:44 +11:00
Manuel Ebert
359eabd56d Work on cryptography 2014-09-27 13:15:46 -07:00
Manuel Ebert
be009b08b4 Converts tests to YAML 2014-09-12 15:28:12 -07:00
U-NA\cle1413
4d6cdc835e Add assertion to scenario that verifies a tag on a new line is recoginized as a tag. 2014-07-23 11:19:47 -04:00
Matt Hoffman
b8a3b6d9ad There should be a whitespace character in front of a tag. Fixes issue #237. 2014-07-22 22:14:26 -04:00
Manuel Ebert
c05fdfdad7 Tests for tagging 2014-07-02 15:35:05 +02:00
Manuel Ebert
378baf17a1 Fixes xml header 2014-05-22 13:24:04 -07:00
Manuel Ebert
a0333e60d5 Fix encoding in tests 2014-05-22 12:16:26 -07:00
Manuel Ebert
181c36163a Tests for ignoring invalid DayOne entries 2014-04-16 14:35:03 -04:00
Manuel Ebert
0161d834c0 Tests for #153 2014-04-16 14:26:02 -04:00
Manuel Ebert
d4aa08e18a Adds empty folder for testing 2013-08-28 13:37:18 -07:00
Manuel Ebert
81e8e26b0a Tests for parsing DayOne entries without Timezone 2013-08-17 13:19:54 -07:00
Manuel Ebert
8446908139 Initial support for DayOne integration testing 2013-08-17 11:59:51 -07:00
Manuel Ebert
3ef6095b41 Tests for filtering 2013-08-06 17:57:31 -07:00
Manuel Ebert
6bcf83ed78 Tests for tagging 2013-07-23 21:02:03 -07:00
Manuel Ebert
9c3841dded Changes cleaning strategy 2013-07-22 21:19:30 +02:00