From 35fda84ba830415a575b5f99f7405353ab8d3c93 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Thu, 13 Jul 2017 03:26:08 -0700 Subject: Documentation pt. I --- app/javascript/glitch/util/bio_metadata.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'app/javascript/glitch/util/bio_metadata.js') diff --git a/app/javascript/glitch/util/bio_metadata.js b/app/javascript/glitch/util/bio_metadata.js index bdbb1750b..c5e87f356 100644 --- a/app/javascript/glitch/util/bio_metadata.js +++ b/app/javascript/glitch/util/bio_metadata.js @@ -1,3 +1,33 @@ +/* + +`util/bio_metadata` +======================== + +> For more information on the contents of this file, please contact: +> +> - kibigo! [@kibi@glitch.social] + +This file provides two functions for dealing with bio metadata. The +functions are: + + - __`processBio(content)` :__ + Processes `content` to extract any frontmatter. The returned + object has two properties: `text`, which contains the text of + `content` sans-frontmatter, and `metadata`, which is an array + of key-value pairs (in two-element array format). If no + frontmatter was provided in `content`, then `metadata` will be + an empty array. + + - __`createBio(note, data)` :__ + Reverses the process in `processBio()`; takes a `note` and an + array of two-element arrays (which should give keys and values) + and outputs a string containing a well-formed bio with + frontmatter. + +*/ + + /* * * * */ + /*********************************************************************\ To my lovely code maintainers, -- cgit