Skip to content

Commit b26b363

Browse files
authored
Merge pull request #169 from phel-lang/fix-description-release-items
Fix description release items
2 parents d689223 + 675a58a commit b26b363

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

build/api-page.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
require __DIR__ . '/../vendor/autoload.php';
66

7-
use Gacela\Framework\Gacela;
87
use Phel\Phel;
98
use PhelWeb\ApiGenerator\Facade as ApiGeneratorFacade;
109

11-
Gacela::bootstrap(__DIR__, Phel::configFn());
10+
Phel::bootstrap(__DIR__);
1211

1312
$facade = new ApiGeneratorFacade();
1413
$facade->generateApiMarkdownFile();

build/src/ApiGenerator/Application/ApiSearchGenerator.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
private const array SPECIAL_ENDING_CHARS = ['=', '*', '?', '+', '>', '<', '!'];
1212

1313
public function __construct(
14-
private ApiFacadeInterface $apiFacade
14+
private ApiFacadeInterface $apiFacade,
1515
) {
1616
}
1717

@@ -62,9 +62,8 @@ public function generateSearchIndex(): array
6262

6363
// Add documentation files to search index
6464
$documentationItems = $this->generateDocumentationSearchItems();
65-
$result = array_merge($result, $documentationItems);
6665

67-
return $result;
66+
return array_merge($result, $documentationItems);
6867
}
6968

7069
/**
@@ -83,8 +82,8 @@ private function formatDescription(string $desc): string
8382
private function generateDocumentationSearchItems(): array
8483
{
8584
$result = [];
86-
$documentationPath = __DIR__ . '/../../../../../content/documentation';
87-
85+
$documentationPath = __DIR__ . '/../../../../content/documentation';
86+
8887
if (!is_dir($documentationPath)) {
8988
error_log("Documentation path not found: " . $documentationPath);
9089
return [];
@@ -95,31 +94,31 @@ private function generateDocumentationSearchItems(): array
9594
error_log("Could not scan documentation directory: " . $documentationPath);
9695
return [];
9796
}
98-
97+
9998
foreach ($files as $file) {
10099
if (pathinfo($file, PATHINFO_EXTENSION) !== 'md' || $file === '_index.md') {
101100
continue;
102101
}
103-
102+
104103
$filePath = $documentationPath . '/' . $file;
105104
$content = file_get_contents($filePath);
106-
105+
107106
// Extract title from frontmatter
108107
$title = pathinfo($file, PATHINFO_FILENAME);
109108
if (preg_match('/title = "([^"]+)"/', $content, $matches)) {
110109
$title = $matches[1];
111110
}
112-
111+
113112
// Remove frontmatter
114113
$content = preg_replace('/\+\+\+.*?\+\+\+/s', '', $content);
115-
114+
116115
// Remove markdown formatting and clean content
117116
$content = preg_replace('/[#`*\[\]()]/', ' ', $content);
118117
$content = preg_replace('/\s+/', ' ', trim($content));
119-
118+
120119
// Limit content length for search index
121120
$content = substr($content, 0, 500);
122-
121+
123122
$result[] = [
124123
'id' => 'doc_' . pathinfo($file, PATHINFO_FILENAME),
125124
'title' => $title,

build/src/ReleasesGenerator/Application/GitHubReleasePagesGenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ private function shouldSkipLine(string $line): bool
119119
return empty($line)
120120
|| str_starts_with($line, '#')
121121
|| str_starts_with($line, '-')
122-
|| str_starts_with($line, '*');
122+
|| str_starts_with($line, '*')
123+
|| str_starts_with($line, '@');
123124
}
124125

125126
private function truncateDescription(string $description): string

0 commit comments

Comments
 (0)