Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github markdown load code block from a repo file

I want to add a JSON code block in my README.md and the code block needs to be loaded from the repo file.

E.g, is it possible to do the following?

```json
<<load data from res/data.json>>
```

where res/data.json is a file in the same repo? I know it is possible to have a hyperlink, but I want the JSON data to appear there directly without clicking on the hyperlink.

like image 886
takladev Avatar asked May 31 '26 05:05

takladev


1 Answers

I was also looking for a way to do this, and while I agree with Chris' analysis, you might consider github actions as a possible work-around:

https://github.com/marketplace/actions/markdown-embed-code-from-file

like image 179
Tom Hillman Avatar answered Jun 02 '26 18:06

Tom Hillman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!