From 80d4e57fe8df6a1087211ff1a50ae04dc4069047 Mon Sep 17 00:00:00 2001 From: JesusValera Date: Sun, 26 Oct 2025 19:16:27 +0100 Subject: [PATCH 1/2] Ignore "Contributors" from description text --- .../Application/GitHubReleasePagesGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/src/ReleasesGenerator/Application/GitHubReleasePagesGenerator.php b/build/src/ReleasesGenerator/Application/GitHubReleasePagesGenerator.php index 57b70460..f3cab740 100644 --- a/build/src/ReleasesGenerator/Application/GitHubReleasePagesGenerator.php +++ b/build/src/ReleasesGenerator/Application/GitHubReleasePagesGenerator.php @@ -119,7 +119,8 @@ private function shouldSkipLine(string $line): bool return empty($line) || str_starts_with($line, '#') || str_starts_with($line, '-') - || str_starts_with($line, '*'); + || str_starts_with($line, '*') + || str_starts_with($line, '@'); } private function truncateDescription(string $description): string From 675a58a0b539bc18d837843b5fcbcaad99bdc27d Mon Sep 17 00:00:00 2001 From: JesusValera Date: Sun, 26 Oct 2025 19:20:48 +0100 Subject: [PATCH 2/2] Fix wrong path for documentation search in "ApiSearchGenerator" --- build/api-page.php | 3 +-- .../Application/ApiSearchGenerator.php | 23 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/build/api-page.php b/build/api-page.php index bdbf33b9..f012cb6b 100644 --- a/build/api-page.php +++ b/build/api-page.php @@ -4,11 +4,10 @@ require __DIR__ . '/../vendor/autoload.php'; -use Gacela\Framework\Gacela; use Phel\Phel; use PhelWeb\ApiGenerator\Facade as ApiGeneratorFacade; -Gacela::bootstrap(__DIR__, Phel::configFn()); +Phel::bootstrap(__DIR__); $facade = new ApiGeneratorFacade(); $facade->generateApiMarkdownFile(); diff --git a/build/src/ApiGenerator/Application/ApiSearchGenerator.php b/build/src/ApiGenerator/Application/ApiSearchGenerator.php index 7a3f54b9..1ae0a569 100644 --- a/build/src/ApiGenerator/Application/ApiSearchGenerator.php +++ b/build/src/ApiGenerator/Application/ApiSearchGenerator.php @@ -11,7 +11,7 @@ private const array SPECIAL_ENDING_CHARS = ['=', '*', '?', '+', '>', '<', '!']; public function __construct( - private ApiFacadeInterface $apiFacade + private ApiFacadeInterface $apiFacade, ) { } @@ -62,9 +62,8 @@ public function generateSearchIndex(): array // Add documentation files to search index $documentationItems = $this->generateDocumentationSearchItems(); - $result = array_merge($result, $documentationItems); - return $result; + return array_merge($result, $documentationItems); } /** @@ -83,8 +82,8 @@ private function formatDescription(string $desc): string private function generateDocumentationSearchItems(): array { $result = []; - $documentationPath = __DIR__ . '/../../../../../content/documentation'; - + $documentationPath = __DIR__ . '/../../../../content/documentation'; + if (!is_dir($documentationPath)) { error_log("Documentation path not found: " . $documentationPath); return []; @@ -95,31 +94,31 @@ private function generateDocumentationSearchItems(): array error_log("Could not scan documentation directory: " . $documentationPath); return []; } - + foreach ($files as $file) { if (pathinfo($file, PATHINFO_EXTENSION) !== 'md' || $file === '_index.md') { continue; } - + $filePath = $documentationPath . '/' . $file; $content = file_get_contents($filePath); - + // Extract title from frontmatter $title = pathinfo($file, PATHINFO_FILENAME); if (preg_match('/title = "([^"]+)"/', $content, $matches)) { $title = $matches[1]; } - + // Remove frontmatter $content = preg_replace('/\+\+\+.*?\+\+\+/s', '', $content); - + // Remove markdown formatting and clean content $content = preg_replace('/[#`*\[\]()]/', ' ', $content); $content = preg_replace('/\s+/', ' ', trim($content)); - + // Limit content length for search index $content = substr($content, 0, 500); - + $result[] = [ 'id' => 'doc_' . pathinfo($file, PATHINFO_FILENAME), 'title' => $title,