Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Example (Align) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` headerA:, :headerB: content, content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | -------:|:-------:| | content | content |
Example (Csv) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` headerA, headerB content, content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ------- | ------- | | content | content |
Example (Format) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` headerA, headerB short, very very long content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ------- | ---------------------- | | short | very very long content |
Example (Multibyte) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` headerA, headerB マルチバイト文字, content マルチバイト文字, content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ---------------- | ------- | | マルチバイト文字 | content | | マルチバイト文字 | content |
Example (Repeat) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` | headerA | headerB | | -------:|:-------:| | content | content | next content, next content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ------------:|:------------:| | content | content | | next content | next content |
Example (Short) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` #,A 1,B `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | # | A | | --- | --- | | 1 | B |
Example (Short_align) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` #:,:A: 1,B `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | # | A | | ---:|:---:| | 1 | B |
Example (Tsv) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` headerA headerB content content `) result, _ := mdt.Convert("", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ------- | ------- | | content | content |
Example (With_header) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` content, content `) result, _ := mdt.Convert("headerA,headerB", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | ------- | ------- | | content | content |
Example (With_header_align) ¶
package main import ( "fmt" "strings" "github.com/monochromegane/mdt" ) func main() { r := strings.NewReader(` content, content `) result, _ := mdt.Convert("headerA:,:headerB", r) fmt.Printf("%s", result) }
Output: | headerA | headerB | | -------:|:------- | | content | content |
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.