Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
RawRenderStrategy.php1.15 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Source\GitDiff\RenderStrategy; use Butschster\ContextGenerator\Lib\Content\ContentBuilder; use Butschster\ContextGenerator\Source\GitDiff\RenderStrategy\Config\RenderConfig; /** * Renders git diffs in raw format (default) * * This strategy renders the diffs exactly as they come from git * with standard +/- notation for added/removed lines. */ final readonly class RawRenderStrategy implements RenderStrategyInterface { public function render(array $diffs, RenderConfig $config): ContentBuilder { $builder = new ContentBuilder(); // Add each diff foreach ($diffs as $file => $diffData) { // Only show stats if configured to do so if ($config->showStats && !empty($diffData['stats'])) { $builder ->addTitle("Stats for {$file}", 2) ->addCodeBlock($diffData['stats']); } $builder ->addTitle("Diff for {$file}", 2) ->addCodeBlock($diffData['diff'], 'diff'); } return $builder; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-hub/generator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server