Skip to content
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

@include markdown and code files from an arbitrary public URL #3349

Open
4 tasks done
hkong-mitre opened this issue Dec 16, 2023 · 4 comments
Open
4 tasks done

@include markdown and code files from an arbitrary public URL #3349

hkong-mitre opened this issue Dec 16, 2023 · 4 comments
Labels
enhancement New feature or request stale

Comments

@hkong-mitre
Copy link

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

My project spans several repositories under a single GitHub user. I'm building a vitepress project (which is in its own repository) for documentation and API reference for all my repositories because they are all related to each other. I like to include Markdown and code snippets from each of the repositories.

I've tried this for including files from my vitepress repository, like this

<!--@include: ./setup.md-->

and it works nicely, but

<!--@include: https://github.com/CVEProject/cvelistV5/blob/main/README.md#reporting-issues -->

does not work.

It would be very helpful to be able to include arbitrary markdown and code into my vitepress project. Is there a way to do this?

Describe the solution you'd like

It would be very helpful to be able to include arbitrary markdown and code into my vitepress project.

Sections from a Markdown file:

<!--@include: https://github.com/CVEProject/cvelistV5/blob/main/README.md#reporting-issues -->

Lines from a JSON (or any source code) file:

<!--@include:  https://github.com/CVEProject/cvelistV5/blob/main/cves/1999/0xxx/CVE-1999-0001.json{123,131} -->

Is there a way to do this?

Describe alternatives you've considered

One possible alternative to doing it in vitepress' markdown extension is to write a Vue component that reads in the file and displays that, but having it as a feature of vitepress so others can use it would be more useful to the vitepress community.

Additional context

I think this feature would be useful for writing Guides and API References, but also other documentation (e.g., a full tutorial for using Vue and vitepress in a Docker container, in a section for how to set up the development environment) where it would be even more important so that the doc is always up-to-date with its dependent projects.

Validations

@brc-dd brc-dd added the enhancement New feature or request label Dec 30, 2023
@github-actions github-actions bot added the stale label Feb 2, 2024
@arthurfiorette
Copy link

arthurfiorette commented May 17, 2024

Hey @brc-dd, how's going?

Is there a way to define documentation across multiple packages in multiple github repositories, while having a single repository for documentation, but keep each package's documentation in their own repo?

This PR might solve this use case, but I'm not sure...

@brc-dd
Copy link
Member

brc-dd commented May 18, 2024

Is there a way to define documentation across multiple packages in multiple github repositories, while having a single repository for documentation, but keep each package's documentation in their own repo?

You probably can use git submodules + rewrites for that. I don't think this will help with that because with this you'll need to create a bunch of md files in your docs repo with just an @include: directive.

@github-actions github-actions bot removed the stale label May 23, 2024
@clabnet
Copy link

clabnet commented Jun 3, 2024

@brc-dd Very interesting. But how can I link a file on my repo ?
Using this syntax the file is not included :o(

:::code-group
```bash [Dockerfile]
<!-- @include: https://dev.azure.com/xxxxxxxxxxxx/_git/horizon-fe?path=/Dockerfile -->

@github-actions github-actions bot added the stale label Jul 17, 2024
@davestewart
Copy link

I'm looking for something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

5 participants