it('should convert elaborate markdown to platejs',async()=>{
constmarkdown=`# Welcome to the Plate Playground!
Experienceamodernrich-texteditorbuiltwith[Slate](https://slatejs.org) and [React](https://reactjs.org). This playground showcases just a part of Plate's capabilities. [Explore the documentation](/docs) to discover more.
it('should convert callout platejs element to markdown',async()=>{
constelements: ReportElements=[
{
children:[
{
text:'Our most popular mountain bike over the last 12 months is Mountain-200 Black, 38 with 825 units sold.',
},
],
type:'p',
},
{
children:[
{
text:'Key Findings',
},
],
type:'h2',
},
{
children:[
{
children:[
{
children:[
{
text:'The top-selling mountain bike model is ',
},
{
bold: true,
text:'Mountain-200 Black, 38',
},
{
text:'.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'It sold ',
},
{
bold: true,
text:'825 units',
},
{
text:' in the last 12 months.',
},
],
type:'lic',
},
],
type:'li',
},
],
type:'ul',
},
{
children:[
{
text:'Metric',
},
],
type:'h2',
},
{
children:[
{
text:'<metric>\n',
},
{
text:'',
},
{
text:'\n</metric>',
},
],
type:'p',
},
{
children:[
{
text:'Context',
},
],
type:'h2',
},
{
children:[
{
children:[
{
children:[
{
text:'I focused specifically on complete bicycle products in the ',
},
{
bold: true,
text:'Mountain Bikes',
},
{
text:' subcategory within the broader ',
},
{
bold: true,
text:'Bikes',
},
{
text:' category to avoid counting components or frames.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'I measured popularity by ',
},
{
bold: true,
text:'units sold',
},
{
text:', which reflects the number of bikes customers purchased.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Timeframe defaults to the ',
},
{
bold: true,
text:'last 12 months',
},
{
text:' to show a current view.',
},
],
type:'lic',
},
],
type:'li',
},
],
type:'ul',
},
{
children:[
{
text:'Methodology',
},
],
type:'h2',
},
{
children:[
{
children:[
{
children:[
{
text:'Data sources: Sales order lines and headers, and product catalog tables in the operational analytics database.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Filters:',
},
],
type:'lic',
},
{
children:[
{
children:[
{
children:[
{
text:'Product Category = "Bikes"',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Product Subcategory = "Mountain Bikes"',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Order Date between CURRENT_DATE - 12 months and CURRENT_DATE',
},
],
type:'lic',
},
],
type:'li',
},
],
type:'ul',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Calculation:',
},
],
type:'lic',
},
{
children:[
{
children:[
{
children:[
{
text:'For each mountain bike product, sum of sales order quantities from sales order details.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Select the product with the highest total units sold.',
},
],
type:'lic',
},
],
type:'li',
},
],
type:'ul',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Notes on definitions:',
},
],
type:'lic',
},
{
children:[
{
children:[
{
children:[
{
text:'"Most popular" defined as highest ',
},
{
bold: true,
text:'units sold',
},
{
text:'; alternative definitions could use revenue or number of distinct orders, but units sold most directly represents product popularity by volume.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Product names are used as the display label to identify the specific model.',
},
],
type:'lic',
},
],
type:'li',
},
],
type:'ul',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Alternatives considered:',
},
],
type:'lic',
},
{
children:[
{
children:[
{
children:[
{
text:'Using revenue-based popularity could favor higher-priced bikes; I chose units to avoid price bias.',
},
],
type:'lic',
},
],
type:'li',
},
{
children:[
{
children:[
{
text:'Using the riding discipline filter (e.g., Mountain) was considered, but I used the explicit Mountain Bikes subcategory to exclude components.',