Skip to content

Commit

Permalink
docs: Fixed some generated examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 19, 2024
1 parent e695ed9 commit 2ee7964
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/helpers/GenerateDocs/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
code = code.Substring(start + 4, end - start + 4);

var lines = code.Split('\n')[1..^2];
code = string.Join('\n', lines.Select(x => x.Length > 8 ? x[8..] : string.Empty));
code = string.Join('\n', lines
.Where(x => !x.Contains(".Should()"))
.Select(x => x.Length > 8 ? x[8..] : string.Empty));

code = code
.Replace(
"using var api = GetAuthorizedApi();",
"using var api = new AnthropicApi(apiKey);")
;

var newPath = Path.Combine(newDir, $"{Path.GetExtension(Path.GetFileNameWithoutExtension(path)).TrimStart('.')}.md");
await File.WriteAllTextAsync(newPath, $@"```csharp
Expand Down

0 comments on commit 2ee7964

Please sign in to comment.