https://github.com/veggiemonk/inbtw
small Go utility to extract the text in between two tags
https://github.com/veggiemonk/inbtw
cli docs documentation go golang sed text-processing tools
Last synced: 11 months ago
JSON representation
small Go utility to extract the text in between two tags
- Host: GitHub
- URL: https://github.com/veggiemonk/inbtw
- Owner: veggiemonk
- License: apache-2.0
- Created: 2023-07-01T19:44:52.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-09T19:59:41.000Z (almost 3 years ago)
- Last Synced: 2025-04-02T00:37:41.074Z (about 1 year ago)
- Topics: cli, docs, documentation, go, golang, sed, text-processing, tools
- Language: Go
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inbtw
`inbtw` (a.k.a. "in between"), is a small utility to extract the text in between two tags.
```bash mdox-exec="inbtw" mdox-expect-exit-code=2
inbtw extracts the text between tags.
A tag is defined by "// [START " and "// [END "
Example for a file containing:
// [START mytag]
var Bla = "bla"
// [END mytag]
executing:
> inbtw -tag mytag -f myfile.go
will yield:
var Bla = "bla"
Usage of inbtw:
-f string
file(s) to parse, multiple files can be separated by ',', '-' for stdin.
-tag string
tag containing the text to extract.
```
## Purpose
To extract code snippets in order to render them in a document. It requires less maintenance than something like `sed` because it needs line numbers, and less complicated than regex or `awk`.
## Installing
```shell
go install github.com/veggiemonk/inbtw@latest
```