|
| 1 | +tags:: [[Tutorial]] |
| 2 | + |
| 3 | +- # [The-Pocket/Tutorial-Codebase-Knowledge: Turns Codebase into Easy Tutorial with AI](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge?tab=readme-ov-file) |
| 4 | + - ## [[My Notes]] |
| 5 | + id:: 68064514-3a60-443c-a1e3-29b72accb7b7 |
| 6 | + - [[2025-04-21 Mon]] |
| 7 | + - uses [[PocketFlowAI]] and builds a tutorial from any codebase |
| 8 | + - For example, [Graph & StateGraph | Codebase2Tutorial](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/LangGraph/01_graph___stategraph.html) is a #Tutorial for [[langgraph]] generated by this application |
| 9 | + - ## Resources |
| 10 | + - [Design Doc](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/main/docs/design.md) |
| 11 | + - has very clear #Prompts - don't quite |
| 12 | + - [Flow Code](https://github.com/The-Pocket/Tutorial-Codebase-Knowledge/blob/main/flow.py) |
| 13 | + - very little code! also, some interesting use of [[Py/Operator/Dunder/Right-shift]] |
| 14 | + - ```python |
| 15 | + from pocketflow import Flow |
| 16 | + # Import all node classes from nodes.py |
| 17 | + from nodes import ( |
| 18 | + FetchRepo, |
| 19 | + IdentifyAbstractions, |
| 20 | + AnalyzeRelationships, |
| 21 | + OrderChapters, |
| 22 | + WriteChapters, |
| 23 | + CombineTutorial |
| 24 | + ) |
| 25 | + |
| 26 | + def create_tutorial_flow(): |
| 27 | + """Creates and returns the codebase tutorial generation flow.""" |
| 28 | + |
| 29 | + # Instantiate nodes |
| 30 | + fetch_repo = FetchRepo() |
| 31 | + identify_abstractions = IdentifyAbstractions(max_retries=3, wait=10) |
| 32 | + analyze_relationships = AnalyzeRelationships(max_retries=3, wait=10) |
| 33 | + order_chapters = OrderChapters(max_retries=3, wait=10) |
| 34 | + write_chapters = WriteChapters(max_retries=3, wait=10) # This is a BatchNode |
| 35 | + combine_tutorial = CombineTutorial() |
| 36 | + |
| 37 | + # Connect nodes in sequence based on the design |
| 38 | + fetch_repo >> identify_abstractions |
| 39 | + identify_abstractions >> analyze_relationships |
| 40 | + analyze_relationships >> order_chapters |
| 41 | + order_chapters >> write_chapters |
| 42 | + write_chapters >> combine_tutorial |
| 43 | + |
| 44 | + # Create the flow starting with FetchRepo |
| 45 | + tutorial_flow = Flow(start=fetch_repo) |
| 46 | + |
| 47 | + return tutorial_flow |
| 48 | + ``` |
| 49 | + - Check out the [YouTube Development Tutorial](https://youtu.be/AFY67zOpbSo) for more! #YouTube |
| 50 | + - Check out the [Substack Post Tutorial](https://zacharyhuang.substack.com/p/ai-codebase-knowledge-builder-full) for more! #Substack |
0 commit comments