Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

How to render shortcode into markdown like code

Solved by Pedro M View solution

Started by Pedro M 3 years ago · 1 replies · 359 views
3 years ago

Hello.

I'm trying to insert an example shortcode into a page, and I'd like to write the code, but it's impossible for Grav not to render the code. This is my code (I wrap it in the three back quotes):

TXT
[sc-table header=true class="alt"]
| Header 1 | Header 2 | Header 3 | Header 4 |
| Cell 1 | Cell 2 | Cell 3 | Cell 4 |
| Cell 5 | Cell 6 | Cell 7 | Cell 8 |
[/sc-table]

I would like to get exactly the same as in this post, the code is displayed as a code, without rendering.

In my case, this code is rendering, showing the table.

How can I get it?

What I have done so far:

  1. Activate extra markdown in settings
  2. Add ```markdown to the beginning of the block
  3. I have tried with [raw], but although it shows the code, it does not respect the indentation.

Thanks in advance

3 years ago Solution

Finally, I found a solution, but I'd like your suggestion if it is the better:

[raw]

MARKDOWN
[sc-table header=true class="alt"]
| Header 1 | Header 2 |  Header 3 |  Header 4 |
| Cell 1   | Cell 2   | Cell 3   | Cell 4  |
| Cell 5   | Cell 6   | Cell 7   | Cell 8  |
[/sc-table]

[/raw]

Using [raw] and ```markdown

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 133 1 day ago
General · by pamtbaau, 1 day ago
1 93 1 day ago
General · by Andy Miller, 2 days ago
0 77 2 days ago
General · by Marcel, 12 months ago
6 388 5 days ago
General · by Duc , 6 days ago
3 72 6 days ago