Add method to return title without item type.
This commit is contained in:
parent
e7df1758ec
commit
31e4bc81c5
|
@ -353,15 +353,19 @@ class SourceDoc(Item):
|
|||
result = s[:length - len(end)].rsplit(' ', 1)[0]
|
||||
return result + end
|
||||
|
||||
def title(self, titles=None):
|
||||
def raw_title(self):
|
||||
return self.title(with_type=False)
|
||||
|
||||
def title(self, titles=None, with_type=True):
|
||||
start = self.type + ': ' if with_type else ''
|
||||
titles = XanaLink.get_all_titles()
|
||||
from_link = self.title_from_link(titles=titles)
|
||||
if from_link:
|
||||
return self.type + ': ' + from_link
|
||||
return start + from_link
|
||||
first_line = first_non_empty_line(self.text)
|
||||
if first_line:
|
||||
return self.type + ': ' + first_line
|
||||
return self.type + ': ' + self.hashid
|
||||
return start + first_line
|
||||
return start + self.hashid
|
||||
|
||||
|
||||
configure_mappers()
|
||||
|
|
Loading…
Reference in a new issue