{"id":16486092,"url":"https://github.com/roziscoding/slack-rich-text","last_synced_at":"2025-07-18T17:34:24.894Z","repository":{"id":223339494,"uuid":"758744597","full_name":"roziscoding/slack-rich-text","owner":"roziscoding","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-25T18:39:00.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T02:55:48.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/roziscoding.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-17T01:07:17.000Z","updated_at":"2024-10-25T18:39:05.000Z","dependencies_parsed_at":"2024-02-26T19:39:29.955Z","dependency_job_id":null,"html_url":"https://github.com/roziscoding/slack-rich-text","commit_stats":null,"previous_names":["roziscoding/smack","roziscoding/slack-rich-text"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fslack-rich-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fslack-rich-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fslack-rich-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roziscoding%2Fslack-rich-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roziscoding","download_url":"https://codeload.github.com/roziscoding/slack-rich-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241279348,"owners_count":19938083,"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-10-11T13:28:20.115Z","updated_at":"2025-02-28T23:47:43.204Z","avatar_url":"https://github.com/roziscoding.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Rich Text\n\nSmall library to create slack messages with rich text using the BlockKit.\n\n## Installing\n\n`npm i slack-rich-text`\n\n## Usage\n\nUse the exported function as a template string tag to create a rich text message.\nTo apply the transformation to a string inside some other function, like using `bold` on a list, use the `section` function.\n\nExample:\n```javascript\nimport { bullets, emoji, ordered, richText, section } from \"slack_rich_text\";\n\nconst blocks = richText`\n  This is a test message for slack-rich-text.\n\n  It supports:\n  ${bullets([\n    \"Bullet lists\",\n    \"Yaay!\",\n    ordered([\n      \"Also\",\n      \"Ordered\",\n      \"Lists\", \n      bullets([\n        \"And\", \n        \"Nested\", \n        \"Lists\",\n        section`${emoji(\"smile\")} ${emoji(\"smile\")} ${emoji(\"smile\")}`\n      ])\n    ])\n  ])}\n`;\n```\nRenders as:\n\n![slack block kit builder screenshot](./usage-screenshot.png)\n\n## Passing strings to `richText`\n\nThe `richText` function does not support receiving a string as a value. That means that the following code will not work:\n\n```javascript\nconst name = \"John\";\nconst blocks = richText`\n  Hello, ${name}!\n`; // This will throw an error\n```\n\nTo fix this, use the `section` function to transform the string into a block:\n\n```javascript\nconst name = \"John\";\nconst blocks = richText`\n  ${section`Hello, ${name}!`}\n`;\n```\n\n## API Reference\n\nSee the [API Reference](./API.md) for a detailed explanation of the available functions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fslack-rich-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froziscoding%2Fslack-rich-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froziscoding%2Fslack-rich-text/lists"}