Skip to content

Commit

Permalink
Easier syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
louismaximepiton committed Mar 7, 2024
1 parent 8e0d181 commit 9424fa3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
22 changes: 8 additions & 14 deletions site/content/docs/5.3/components/list-group.md
Expand Up @@ -346,30 +346,24 @@ Use the tab JavaScript plugin—include it individually or through the compiled
<div class="col-8">
<div class="tab-content" id="nav-tabContent2">
<div class="tab-pane fade show active" id="list-home2" role="tabpanel" aria-labelledby="list-home-list2">
{{ rendering }}
{{ skip ... }}
<p>Some placeholder content in a paragraph relating to "Home". And some more content, used here just to pad out and fill this tab panel. In production, you would obviously have more real content here. And not just text. It could be anything, really. Text, images, forms.</p>
{{ end }}
{{ code }}...{{ end }}
{{ /skip }}
</div>
<div class="tab-pane fade" id="list-profile2" role="tabpanel" aria-labelledby="list-profile-list2">
{{ rendering }}
{{ skip <p class="test">Lorem Ipsum</p>}}
<p>Some placeholder content in a paragraph relating to "Profile". And some more content, used here just to pad out and fill this tab panel. In production, you would obviously have more real content here. And not just text. It could be anything, really. Text, images, forms.</p>
{{ end }}
{{ code }}
<p class="test">Lorem ipsum</p>
{{ end }}
{{ /skip }}
</div>
<div class="tab-pane fade" id="list-messages2" role="tabpanel" aria-labelledby="list-messages-list2">
{{ rendering }}
{{ skip }}
<p>Some placeholder content in a paragraph relating to "Messages". And some more content, used here just to pad out and fill this tab panel. In production, you would obviously have more real content here. And not just text. It could be anything, really. Text, images, forms.</p>
{{ end }}
{{ code }}{{ end }}
{{ /skip }}
</div>
<div class="tab-pane fade" id="list-settings2" role="tabpanel" aria-labelledby="list-settings-list2">
{{ rendering }}
{{ skip ... }}
<p>Some placeholder content in a paragraph relating to "Settings". And some more content, used here just to pad out and fill this tab panel. In production, you would obviously have more real content here. And not just text. It could be anything, really. Text, images, forms.</p>
{{ end }}
{{ code }}...{{ end }}
{{ /skip }}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions site/layouts/shortcodes/example.html
Expand Up @@ -22,7 +22,7 @@
<div class="bd-example-snippet bd-code-snippet">
{{- if eq $show_preview true }}
<div{{ with $id }} id="{{ . }}"{{ end }} class="bd-example m-0 border-0{{ with $class }} {{ . }}{{ end }}">
{{ replaceRE `(?U){{-?\s*rendering\s*-?}}([\s\S]*){{-?\s*end\s*-?}}` "$1" (replaceRE `(?U){{-?\s*code\s*-?}}(?:[\s\S]*){{-?\s*end\s*-?}}` "" $content) | safeHTML }}
{{ replaceRE `(?U){{.*skip.*}}` "" $content | safeHTML }}
</div>
{{- end }}

Expand All @@ -44,7 +44,7 @@
{{- $content = replaceRE `<svg class="bd-placeholder-img(?:-lg)?(?: *?bd-placeholder-img-lg)? ?(.*?)".*?<\/svg>` `<img src="..." class="$1" alt="...">` $content -}}
{{- $content = replaceRE `<img class="bd-placeholder-img(?:-lg)?(?: *?bd-placeholder-img-lg)? ?(.*?)".*?>` `<img src="..." class="$1" alt="...">` $content -}}
{{- $content = replaceRE ` (class=" *?")` "" $content -}}
{{- $content = replaceRE `(?U)(?:\s*){{-?\s*code\s*-?}}([\s\S]*){{-?\s*end\s*-?}}(?:\s*)(\S)` "$1$2" (replaceRE `(?U)(?:\s*){{-?\s*rendering\s*-?}}(?:[\s\S]*){{-?\s*end\s*-?}}(?: *)\n` "" $content) -}}
{{- $content = replaceRE `(?U)[\s]+{{\s*skip\s+([^\s].*)?\s*}}[\s\S]*{{.*skip.*}}[\s]*<` "$1<" $content -}}
{{- highlight (trim $content "\n") $lang "" -}}
{{- end }}
</div>

0 comments on commit 9424fa3

Please sign in to comment.