Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
DocumentOutputPathPrefixer.php1.07 kB
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Config\Import\PathPrefixer; /** * Applies path prefix to document output paths * * The pathPrefix specifies a subdirectory to prepend to all document outputPath values * in the imported configuration. * * Example: * - Document has outputPath: 'docs/api.md' * - Import has pathPrefix: 'api/v1' * - Resulting outputPath: 'api/v1/docs/api.md' */ final readonly class DocumentOutputPathPrefixer extends PathPrefixer { /** * Apply path prefix to the output path of all documents */ public function applyPrefix(array $config, string $pathPrefix): array { // Apply to document outputPath values if (isset($config['documents']) && \is_array($config['documents'])) { foreach ($config['documents'] as &$document) { if (isset($document['outputPath'])) { $document['outputPath'] = $this->combinePaths($pathPrefix, $document['outputPath']); } } } return $config; } }

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