Skip to content

Commit 1a48956

Browse files
authored
Prettify docs (#164)
- [ x] I have added tests for my changes - [ x] I have updated the documentation or added new documentation as needed - [ x] I have read and agree to the [Contributor License Agreement](../CLA.md) Co-authored-by: KopekC <[email protected]>
1 parent 80a8f65 commit 1a48956

10 files changed

+2
-66
lines changed

docs/building-with-codegen/codebase-visualization.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,3 @@ def create_custom_graph(codebase):
273273
- Some graph layouts may take time to compute
274274
- Preview features only work when adding symbol objects directly
275275

276-
Remember to:
277-
278-
1. Use symbol objects (not just names) when you want rich previews
279-
2. Focus visualizations on specific aspects of the codebase
280-
3. Use NetworkX's built-in graph types (DiGraph, Graph)
281-
4. Keep graphs manageable in size for better readability

docs/building-with-codegen/dependencies-and-usages.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ iconType: "solid"
77

88
Codegen pre-computes dependencies and usages for all symbols in the codebase, enabling constant-time queries for these relationships.
99

10-
This document explains how to use the dependency and usage tracking APIs in Codegen.
11-
1210
## Overview
1311

1412
Codegen provides two main ways to track relationships between symbols:

docs/building-with-codegen/files-and-directories.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Codegen provides three primary abstractions for working with your codebase's fil
1515
[SourceFile](/api-reference/core/SourceFile) is a subclass of [File](/api-reference/core/File) that provides additional functionality for source code files.
1616
</Info>
1717

18-
This guide explains how to effectively use these classes to manage your codebase.
1918

2019
## Accessing Files and Directories
2120

docs/building-with-codegen/inheritable-behaviors.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ iconType: "solid"
77

88
Codegen uses a set of core behaviors that can be inherited by code elements. These behaviors provide consistent APIs across different types of symbols.
99

10-
This guide explains the key behaviors and how to use them effectively.
1110

1211
## Core Behaviors
1312

docs/building-with-codegen/the-editable-api.mdx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,3 @@ for var in function.code_block.get_local_var_assignments():
168168
print(f"Warning: {var.name} defined in try block")
169169
```
170170

171-
## Best Practices
172-
173-
1. **Use High-Level Operations**: Prefer operations like `rename()` over direct source editing when possible.
174-
2. **Leverage Search**: Use the built-in search capabilities rather than parsing text manually.
175-
3. **Work with Extended Sources**: Use `extended_source` when you need to modify decorators or comments together with the code.
176-
4. **Mind the Context**: Remember that each Editable knows its location and relationships in the code.
177-
5. **Trust the Formatting**: Let Codegen handle whitespace and syntax details automatically.

docs/building-with-codegen/variable-assignments.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Codegen's enables manipulation of variable assignments via the following classes
1010
- [AssignmentStatement](../api-reference/core/AssignmentStatement) - A statement containing one or more assignments
1111
- [Assignment](../api-reference/core/Assignment) - A single assignment within an AssignmentStatement
1212

13-
This document provides examples of how to manipulate assignments using these APIs
1413

1514
### Simple Value Changes
1615

docs/introduction/community.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Join the growing Codegen community! We're excited to have you be part of our jou
4040

4141
We welcome contributions of all kinds! Whether you're fixing a typo in documentation, reporting a bug, or implementing a new feature, we appreciate your help in making Codegen better.
4242

43-
Check out our [Contributing Guide](https://github.com/codegen-sh/codegen-sdk/blob/main/CONTRIBUTING.md) on GitHub to learn how to:
43+
Check out our [Contributing Guide](https://github.com/codegen-sh/codegen-sdk/blob/develop/CONTRIBUTING.md) on GitHub to learn how to:
4444

4545
- Set up your development environment
4646
- Submit pull requests

docs/tutorials/increase-type-coverage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Each of these has an associated setter.
3131

3232
## Finding the extent of your type coverage
3333

34-
T to get an indication of your progress on type coverage, analyze the percentage of typed elements across your codebase
34+
To get an indication of your progress on type coverage, analyze the percentage of typed elements across your codebase
3535

3636
```python
3737
# Initialize counters for parameters

docs/tutorials/react-modernization.mdx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,3 @@ components/
320320
code](/building-with-codegen/moving-symbols) here.
321321
</Note>
322322

323-
## Best Practices
324-
325-
1. **Test Thoroughly**: React modernization can affect component behavior. Test each conversion carefully.
326-
327-
2. **Incremental Updates**: Convert components gradually, especially in large codebases.
328-
329-
3. **Update Dependencies**: Ensure your package.json has the required dependencies for modern React features.
330-
331-
4. **TypeScript Migration**: Consider using this opportunity to add TypeScript support to your components.
332-
333-
5. **Documentation**: Update component documentation to reflect the new functional patterns.
334-
335-
By following these guidelines, you can effectively modernize your React codebase while maintaining functionality and improving maintainability.

docs/tutorials/training-data.mdx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -200,36 +200,3 @@ def create_training_example(function_data):
200200
examples = [create_training_example(f) for f in training_data["functions"]]
201201
```
202202

203-
## Best Practices
204-
205-
1. **Filter Small Functions**: Skip trivial functions that won't provide meaningful training data:
206-
```python
207-
if len(function.source.split("\n")) < 2:
208-
continue
209-
```
210-
211-
2. **Ensure Sufficient Context**: Only use functions with dependencies or usages:
212-
```python
213-
if len(context["dependencies"]) + len(context["usages"]) > 0:
214-
training_data["functions"].append(context)
215-
```
216-
217-
3. **Track Metadata**: Keep statistics about your training data:
218-
```python
219-
training_data["metadata"] = {
220-
"total_functions": len(codebase.functions),
221-
"total_processed": len(training_data["functions"]),
222-
"avg_dependencies": average_dependencies,
223-
"avg_usages": average_usages
224-
}
225-
```
226-
227-
4. **Handle Import Chains**: Follow import chains to find root implementations:
228-
```python
229-
def hop_through_imports(imp: Import) -> Symbol | ExternalModule:
230-
if isinstance(imp.imported_symbol, Import):
231-
return hop_through_imports(imp.imported_symbol)
232-
return imp.imported_symbol
233-
```
234-
235-
By following these guidelines, you can generate high-quality training data for your LLM projects while maintaining code quality and consistency.

0 commit comments

Comments
 (0)