Rename "brief" to "summary"

This commit is contained in:
Veronica Berglyd Olsen
2023-11-25 23:42:05 +01:00
parent 9fc815abe1
commit 53aa970427
16 changed files with 56 additions and 54 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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,
}
+2 -2
View File
@@ -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:
+3 -3
View File
@@ -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)
+2 -2
View File
@@ -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:
+2 -2
View File
@@ -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