README

common/data/text

This folder should be used for libraries that store, organize or manipulate textual data.

Expand ▾ Collapse ▴

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Doc

func Doc(doc string) string

    Doc transforms doc:

    1. Strips leading and trailing whitespace.
    2. Removes common '\t' indentation.
    3. Replaces '\n' not-followed by whitespace with ' '.
    

    See example.

    This function is not fast.

    Example
    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.

    Source Files

    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.