From f360afa6135b8bd2d384d9ba4582c0de6fdac804 Mon Sep 17 00:00:00 2001 From: Paula Gearon Date: Fri, 15 Oct 2021 13:42:50 -0400 Subject: [PATCH] Readme update for metadata (#41) --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 303dd37..3bdaf74 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,24 @@ In the pod client: nil ``` +#### Metadata + +Pods may attach metadata to functions and macros by sending data to the pod client +in a `"meta"` field as part of a `"var"` section. The metadata must be an appropriate +map, encoded as an EDN string. This is only applicable to vars in the pod and will be +ignored if the var refers to Client-side code, since metadata can already be defined +in those code blocks. + +For example, a pod can define a function called `add`: + +``` clojure +{"format" "json" + "namespaces" + [{"name" "pod.babashka.demo" + "vars" [{"name" "add" + "meta" "{:doc \"arithmetic addition of 2 arguments\" :arglists ([a b])}"}]}]} +``` + #### Deferred namespace loading When your pod exposes multiple namespaces that can be used independently from