Skip to content

Linking to src for code snippets #4947

@NiloCK

Description

@NiloCK

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

I very much enjoy the snippet import functionality. It adds a 'type safety' of sorts against certain types of degradation of documentation against evolving source code.

Describe the solution you'd like

Two proposed, related, enhancements:

First, it would be nice if we could inset some title or filename information, so that it can be made clear that the inset code is "direct" from the source and not exemplar, or potentially dated, etc.

Second, could this feature be married with the sort of dynamic repository linking that powers features like the edit this page on github links?

Image

This way, documentation that draws from specific files gives readers a frictionless opportunity to dive into the the source itself.

Describe alternatives you've considered

No response

Additional context

Thanks much. Really enjoying vitepress so far.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions