JSON2Markdown Renderer is designed to convert JSON data into Markdown, making it especially useful for providing a quick overview or for non-developers to read.
The conversion process begins by using the json2markdown package to parse the JSON data into Markdown, followed by using markdown2html to convert the Markdown into sanitized HTML.
In this process:
- Objects are converted into headings and content.
- Arrays are converted into lists.
- Arrays of objects are converted into tables.
- Markdown content is preserved.
- HTML content is sanitized.
The following shows how different types of JSON data appear after being converted into Markdown.
Hello, World!
- ♈ Aries
- ♉ Taurus
- ♊ Gemini
- ♋ Cancer
- ♌ Leo
- ♍ Virgo
- ♎ Libra
- ♏ Scorpius
- ♐ Sagittarius
- ♑ Capricorn
- ♒ Aquarius
- ♓ Pisces
Symbol | Name | Description | See Also | Metadata |
---|---|---|---|---|
🌑 | New Moon | A new moon, the first of the eight phases of the moon. | 🌘, 🌒 |
|
🌒 | Waxing Crescent Moon | A waxing crescent moon, the second of the eight phases of the moon. | 🌑, 🌓 |
|
🌓 | First Quarter Moon | A first quarter moon, the third of the eight phases of the moon. | 🌒, 🌔 |
|
🌔 | Waxing Gibbous Moon | A waxing gibbous moon, the fourth of the eight phases of the moon. | 🌓, 🌕 |
|
🌕 | Full Moon | A full moon, the fifth of the eight phases of the moon. | 🌔, 🌖 |
|
🌖 | Waning Gibbous Moon | A waning gibbous moon, the sixth of the eight phases of the moon. | 🌕, 🌗 |
|
🌗 | Last Quarter Moon | A last quarter moon, the seventh of the eight phases of the moon. | 🌖, 🌘 |
|
🌘 | Waning Crescent Moon | A waning crescent moon, the eighth of the eight phases of the moon. | 🌗, 🌑 |
|
import { Converter as JsonToMarkdownConverter } from '@memochou1993/json2markdown';
import { Converter as MarkdownToHtmlConverter } from '@memochou1993/markdown2html';
const markdown = JsonToMarkdownConverter.toMarkdown({
status: '😤',
});
const html = MarkdownToHtmlConverter.toHTML(markdown);
console.log(html);
// Output:
// <h1>status</h1>
// <p>😤</p>