d2compiler

package
v0.0.0-...-e815181 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package d2compiler implements a parser, compiler and autoformatter for the Terrastruct d2 diagramming language.

Index

Constants

This section is empty.

Variables

View Source
var FullToShortLanguageAliases map[string]string
View Source
var ShortToFullLanguageAliases = map[string]string{
	"md":  "markdown",
	"tex": "latex",
	"js":  "javascript",
	"go":  "golang",
	"py":  "python",
	"rb":  "ruby",
	"ts":  "typescript",
}

TODO add more, e.g. C, bash

Functions

func Compile

func Compile(p string, r io.Reader, opts *CompileOptions) (*d2graph.Graph, *d2target.Config, error)

Types

type CompileOptions

type CompileOptions struct {
	UTF16Pos bool
	// FS is the file system used for resolving imports in the d2 text.
	// It should correspond to the root path.
	FS fs.FS
}

Jump to

Keyboard shortcuts

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