forked from jrnl-org/jrnl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert "short" and "pretty" (and "default") formaters to plugins
further to jrnl-org#1177
- Loading branch information
1 parent
e1d2f87
commit 1fd04ad
Showing
5 changed files
with
85 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
# Copyright (C) 2012-2021 jrnl contributors | ||
# License: https://www.gnu.org/licenses/gpl-3.0.html | ||
|
||
from jrnl.plugins.base import BaseExporter | ||
|
||
from ... import __version__ | ||
|
||
|
||
class Exporter(BaseExporter): | ||
"""Pretty print journal""" | ||
|
||
names = ["pretty", "default"] | ||
extension = "txt" | ||
version = __version__ | ||
|
||
@classmethod | ||
def export_journal(cls, journal): | ||
return journal.pprint() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
# Copyright (C) 2012-2021 jrnl contributors | ||
# License: https://www.gnu.org/licenses/gpl-3.0.html | ||
|
||
from jrnl.plugins.base import BaseExporter | ||
|
||
from ... import __version__ | ||
|
||
|
||
class Exporter(BaseExporter): | ||
"""Short export -- i.e. single line date and title""" | ||
|
||
names = ["short"] | ||
extension = "txt" | ||
version = __version__ | ||
|
||
@classmethod | ||
def export_journal(cls, journal): | ||
return journal.pprint(short=True) |