https://github.com/tkc/go-text-export
text export and convert html library for Golang applications.
https://github.com/tkc/go-text-export
export golang text utility
Last synced: 25 days ago
JSON representation
text export and convert html library for Golang applications.
- Host: GitHub
- URL: https://github.com/tkc/go-text-export
- Owner: tkc
- License: mit
- Created: 2017-02-27T15:20:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-01T08:35:49.000Z (over 9 years ago)
- Last Synced: 2025-01-19T03:18:39.057Z (over 1 year ago)
- Topics: export, golang, text, utility
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-text-export
go-text-export is text export and convert html library for Golang applications.
# installation
If you have Go installed, you can just do:
```shell
go get github.com/tkc/go-text-export
```
# usage
## Export
```
Contrary to popular belief, Lorem Ipsum is not simply random text.
It has roots in a piece of classical Latin literature from 45 BC,
==>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of more..
```
Code
```go
go_text_export.Create(Str).SetMoreText(" more..").Export(100).RemoveWhiteSpace().String()
```
## SetMoreUrl
```
Contrary to popular belief, Lorem Ipsum is not simply random text.
It has roots in a piece of classical Latin literature from 45 BC,
==>Contrary to popular belie more..
```
Code
```go
go_text_export.Create(str).SetMoreText("more..").Export(30).SetMoreUrl("https://example.com/1")
```
## ConvertHtmlLink
```
link https://example.com
==>link https://example.com
```
Code
```go
go_text_export.Create(Str).ConvertHtmlLink().String()
```
## More Sample
```go
go_text_export.Create(Str).ConvertHtmlBrTag().String()
go_text_export.Create(Str).RemoveWhiteSpace().String()
go_text_export.Create(Str).Prepare(100).String()
```
## Method List
```go
Export
Prepare
ConvertHtmlLink
ConvertHtmlBrTag
RemoveWhiteSpace
RemoveNewLine
SetMoreText
SetMoreUrl
String
```