-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support path and relative-path prop #25
base: main
Are you sure you want to change the base?
Conversation
Jump to github demo. @vitepress-demo-preview/component package should achieve for the function. Right? |
It's actually not very suitable for @vitepress-demo-preview/component. It is useful when customizing the demo-preview, and we need to customize the GitHub blob address. Reference: https://github.com/tusen-ai/naive-ui/blob/HEAD/demo/utils/EditOnGithubHeader.vue#LL11C22-L11C22 I don't think it should be added to the default component. This is just a simple use case and would add unnecessary complexity. |
Additionally, I haven't found any test cases to verify this functionality. The dependencies in the example are linked to remote addresses. How should I proceed with testing? |
OK, but the codes you modified doesn't do the function. relativePath should is a online link url but you get the absolute path of the local component. |
We should make sure that a relativePath prop is resolvable by the plugin. Right? |
It shouldn't be a remote path unless <script lang="ts" setup>
const props = defineProps<{
relativePath: string
}>()
const githubPath = `https://www.github.com/.../tree/main${props.relativePath}`
</script>
<template>
<!-- .... -->
<a :href="githubPath">to github edit</a>
</template> |
I added support for that feature in markdown-it-vitepress-demo#metadata and implemented other features as well. It has indeed been helpful to me. Additionally, I would like to thank the project for providing me with great inspiration! |
yes, however, it should replace |
Yeah, well, you can change the code and submit it. I will merge the pr. Then you just need to customize your own preview component. Thanks! |
close #24
Submitted with StackBlitz Codeflow.