From e6415a250b9489598e607ad1c1c0b4f1e42cea1a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 7 Dec 2024 01:29:33 -0500 Subject: [PATCH] Add method to Document to get the current environment --- document.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/document.go b/document.go index 1a588d3..06f0dad 100644 --- a/document.go +++ b/document.go @@ -47,6 +47,11 @@ func (this *Document) Execute (output io.Writer, data ExecutionData) error { }) } +// Environment returns the environment this document is in. +func (this *Document) Environment () *Environment { + return this.environment +} + // ExecutionData is data made available to documents as they are being exeucted. type ExecutionData struct { Data any // Custom data