чување 8c86bfcf976880a0eec4a0fe26e2337808f0b561
родитељ 5b37c08224ca22988229de35a9bf2dcf98614af3
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Sat, 15 Jul 2023 13:42:51 +0200
slweb.1.in: Update; slweb.c(process_incdir_subdir): Move timestemp outside permalink
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 3, додавања: 21(+), брисања: 8(-)
diff --git a/TODO b/TODO
@@ -1,7 +1,7 @@
TODO
====
-[ ] Document listonly in manpage + wiki
+[x] Document listonly in manpage + wiki
< > Add <abbr>?
diff --git a/slweb.1.in b/slweb.1.in
@@ -597,11 +597,12 @@ about the current commit would be impossible).
.
.IP \[bu]
.BR "Subdirectory inclusion (blogging directive)" .
-The command \fC{incdir "\f[CI]dirname\f[CR]" \f[CI]num\f[CR]
+The directive \fC{incdir "\f[CI]dirname\f[CR]" \f[CI]num\f[CR]
=\f[CI]macroname\f[CR] listonly}\fR
.RI ( num ,
.I macroname
-and the literal \[lq]listonly\[rq] are optional) will be expanded as follows:
+and the literal \[lq]\fClistonly\fR\[rq] are optional) will be expanded as
+follows:
.
.RS
.nr list 1 1
@@ -616,13 +617,24 @@ relative to current directory and up to
.I num
(if present) or 5 (if omitted) total subdirectories, a \fC<li>\fR
tag will be inserted into the \fCul\fR tag.
+.IP
+If the parameter \fClistonly\fR was specified, a \fC<li>\fR tag will instead be
+inserted for every
+.I .slw
+file within each of the subdirectories, sorted in reverse lexicographical order.
+In this case, each \fC<li>\fR will contain a permalink with a title preceded by
+a timestamp formatted according to \fClist_timestamp_format\fR. Title and date
+are read from each
+.I .slw
+file, as YAML variables \fCtitle\fR and \fCdate\fR. For this case, processing of
+the \fC{incdir}\fR directive stops here.
.
.IP \n+[list].
A \fC<details>\fR tag will be inserted into each \fC<li>\fR tag.
.
.IP \n+[list].
-Inside the \fC<details>\fR tag, a \fC<summary>\fR tag will be inserted with the
-name of the subdirectory. If
+Inside of the \fC<details>\fR tag, a \fC<summary>\fR tag will be inserted with
+the name of the subdirectory. If
.I macroname
is present, the name of the subdirectory will be prepended with the body of a
macro
@@ -632,7 +644,7 @@ macro
markup as arrows).
.
.IP \n+[list].
-After the \fC<summary>\fR tag a \fC<div>\fR tag will be inserted into
+After \fC<summary>\fR tag, a \fC<div>\fR tag will be inserted into
\fC<details>\fR, containing the concatenated output from processing each of the
.I .slw
files inside that subdirectory in reverse lexicographical order, in a manner
diff --git a/slweb.c b/slweb.c
@@ -1691,9 +1691,10 @@ process_incdir_subdir(FILE* output, const char* subdirname,
if (list_only)
{
print_output(output,
- "<li><a href=\"%s\">%s %s</a></li>\n",
+ "<li>%s <a href=\"%s\">%s</a></li>\n",
+ formatted_date,
permalink_url ? permalink_url : link,
- formatted_date, title);
+ title);
fflush(output);
/* ... and fallthrough to cleanup */
}