Documentation
¶
Index ¶
- func Replace(s, old, new string) string
- func Unquote(s, quotes string) string
- func WithCommandArgs(args []string) options.Option
- func WithLocaleTag(localeTag string) options.Option
- func WithPrefix(prefix string) options.Option
- func WithPrefixPattern(pattern string) options.Option
- func WithProfile(profile *profile.Profile) options.Option
- func WithProfileName(name string) options.Option
- type Document
- type Option
- type Options
- type Profile
- type Row
- type Ruler
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Replace ¶ added in v0.4.16
Replace returns a copy of the string s with all non-overlapping instances of old replaced by new.
Replace just calls strings.ReplaceAll
func Unquote ¶ added in v0.4.16
Unquote returns a copy of a string with a single pair of identical characters removed from the start and end of the original string.
Purpose:
- allow data with leading or trailing whitespace to be stored in psv tables, e.g. " "
- Unquote() is intended to be used on individual data strings
- quoted strings cannot be used to prevent pipe characters from being used as column separators! i.e. "|" will not work! Use \| instead
Example:
t := psv.TableFromString(`
| string | unicode |
| ------ | ------- |
| " " | 0x20 |
`)
for _, row := range t.DataRows() {
s := psv.Unquote(row.Field("string"),`"`) // remove quotes before processing
...
}
func WithCommandArgs ¶ added in v0.4.16
any number of inline commands, e.g. sort insert wip delete bad ...
func WithLocaleTag ¶ added in v0.4.16
see also "locale" command
func WithPrefix ¶ added in v0.4.28
see also "prefix" command
func WithPrefixPattern ¶ added in v0.4.16
see also "prefix" command
func WithProfile ¶ added in v0.4.16
see also "profile" command
func WithProfileName ¶ added in v0.4.25
see also "profile" command
Types ¶
type Document ¶ added in v0.4.16
func NewDocument ¶ added in v0.4.16
type Options ¶
func NewOptions ¶ added in v0.4.28
type Ruler ¶
func NewRulerFromTemplate ¶ added in v0.4.16
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
psv
command
|
|
|
internal
|
|
|
data
data package is used to encode/decode data within psv tables
|
data package is used to encode/decode data within psv tables |
|
row
Data Encoding and Decoding entails the protection of data characters from corruption after being rendered as a PSV table, and restoring the original data from a PSV table.
|
Data Encoding and Decoding entails the protection of data characters from corruption after being rendered as a PSV table, and restoring the original data from a PSV table. |
|
ruler
Rulers are horizontal separators which may be used in `psv` tables to help visually separate rows within a table.
|
Rulers are horizontal separators which may be used in `psv` tables to help visually separate rows within a table. |
|
pkg
|
|
|
This is a simple web-server for re-formatting PSV tables.
|
This is a simple web-server for re-formatting PSV tables. |
Click to show internal directories.
Click to hide internal directories.
