design/51082-godocfmt: add Printer fields for Text output
These are needed to provide the old go/doc API faithfully.
For golang/go#51082.
Change-Id: I975551873fdfd5fccae51280300bff14f2059aee
Reviewed-on: https://go-review.googlesource.com/c/proposal/+/398535
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/design/51082-godocfmt.md b/design/51082-godocfmt.md
index d2509df..d6841d8 100644
--- a/design/51082-godocfmt.md
+++ b/design/51082-godocfmt.md
@@ -939,6 +939,23 @@
// passed to [DocLink.DefaultURL] to construct a DocLink's URL.
// See that method's documentation for details.
DocLinkBaseURL string
+
+ // TextPrefix is a prefix to print at the start of every line
+ // when generating text output using the Text method.
+ TextPrefix string
+
+ // TextCodePrefix is the prefix to print at the start of each
+ // preformatted (code block) line when generating text output,
+ // instead of (not in addition to) TextPrefix.
+ // If TextCodePrefix is the empty string, it defaults to TextPrefix+"\t".
+ TextCodePrefix string
+
+ // TextWidth is the maximum width text line to generate,
+ // measured in Unicode code points,
+ // excluding TextPrefix and the newline character.
+ // If TextWidth is zero, it defaults to 80 minus the number of code points in TextPrefix.
+ // If TextWidth is negative, there is no limit.
+ TextWidth int
}
A Printer is a doc comment printer. The fields in the struct can be filled
in before calling any of the printing methods in order to customize the