mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
filter the journal according to search also for html display
This commit is contained in:
parent
ee57119f0e
commit
7e762e1d63
2 changed files with 8 additions and 10 deletions
|
@ -47,7 +47,6 @@ def to_html(journal, open_in_browser=False):
|
||||||
and can open it in the default browser"""
|
and can open it in the default browser"""
|
||||||
bla = to_md(journal)
|
bla = to_md(journal)
|
||||||
html_body = markdown.markdown(bla.decode('utf8'))
|
html_body = markdown.markdown(bla.decode('utf8'))
|
||||||
print html_body
|
|
||||||
tmp_file = os.path.join(tempfile.gettempdir(), "pretty.html")
|
tmp_file = os.path.join(tempfile.gettempdir(), "pretty.html")
|
||||||
url = 'file://' + tmp_file
|
url = 'file://' + tmp_file
|
||||||
output_file = codecs.open(tmp_file, "w", encoding="utf8")
|
output_file = codecs.open(tmp_file, "w", encoding="utf8")
|
||||||
|
|
17
jrnl/jrnl.py
17
jrnl/jrnl.py
|
@ -185,13 +185,16 @@ def cli():
|
||||||
journal.write()
|
journal.write()
|
||||||
|
|
||||||
# Reading mode
|
# Reading mode
|
||||||
elif not mode_export:
|
elif not mode_export or args.html:
|
||||||
journal.filter(tags=args.text,
|
journal.filter(tags=args.text,
|
||||||
start_date=args.start_date, end_date=args.end_date,
|
start_date=args.start_date, end_date=args.end_date,
|
||||||
strict=args.strict,
|
strict=args.strict,
|
||||||
short=args.short)
|
short=args.short)
|
||||||
journal.limit(args.limit)
|
journal.limit(args.limit)
|
||||||
print(journal)
|
if args.html:
|
||||||
|
exporters.to_html(journal, True)
|
||||||
|
else:
|
||||||
|
print(journal)
|
||||||
|
|
||||||
# Various export modes
|
# Various export modes
|
||||||
elif args.tags:
|
elif args.tags:
|
||||||
|
@ -203,10 +206,6 @@ def cli():
|
||||||
elif args.markdown: # export to json
|
elif args.markdown: # export to json
|
||||||
print(exporters.to_md(journal))
|
print(exporters.to_md(journal))
|
||||||
|
|
||||||
elif args.html: #export to html and open in browser
|
|
||||||
print 'test'
|
|
||||||
exporters.to_html(journal, True)
|
|
||||||
|
|
||||||
elif (args.encrypt is not False or args.decrypt is not False) and not PYCRYPTO:
|
elif (args.encrypt is not False or args.decrypt is not False) and not PYCRYPTO:
|
||||||
print("PyCrypto not found. To encrypt or decrypt your journal, install the PyCrypto package from http://www.pycrypto.org.")
|
print("PyCrypto not found. To encrypt or decrypt your journal, install the PyCrypto package from http://www.pycrypto.org.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue