mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-12 01:46:14 +02:00
Add display format option to config file.
This commit is contained in:
parent
758d913376
commit
7d0b4b6b19
4 changed files with 10 additions and 4 deletions
|
@ -35,6 +35,7 @@ class Journal:
|
|||
"highlight": True,
|
||||
"linewrap": 80,
|
||||
"indent_character": "|",
|
||||
"display_format": "text",
|
||||
}
|
||||
self.config.update(kwargs)
|
||||
# Set up date parser
|
||||
|
|
|
@ -49,6 +49,7 @@ default_config = {
|
|||
"linewrap": 79,
|
||||
"indent_character": "|",
|
||||
"colors": {"date": "none", "title": "none", "body": "none", "tags": "none",},
|
||||
"display_format": "text",
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ def _delete_search_results(journal, old_entries, **kwargs):
|
|||
journal.write()
|
||||
|
||||
|
||||
def _display_search_results(args, journal, **kwargs):
|
||||
def _display_search_results(args, journal, config, **kwargs):
|
||||
if args.short:
|
||||
print(journal.pprint(short=True))
|
||||
|
||||
|
@ -300,7 +300,8 @@ def _display_search_results(args, journal, **kwargs):
|
|||
elif args.export:
|
||||
exporter = plugins.get_exporter(args.export)
|
||||
print(exporter.export(journal, args.filename))
|
||||
|
||||
else:
|
||||
# Default display mode
|
||||
print(journal.pprint())
|
||||
# Display according display_format config option
|
||||
config_selected = config.get("display_format", journal.config["display_format"])
|
||||
exporter = plugins.get_exporter(config_selected)
|
||||
print(exporter.export(journal, args.filename))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue