include

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package include provides the `@include "file.nflow"` directive. The referenced file is preprocessed recursively in the caller's context (cycle detection uses the include chain), and its pipelines, declarations, and require block are merged into the parent's meta.

Typical use:

@include ./shared/child.nflow

Index

Constants

View Source
const ID = "include"

Variables

View Source
var Directive = core.Directive{
	Name:    "include",
	Example: `@include "shared/child.nflow"`,
	Handler: handleDirective,
}

Directive parses `@include "path"` and merges the referenced file's meta into the parent. Path resolution is relative to the including file's directory.

After merging meta, it applies the merged compile-time constants (`${ns.key}` references from `@const` and `@const.load`) to the parent's own source lines below the @include. Without this step the constants live in meta but never reach the parent's text, so a `@require { url: "${env.X}" }` after the @include would ship the literal `${env.X}` to the bundle resolver.

Functions

func Bundle

func Bundle(_ map[string]string) core.Bundle

Types

This section is empty.

Jump to

Keyboard shortcuts

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