vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Import code snippets as dynamic path

Open juzser opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

Is there any way to import code snippets as dynamic name. For example get from $frontmatter.

<<< ./{{ $frontmatter.file }}
Screenshot 2023-12-14 at 10 36 04

Describe the solution you'd like

I think the fence should replace the variable first.

Describe alternatives you've considered

No response

Additional context

No response

Validations

juzser avatar Dec 14 '23 03:12 juzser

I found a solution to do by config md.renderer.rules.fence but I think it still should have a globally solution.

juzser avatar Dec 14 '23 04:12 juzser

Hi @juzser, are you still sticking with the solution? Would you share your configuration?

lukasberbuer avatar Apr 03 '24 11:04 lukasberbuer

I'm still modifying markdown fence to achieve the result. You can check my configuration at this file link

juzser avatar Apr 04 '24 02:04 juzser