Include content of file #1098
Unanswered
MarkusKeck
asked this question in
Q&A
Replies: 1 comment
-
Maybe it is possible to change the behavior of the already existing .md include.
This does only work with .md files at the moment. Maybe it should be considered also being able to load other files, this would open up many new interesting possibilities. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment I use "markdown-it-codetabs" inside my vitepress application, and it works just fine.
The problem is, that I cannot use the shortcut for including code into those blocks.
There is a working example for codetabs here: https://stackblitz.com/edit/vite-6s7rfj?file=docs%2Findex.md
This are the codetabs from the example above:
'''js [g1:JavaScript]
console.log("hello");
'''
'''py [g1:Python3]
print("hello")
'''
But I cannot use the shortcut for including snippets like this, because I have to specify in the brackets what kind of group they are related to.
<<< @/snippets/java/hello-world.java
These aproaches do not work:
'''java [g1:Java]
<<< @/snippets/java/hello-world.java
'''
'''java [g1:Java] <<< @/snippets/java/hello-world.java
'''
I would love to have the ability to just import the content of a file into the codetab, so I can still spliit the code from the documentation itself.
Beta Was this translation helpful? Give feedback.
All reactions