From 70d9578bb3c62a2fe8981789a6b2bed6dc38c25f Mon Sep 17 00:00:00 2001 From: Benno van den Berg Date: Thu, 11 Apr 2024 13:52:32 +0200 Subject: [PATCH] Update documenation in libsonnet --- fiberplane-templates/fiberplane.libsonnet | 27 ++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/fiberplane-templates/fiberplane.libsonnet b/fiberplane-templates/fiberplane.libsonnet index e0988e56..b184dfb7 100644 --- a/fiberplane-templates/fiberplane.libsonnet +++ b/fiberplane-templates/fiberplane.libsonnet @@ -486,10 +486,15 @@ local notebook = { /** * Add a front matter value and schema to the notebook. Recommended to be - * used with the `frontmatter` object. + * used with the `frontmatter.*` helpers. * - * TODO: Add signature - * TODO: Add ability to add array + * @function notebook.Notebook#addFrontMatter + * @param {object} value - Map of frontMatter and frontMatterSchema to add to the notebook. + * @returns {notebook.Notebook} + * + * @example notebook.addFrontMatter( + * frontMatter.pagerdutyIncident(pagerduty_frontmatter) + * ) */ addFrontMatter(value):: self { frontMatter+: value.frontMatter, @@ -501,7 +506,13 @@ local notebook = { local frontMatter = { /** - * TODO: Add docs + * Creates a PagerDuty Incident frontmatter value and schema. + * + * @function frontMatter.pagerdutyIncident + * @param {string} frontMatterValue - The value of the front matter as defined by the api. Recommended to use the value provided by the PagerDuty integration. + * @param {string} key - The key of the front matter entry + * @param {string} displayName - The display name of the front matter entry + * @returns {object} */ pagerdutyIncident(frontMatterValue, key='pagerduty_incident', displayName='PagerDuty Incident'):: { frontMatterSchema: [{ @@ -901,7 +912,13 @@ local snippet = function(cells) format: formattedContent(), /** - * TODO: add docs + * Functions for creating frontmatter + * @namespace frontMatter + * + * @example Adding a PagerDuty incident to a notebook + * notebook.addFrontMatter( + * frontMatter.pagerdutyIncident(pagerduty_frontmatter) + * ) */ frontMatter: frontMatter, }