md2zrt
v1.0.1
Published
Converts markdown to a rich text object, compabable with Zooms Chat API
Downloads
2
Readme
Built With
Getting Started
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Prerequisites
Node.js
Installation
npm i md2zrt
Usage Example
Require:
const md2zt = require('md2zt');
Interpret Markdown:
/** @type {[string, Array<rich_object>]} */
const [text, rich_objects] = md2zt(markdown);
// markdown: "# Hello World";
// text: 'Hello World';
/*
rich_objects: [{
format_type: 'Paragraph',
format_attr: 'h1',
start_position: 0,
end_position: 10
}];
/*
Fire to Zoom API
// Posting to /chat/users/{userId}/messages
const request = require('your-request-lib');
/* Make POST request*/...
{
/* Other request parameters*/...,
body: {
message: text,
rich_text: rich_objects,
to_channel: ...,
...
},
}