Rename "brief" to "summary"
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"Synopsis": "Synopsis",
|
||||
"Summary": "Summary",
|
||||
"Comment": "Comment",
|
||||
"Brief": "Brief",
|
||||
"Notes": "Notes",
|
||||
"Tag": "Tag",
|
||||
"Point of View": "Point of View",
|
||||
|
||||
@@ -450,7 +450,7 @@ class ProjectBuilder:
|
||||
aDoc.writeDocument(
|
||||
f"# {noteTitles[newRoot]}\n\n"
|
||||
f"@tag: {ntTag}\n\n"
|
||||
f"% Brief: {bfNote}\n\n"
|
||||
f"% Summary: {bfNote}\n\n"
|
||||
)
|
||||
|
||||
# Also add the archive and trash folders
|
||||
|
||||
@@ -339,7 +339,7 @@ class NWIndex:
|
||||
elif line.startswith("%"):
|
||||
if cTitle != TT_NONE:
|
||||
cStyle, cText, _ = processComment(line)
|
||||
if cStyle in (nwComment.BRIEF, nwComment.SYNOPSIS):
|
||||
if cStyle in (nwComment.SYNOPSIS, nwComment.SUMMARY):
|
||||
self._itemIndex.setHeadingSynopsis(tHandle, cTitle, cText)
|
||||
|
||||
# Count words for remaining text after last heading
|
||||
@@ -1268,7 +1268,7 @@ class IndexHeading:
|
||||
# =============================================================================================== #
|
||||
|
||||
CLASSIFIERS = {
|
||||
"brief": nwComment.BRIEF,
|
||||
"summary": nwComment.SUMMARY,
|
||||
"synopsis": nwComment.SYNOPSIS,
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ class ToHtml(Tokenizer):
|
||||
elif tType == self.T_SYNOPSIS and self._doSynopsis:
|
||||
lines.append(self._formatSynopsis(tText, True))
|
||||
|
||||
elif tType == self.T_BRIEF and self._doSynopsis:
|
||||
elif tType == self.T_SUMMARY and self._doSynopsis:
|
||||
lines.append(self._formatSynopsis(tText, False))
|
||||
|
||||
elif tType == self.T_COMMENT and self._doComments:
|
||||
@@ -459,7 +459,7 @@ class ToHtml(Tokenizer):
|
||||
|
||||
def _formatSynopsis(self, text: str, synopsis: bool) -> str:
|
||||
"""Apply HTML formatting to synopsis."""
|
||||
sSynop = self._localLookup("Synopsis") if synopsis else self._localLookup("Brief")
|
||||
sSynop = self._localLookup("Synopsis") if synopsis else self._localLookup("Summary")
|
||||
if self._genMode == self.M_PREVIEW:
|
||||
return f"<p class='comment'><span class='synopsis'>{sSynop}:</span> {text}</p>\n"
|
||||
else:
|
||||
|
||||
@@ -80,7 +80,7 @@ class Tokenizer(ABC):
|
||||
# Block Type
|
||||
T_EMPTY = 1 # Empty line (new paragraph)
|
||||
T_SYNOPSIS = 2 # Synopsis comment
|
||||
T_BRIEF = 3 # Brief comment
|
||||
T_SUMMARY = 3 # Summary comment
|
||||
T_COMMENT = 4 # Comment line
|
||||
T_KEYWORD = 5 # Command line
|
||||
T_TITLE = 6 # Title
|
||||
@@ -470,9 +470,9 @@ class Tokenizer(ABC):
|
||||
))
|
||||
if self._doSynopsis and self._keepMarkdown:
|
||||
tmpMarkdown.append("%s\n" % aLine)
|
||||
elif cStyle == nwComment.BRIEF:
|
||||
elif cStyle == nwComment.SUMMARY:
|
||||
self._tokens.append((
|
||||
self.T_BRIEF, nHead, cText, None, sAlign
|
||||
self.T_SUMMARY, nHead, cText, None, sAlign
|
||||
))
|
||||
if self._doSynopsis and self._keepMarkdown:
|
||||
tmpMarkdown.append("%s\n" % aLine)
|
||||
|
||||
@@ -170,8 +170,8 @@ class ToMarkdown(Tokenizer):
|
||||
label = self._localLookup("Synopsis")
|
||||
lines.append(f"**{label}:** {tText}\n\n")
|
||||
|
||||
elif tType == self.T_BRIEF and self._doSynopsis:
|
||||
label = self._localLookup("Brief")
|
||||
elif tType == self.T_SUMMARY and self._doSynopsis:
|
||||
label = self._localLookup("Summary")
|
||||
lines.append(f"**{label}:** {tText}\n\n")
|
||||
|
||||
elif tType == self.T_COMMENT and self._doComments:
|
||||
|
||||
@@ -484,7 +484,7 @@ class ToOdt(Tokenizer):
|
||||
tTemp, fTemp = self._formatSynopsis(tText, True)
|
||||
self._addTextPar("Text_20_Meta", oStyle, tTemp, tFmt=fTemp)
|
||||
|
||||
elif tType == self.T_BRIEF and self._doSynopsis:
|
||||
elif tType == self.T_SUMMARY and self._doSynopsis:
|
||||
tTemp, fTemp = self._formatSynopsis(tText, False)
|
||||
self._addTextPar("Text_20_Meta", oStyle, tTemp, tFmt=fTemp)
|
||||
|
||||
@@ -558,7 +558,7 @@ class ToOdt(Tokenizer):
|
||||
|
||||
def _formatSynopsis(self, text: str, synopsis: bool) -> tuple[str, list[tuple[int, int]]]:
|
||||
"""Apply formatting to synopsis lines."""
|
||||
name = self._localLookup("Synopsis") if synopsis else self._localLookup("Brief")
|
||||
name = self._localLookup("Synopsis") if synopsis else self._localLookup("Summary")
|
||||
rTxt = f"{name}: {text}"
|
||||
rFmt = [(0, self.FMT_B_B), (len(name) + 1, self.FMT_B_E)]
|
||||
return rTxt, rFmt
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ class nwComment(Enum):
|
||||
|
||||
PLAIN = 0
|
||||
SYNOPSIS = 1
|
||||
BRIEF = 2
|
||||
SUMMARY = 2
|
||||
|
||||
# END Enum nwComment
|
||||
|
||||
|
||||
@@ -316,13 +316,13 @@ class _ViewPanelBackRefs(QTreeWidget):
|
||||
|
||||
class _ViewPanelKeyWords(QTreeWidget):
|
||||
|
||||
C_DATA = 0
|
||||
C_NAME = 0
|
||||
C_EDIT = 1
|
||||
C_VIEW = 2
|
||||
C_DOC = 3
|
||||
C_TITLE = 4
|
||||
C_BRIEF = 5
|
||||
C_DATA = 0
|
||||
C_NAME = 0
|
||||
C_EDIT = 1
|
||||
C_VIEW = 2
|
||||
C_DOC = 3
|
||||
C_TITLE = 4
|
||||
C_SUMMARY = 5
|
||||
|
||||
D_TAG = Qt.ItemDataRole.UserRole
|
||||
|
||||
@@ -337,7 +337,7 @@ class _ViewPanelKeyWords(QTreeWidget):
|
||||
|
||||
self.setHeaderLabels([
|
||||
self.tr("Tag"), "", "", self.tr("Document"),
|
||||
self.tr("Heading"), self.tr("Brief")
|
||||
self.tr("Heading"), self.tr("Summary")
|
||||
])
|
||||
self.setIndentation(0)
|
||||
self.setIconSize(QSize(iPx, iPx))
|
||||
@@ -401,7 +401,7 @@ class _ViewPanelKeyWords(QTreeWidget):
|
||||
trItem.setText(self.C_DOC, nwItem.itemName)
|
||||
trItem.setText(self.C_TITLE, hItem.title)
|
||||
trItem.setData(self.C_TITLE, Qt.ItemDataRole.DecorationRole, hDec)
|
||||
trItem.setText(self.C_BRIEF, hItem.synopsis)
|
||||
trItem.setText(self.C_SUMMARY, hItem.synopsis)
|
||||
trItem.setData(self.C_DATA, self.D_TAG, tag)
|
||||
|
||||
if tag not in self._treeMap:
|
||||
|
||||
Reference in New Issue
Block a user