Files
bf2ce7e452 feat(mdx): support VS Code-style #region extraction for <include /> (#2791)
* feat(include): support VS Code-style #region extraction for code files

* chore: add changeset for include code region support

* improve perf & fix bugs

* Docs: introduce region support

---------

Co-authored-by: Fuma Nama <[email protected]>
2025-12-20 18:06:57 +08:00

118 lines
1.5 KiB
Plaintext

## Using JSX
Full:
> # Hello World \[#heading]
>
> Hey there!
>
> <section id="section-in-jsx">
> This is My Test.
>
> ### Nested Heading
>
> ```ts
> console.log('Hello World');
> ```
> </section>
>
> :::section{#section-in-directive}
> ### Heading in Directive
>
> some content inside.
> :::
First Heading:
> # Hello World
>
> Hey there!
>
> <section id="section-in-jsx">
> This is My Test.
>
> ### Nested Heading
>
> ```ts
> console.log('Hello World');
> ```
> </section>
>
> :::section{#section-in-directive}
> ### Heading in Directive
>
> some content inside.
> :::
In JSX:
> This is My Test.
>
> ### Nested Heading
>
> ```ts
> console.log('Hello World');
> ```
In Directive:
> ### Heading in Directive
>
> some content inside.
## Using Directives
In Directive:
> ### Heading in Directive
>
> some content inside.
Inline Directive:
> ### Heading in Directive
>
> some content inside.
## Code
> ```ts
> //#region a
> console.log('hello world');
> //#endregion
>
> export function fn() {
> //#region b
> console.log('one');
> //#region c
> return function nested() {
> console.log('two');
> //#endregion
> console.log('three');
> };
> //#endregion
> }
>
> ```
With Region:
> ```ts
> console.log('hello world');
> ```
With Nested Region:
> ```ts
> console.log('one');
> return function nested() {
> console.log('two');
> console.log('three');
> };
> ```
> ```ts
> return function nested() {
> console.log('two');
> ```