Open GorvGoyl opened 2 years ago
Thanks for sharing, I marked it as information and won't close this issue for future reference.
Improved version with responsive css and support of titles + paragraphs + images in each column (exactly like Notion)
n2m.setCustomTransformer("column_list", async (block) => {
const mdBlocks_temp = await n2m.pageToMarkdown(block.id);
let final_md_string = `<div className="column" style={{ display: "flex", columnGap: "25px" }}>`;
for (const one_block of mdBlocks_temp) {
const mdString_temp = n2m.toMarkdownString(one_block.children);
final_md_string = final_md_string + `<div>${mdString_temp}</div>`
}
return final_md_string + "</div>"
});
.column div {
display: flex;
justify-content: center;
flex-direction: column;
}
@media screen and (max-width: 630px) {
.column {
flex-direction: column;
}
}
I needed to show 2 images in one row (2 columns), but it isn't directly possible. Currently, content in columns is rendered as individual rows. I figured out a way to show it in columns as how it is shown in Notion.
I thought of sharing it in case others are looking for same.