Skip to content

Commit

Permalink
Update documenation in libsonnet
Browse files Browse the repository at this point in the history
  • Loading branch information
hatchan committed Apr 11, 2024
1 parent e718035 commit 70d9578
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions fiberplane-templates/fiberplane.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: [{
Expand Down Expand Up @@ -901,7 +912,13 @@ local snippet = function(cells)
format: formattedContent(),

/**
* TODO: add docs
* Functions for creating frontmatter
* @namespace frontMatter
*
* @example <caption>Adding a PagerDuty incident to a notebook</caption>
* notebook.addFrontMatter(
* frontMatter.pagerdutyIncident(pagerduty_frontmatter)
* )
*/
frontMatter: frontMatter,
}

0 comments on commit 70d9578

Please sign in to comment.