d2key

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MPL-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package d2key tracks where reserved words denote attributes in D2 source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope int

Some map keys name user data even when they happen to spell a D2 keyword.

const (
	BoardFields Scope = iota // keys at the root of a diagram or board
	ShapeFields
	BoardNames
	ClassNames
	VariableFields // arbitrary variable names and data, including plugin configuration
)

func (Scope) Assignment

func (scope Scope) Assignment(mk *d2ast.Key) (Scope, bool)

Assignment follows dotted fields and indexed connection attributes. The boolean reports whether the assigned value belongs to the link keyword.

func (Scope) Child

func (scope Scope) Child(keyword string) Scope

Jump to

Keyboard shortcuts

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