mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-08 01:06:12 +02:00
Updated docs from master
This commit is contained in:
parent
7227bccbc2
commit
df03996934
35 changed files with 65 additions and 66 deletions
|
@ -25,14 +25,13 @@ class Entry:
|
|||
def __unicode__(self):
|
||||
"""Returns a string representation of the entry to be written into a journal file."""
|
||||
date_str = self.date.strftime(self.journal.config['timeformat'])
|
||||
title = date_str + " " + self.title
|
||||
title = date_str + " " + self.title.rstrip("\n ")
|
||||
if self.starred:
|
||||
title += " *"
|
||||
|
||||
return u"{title}{sep}{body}\n".format(
|
||||
title=title,
|
||||
sep="\n" if self.body else "",
|
||||
body=self.body
|
||||
sep="\n" if self.body.rstrip("\n ") else "",
|
||||
body=self.body.rstrip("\n ")
|
||||
)
|
||||
|
||||
def pprint(self, short=False):
|
||||
|
@ -47,11 +46,11 @@ class Entry:
|
|||
initial_indent="| ",
|
||||
subsequent_indent="| ",
|
||||
drop_whitespace=False)
|
||||
for line in self.body.rstrip().splitlines()
|
||||
for line in self.body.rstrip(" \n").splitlines()
|
||||
])
|
||||
else:
|
||||
title = date_str + " " + self.title
|
||||
body = self.body
|
||||
title = date_str + " " + self.title.rstrip("\n ")
|
||||
body = self.body.rstrip("\n ")
|
||||
|
||||
# Suppress bodies that are just blanks and new lines.
|
||||
has_body = len(self.body) > 20 or not all(char in (" ", "\n") for char in self.body)
|
||||
|
|
BIN
jrnl/Entry.pyc
BIN
jrnl/Entry.pyc
Binary file not shown.
|
@ -280,7 +280,7 @@ class Journal(object):
|
|||
raw = raw.replace('\\n ', '\n').replace('\\n', '\n')
|
||||
starred = False
|
||||
# Split raw text into title and body
|
||||
sep = re.search("\n|[\?.]+", raw)
|
||||
sep = re.search("\n|[\?!.]+ *", raw)
|
||||
title, body = (raw[:sep.end()], raw[sep.end():]) if sep else (raw, "")
|
||||
starred = False
|
||||
if not date:
|
||||
|
|
BIN
jrnl/Journal.pyc
BIN
jrnl/Journal.pyc
Binary file not shown.
|
@ -8,7 +8,7 @@ jrnl is a simple journal application for your command line.
|
|||
from __future__ import absolute_import
|
||||
|
||||
__title__ = 'jrnl'
|
||||
__version__ = '1.7.16'
|
||||
__version__ = '1.7.17'
|
||||
__author__ = 'Manuel Ebert'
|
||||
__license__ = 'MIT License'
|
||||
__copyright__ = 'Copyright 2013 - 2014 Manuel Ebert'
|
||||
|
|
Binary file not shown.
BIN
jrnl/cli.pyc
BIN
jrnl/cli.pyc
Binary file not shown.
Binary file not shown.
BIN
jrnl/install.pyc
BIN
jrnl/install.pyc
Binary file not shown.
BIN
jrnl/util.pyc
BIN
jrnl/util.pyc
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue