shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.81k stars 1.28k forks source link

Aside component / multi-column content #414

Open brianjenkins94 opened 2 years ago

brianjenkins94 commented 2 years ago

The ability to augment the main body of content with aside content in an adjacent column. Ideally with some way to write this (in markdown or similar) so that the aside content could live in the same file and section as the body content.

Examples:


I'd be willing to attempt to contribute this but I'm stuck on a few things:

TL;DR: Feature Request(?): Stripe-style API docs.

shuding commented 2 years ago

This is a good idea, I'm wondering if there's a proposal for this in the Markdown/MDX ecosystem for a new syntax like you mentioned. Otherwise, I'd stick with custom React component for this.

Another thing is it currently conflicts with the floating ToC design.

brianjenkins94 commented 2 years ago

You can extend markdown syntax by way of Remark plugins, or so I've been told.

Looks like MDX offers some advice on this as well: https://mdxjs.com/docs/extending-mdx/

shuding commented 2 years ago

Yes, Nextra is already doing that. What I'm wondering is if there's any standard syntax, or a proposal for this use case, instead of inventing a new one.

brianjenkins94 commented 2 years ago

Research:

In Markua, A> is used to represent an aside, with other letters combined with > representing different types of asides (e.g B> for blurb, W> for warning)."

They discuss the fence syntax I suggested further down, noting it would conflict with triply nested blockquotes.


Here's another syntax:

The quick brown fox ^[Aside content here]

And that's actually all I could find.