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
+1 -1
View File
@@ -86,7 +86,7 @@ class LanguageCsharp(Language):
assert RE_CODE.match(EXAMPLE_CODE) is not None
@classmethod
def shorten(cls, contents: str) -> str:
def shorten(cls, contents: str) -> dict[str, str]:
if (m := LanguageCsharp.RE_CODE.match(contents)) is None:
msg = "Invalid snippet format"
raise ValueError(msg)