https://github.com/alexcoder04/gopandoc
Go API for using the pandoc document converter
https://github.com/alexcoder04/gopandoc
Last synced: 5 months ago
JSON representation
Go API for using the pandoc document converter
- Host: GitHub
- URL: https://github.com/alexcoder04/gopandoc
- Owner: alexcoder04
- License: agpl-3.0
- Created: 2023-04-15T14:22:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-01T08:44:52.000Z (over 2 years ago)
- Last Synced: 2025-04-03T20:15:35.097Z (9 months ago)
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gopandoc
Go API for using the [pandoc](https://pandoc.org/) document converter.
## Install
Follow th installation instructions on [pandoc.org/installing.html](https://pandoc.org/installing.html).
Then, in your project folder, run
```sh
go get github.com/alexcoder04/gopandoc
```
## Usage
Use pandoc in your go code as follows:
```go
package main
import (
"github.com/alexcoder04/gopandoc"
)
func main() {
// convert markdown to docx
var inBytes []byte = ...
outBytes, err := gopandoc.BytesToBytes(inBytes, "markdown", "docx")
if err != nil {
...
}
...
}
```
There is also a `BytesToFile(input []byte, inFormat string, outFormat string, outputFile string)` function for directly writing the results into a file.