{"id":13764542,"url":"https://github.com/brh55/spark-messages","last_synced_at":"2026-04-17T07:31:06.765Z","repository":{"id":57366909,"uuid":"80848340","full_name":"brh55/spark-messages","owner":"brh55","description":":speech_balloon: A collection of helpers to ensure consistent, predictable formatting of Cisco spark markdown messages","archived":false,"fork":false,"pushed_at":"2017-02-18T22:58:09.000Z","size":48,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T11:37:54.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brh55.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-03T16:45:24.000Z","updated_at":"2017-06-08T19:19:58.000Z","dependencies_parsed_at":"2022-08-23T20:10:59.367Z","dependency_job_id":null,"html_url":"https://github.com/brh55/spark-messages","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Fspark-messages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Fspark-messages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Fspark-messages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Fspark-messages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brh55","download_url":"https://codeload.github.com/brh55/spark-messages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245075788,"owners_count":20556988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T16:00:22.504Z","updated_at":"2026-04-17T07:31:01.735Z","avatar_url":"https://github.com/brh55.png","language":"JavaScript","funding_links":[],"categories":["Code samples"],"sub_categories":["REST API samples"],"readme":"# spark-messages [![Build Status](https://img.shields.io/travis/brh55/spark-messages.svg?style=flat-square)](https://travis-ci.org/brh55/spark-messages) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo)\n\n\u003e A collection of helpers to ensure consistent formatting of Cisco spark messages.\n\n`spark-messages` may be redudant in some regards, but there are some side-benefits:\n\n- Any changes to markdown interpretation is corrected outside of source code\n- Ensure the usage of only a supported set of markdown -- no need to \"guess and check\"\n- `HTML/CSS`-like methods for easier referencing and implicit behavior\n- Programmability\n\n## Install\n\n```\n$ npm install --save spark-messages\n```\n\n## Usage\n\n```js\nconst sm = require('spark-messages');\n\nconst message = `\n${sm.h1('🦄 Unicorn Town')}\n${sm.hr()}\nFor more info, click ${sm.link('http://unicornland.com', 'here')}!`\n//=\u003e\n# 🦄 Unicorn Town\n___\nFor more info, click [here](http://unicornland.com)!\n\n```\n\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/6020066/22878113/44fb2754-f18d-11e6-90f6-c28fd20aae9a.png\" width=\"650\"\u003e\n\n#### Advance Usages\nMass editing a set of links\n```js\nconst sm = require('spark-messages');\n\nconst links = [\n\t'http://google.com',\n\t'http://facebook.com',\n\t'http://instagram.com'\n];\n\nconst mdLinks = links.map(sm.link);\nconst boldLinks = mdLinks.map(sm.bold);\nconst mdLinkList = sm.ol(boldLinks);\n\n// SHORT-HAND: sm.ol(links.map(raw =\u003e sm.link(sm.bold(raw))))\n// =\u003e\n//   1. **\u003chttp://google.com\u003e**\n//   2. **\u003chttp://facebook.com\u003e**\n//   3. **\u003chttp://instagram.com\u003e**\n```\n\n\u003cimg src=\"https://cloud.githubusercontent.com/assets/6020066/22878373/75f5423a-f18e-11e6-8e58-e583ef4e2011.png\" width=\"690\"\u003e\n\n## API\n\nPreview the [Spark Messages Wiki](https://github.com/brh55/spark-messages/wiki) for visual reference of Spark output and examples.\n\n## Elements\n### h*{n}*(text)\n\u003e h1(text), h2(text), h3(text), h4(text), h5(text), h6(text)\n\n#### Text\n\nType: `string`\n\nText to be a header.\n\n\u003cbr\u003e\n\n### link(href, title)\n\u003e **Alias:** a(), anchor()\n\n#### href\n\nType: `string`\n\nUrl for the link\n\n#### title\n\nType: `string`\n\nMask for the link.\n\n\u003cbr\u003e\n\n### email(emailAddress, title)\n\n#### emailAddress\n\nType: `string`\n\nEmail address to create an link email. HTML equivalent = `\u003ca href=\"mailto:emailaddress\"\u003eemailAddress\u003c/a\u003e`\n\n#### title\n\nType: `string`\n\nMask for the email.\n\n\u003cbr\u003e\n\n### telephone(telephoneNumber, title)\n\u003e **Alias:** tel()\n\n#### telephoneNumber\n\nType: `string`\n\nTelephone number to be an `tel:`.\n\n#### title\n\nType: `string`\n\nMask for the telephone number.\n\n\u003cbr\u003e\n\n### unorderedList(items)\n\u003e **Alias:** ul(items)\n\n#### items\n\nType: `array`\n\nList of items to be individually transformed to unordered list items.\n\n\u003cbr\u003e\n\n### orderedList(items)\n\u003e **Alias:** ol(items)\n\n#### items\n\nType: `array`\n\nList of items to be individually transformed to unordered list items.\n\n\u003cbr\u003e\n\n### unorderedList(items)\n\u003e **Alias:** ul(items)\n\n#### items\n\nType: `array`\n\nList of items to be individually transformed to ordered list items.\n\n## Font Style\n\n### bold(text)\n\u003e **Alias:** b(), heavy()\n\n#### Text\n\nType: `string`\n\nText to be bolded.\n\n\u003cbr\u003e\n\n### italic(text)\n\u003e **Alias:**  i(text),  em(text),  emphasis(text)\n\n#### Text\n\nType: `string`\n\nText to be italicize.\n\n\u003cbr\u003e\n\n### code(text)\n\u003e **Alias:** c(text)\n\n#### Text\n\nType: `string`\n\nText to be transformed into a code style.\n\n\u003cbr\u003e\n\n### codeBlock(text)\n\u003e **Alias:** cb(text)\n\n#### Text\n\nType: `string`\n\nText to be transformed into a code block style.\n\n## Visual Elements\n### horizontalRule()\n\u003e **Alias**:  hr()\n\n*Returns a markdown horziontal rule (___).*\n\n\u003cbr\u003e\n\n### lineBreak()\n\u003e **Alias**:  br()\n\n*Returns a linebreak.*\n\n## License\n\nMIT © [Brandon Him](https://github.com/brh55)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Fspark-messages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrh55%2Fspark-messages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Fspark-messages/lists"}