gopandoc

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: AGPL-3.0 Imports: 4 Imported by: 1

README

gopandoc

Go API for using the pandoc document converter.

Install

Follow th installation instructions on pandoc.org/installing.html. Then, in your project folder, run

go get github.com/alexcoder04/gopandoc

Usage

Use pandoc in your go code as follows:

package main

import (
  "github.com/alexcoder04/gopandoc"
)

func main() {
  // convert markdown to docx
  var inBytes []byte = ...
  outBytes, err := gopandoc.BytesToBytes(inBytes, "markdown", "docx") ([]byte, error)
  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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToBytes

func BytesToBytes(input []byte, inFormat string, outFormat string) ([]byte, error)

func BytesToFile

func BytesToFile(input []byte, inFormat string, outFormat string, outputFile string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL