Skip to content

shortcode: show code snippets from file #179

Answered by McShelby
tied asked this question in Q&A
Discussion options

You must be logged in to vote

At the moment I don't plan to introduce such a feature. But you may work around with the existing shortcodes include and tabs or a combination of both like:

Plain file include (will be interpreted as markdown) as used in the exampleSite:

{{% include "basics/CHANGELOG.md" %}}

File include as code:

```json
{{% include "example.json" %}}
```

Plain file include in a tab:

{{< tabs >}}
{{% tab name="The changelog" %}}
{{% include "basics/CHANGELOG.md" %}}
{{% /tab %}}
{{< /tabs >}}

File include as code in a tab:

{{< tabs >}}
{{% tab name="json" %}}
```json
{{% include "example.json" %}}
```
{{% /tab %}}
{{< /tabs >}}

Let me know, if this solves your case.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by McShelby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #166 on February 11, 2022 07:32.