threads / patch / 3679

patchFix multi-paragraph list items in OPTIONS section

Subject: [PATCH] Fix multi-paragraph list items in OPTIONS section

## tl;dr

One message between Mar 19, 2006 and Mar 19, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Jonas Fonseca· Mar 19, 2006, 23:39 UTC · lore

Asciidoc cannot handle multi-paragraph description list items without the need for adding special control characters and reindenting all paragraphs but the first. Workaround it in make-cg-asciidoc so that the documentation in the script headers can use the more intuitive and readable formatting.

Affected files are cg-patch and cg-commit.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
 Documentation/make-cg-asciidoc |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)
Show changes to Documentation/make-cg-asciidoc +24 −1
diff --git a/Documentation/make-cg-asciidoc b/Documentation/make-cg-asciidoc
index 126d4eb..c454062 100755
--- a/Documentation/make-cg-asciidoc
+++ b/Documentation/make-cg-asciidoc
@@ -112,8 +112,31 @@ $DESCRIPTION
 
 OPTIONS
 -------
-$OPTIONS
+
+--
+__END__
+
+# Only indent the first paragraph of multi-paragraph list items.
+multipara=
+echo "$OPTIONS" | while read line; do
+	case "$line" in
+	*::)
+		multipara=
+		;;
+	"")
+		multipara=t
+		;;
+	*)
+		[ "$multipara" ] || line="	$line"
+	esac
+
+	echo "$line"
+done
+
+cat <<__END__
+
 $HELP_OPTIONS
+--
 
 $MISC
 
-- 
Jonas Fonseca

← back to recent threads