Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Doc ¶
Doc transforms doc:
- Strips leading and trailing whitespace.
- Removes common '\t' indentation.
- Replaces '\n' not-followed by whitespace with ' '.
See example.
This function is not fast.
Example ¶
fmt.Println(Doc(` Leading blank line above is removed. The indentation on the left is trimmed. These 2 lines appear on the same line, with a space instead of newline. A new paragraph is preserved. New line before indented text is preserved. Indentation of the intentionally indented text is preserved. Trailing blank lines is removed. `))
Output: Leading blank line above is removed. The indentation on the left is trimmed. These 2 lines appear on the same line, with a space instead of newline. A new paragraph is preserved. New line before indented text is preserved. Indentation of the intentionally indented text is preserved. Trailing blank lines is removed.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package pattern implements lightweight parsable string patterns.
|
Package pattern implements lightweight parsable string patterns. |
Package sanitizehtml implements a sanitizer of a very limited HTML.
|
Package sanitizehtml implements a sanitizer of a very limited HTML. |
Package stringtemplate implements Python string.Template-like substitution.
|
Package stringtemplate implements Python string.Template-like substitution. |
Package templateproto defines a proto-based way to configure templates for JSON documents.
|
Package templateproto defines a proto-based way to configure templates for JSON documents. |
Package units provides common useful printable units.
|
Package units provides common useful printable units. |
Click to show internal directories.
Click to hide internal directories.