From 984949ac826f42982e1de88fcf0d2103c283b612 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Fri, 20 Jun 2025 18:41:03 +0530 Subject: [PATCH 1/3] feat: update docs --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7e3733..04305ea 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ After adding your snippets, run the server > [!NOTE] > -> Embedding defaults to using the CPU. You may use the `--gpu` with a GPU number flag if you wish to use a dedicated GPU. +> Embedding defaults to using the CPU. You may use the `--gpu` flag with a GPU number to use a dedicated GPU. ``` cargo r @@ -43,7 +43,7 @@ cargo r ### Usage -An HTTP REST API listens on port 8000 and can be queried for code snippet. +An HTTP REST API listens on port 8000 and can be queried for code snippets. #### Query a snippet @@ -60,6 +60,12 @@ curl http://localhost:8000/api/v1/add --json \ '{ "desc": "Build an asynchronous shared mutable state", "lang": "rust", "body": "let object = Arc::new(Mutex::new(old));" }' ``` +## v2 API + +Language grammar parsing with abstract syntax tree manipulation support. + +Coming soon + ## TODOs - [ ] Create an LSP to add the suffix based on filetype. From 608480a297a53bd7873942a78b404f85675bd8fb Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Fri, 20 Jun 2025 18:46:35 +0530 Subject: [PATCH 2/3] feat: update docs to reflect KDL snippets --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 04305ea..43c70f5 100644 --- a/README.md +++ b/README.md @@ -20,27 +20,27 @@ cd silos ### Setup -Add your code snippets in the `./snippets/v1/LANGUAGE/` directory as JSON files, where LANGUAGE is some programming language. +Add your code snippets as KDL files in the `./snippets/v1/LANGUAGE/` directory, Take a look at the example snippet for golang in `./snippets/v1/go/simple_worker.kdl`. The snippets must conform to the following structure: -``` json -{ - "desc": "a well articulated description of the snippet", - "body": "fn main() { println!(\"The body of the snippet\") }" -} +``` kdl +desc "a well articulated description of the snippet", +body #"fn main() { println!("The body of the snippet") }"# ``` +KDL supports arbitrary raw strings with as many `#`s before and after the quotes to disambiguate them from the string contents. + After adding your snippets, run the server +``` sh +cargo r +``` + > [!NOTE] > > Embedding defaults to using the CPU. You may use the `--gpu` flag with a GPU number to use a dedicated GPU. -``` -cargo r -``` - ### Usage An HTTP REST API listens on port 8000 and can be queried for code snippets. From 74a7bdb6eed9713b0937c57b73b36c513db3d51a Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:46:24 +0530 Subject: [PATCH 3/3] feat: bump version to stable --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ae9b84f..acc6070 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "silos" -version = "0.1.0" +version = "1.0.0" edition = "2024" [dependencies]