Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qiushiyan/go-quarto

Go interface to Quarto
https://github.com/qiushiyan/go-quarto

Last synced: about 1 month ago
JSON representation

Go interface to Quarto

Awesome Lists containing this project

README

        

# Quarto

Go interface to Quarto (unofficial).

For more information on Quarto, see the project Github repositories at https://github.com/quarto-dev/

## Usage

Install the package with:

```
go get -u github.com/qiushiyan/go-quarto
```

Render a Quarto document

```go
config := &quarto.Config{
Output: "path/to/output.pdf",
Format: "html"
}
config.SetExtra("-M", "echo:true")

quarto.Render(ctx, "path/to/source.qmd", config)
```

### Specifying output

Currently Quarto does not allow the `--output` argument to contain a directory path (see [discussion](https://github.com/quarto-dev/quarto-cli/issues/2440)), this library makes a workaround to copy the source file into the specified directory and render from there. This may require adjustments to the source file as the working directory at render time is now the output directory.