Generate multiple code snippets from a single source file (#2146)

* Support generating multiple snippets from one source file

* Convert Python code snippets from one source file

* Add code snippets for C#, Go, Java, Rust and TS

* Make intro less Python-oriented

* Add client installation instructions for all languages

* Cleanup python code

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
This commit is contained in:
Abdon Pijpelink
2026-02-23 10:09:56 +01:00
committed by GitHub
co-authored by xzfc
parent db35eb3992
commit bcc3c7206b
87 changed files with 2501 additions and 204 deletions
@@ -12,6 +12,7 @@
<!-- Extract shortcode parameters -->
{{ $path := .Get "path" }}
{{ $order := .Get "order" }}
{{ $block := .Get "block" }}
<!-- Convert order string to a slice if provided -->
@@ -53,7 +54,7 @@
<!-- Read all files from the given path -->
{{ $files := dict }}
{{ range $dir := slice (printf "content/%s" $path) (printf "content/%s/generated" $path) }}
{{ range $dir := slice (printf "content/%s" $path) (printf "content/%s/generated/%s" $path $block) }}
{{ if not (fileExists $dir) }}
{{ continue }}
{{ end }}