Skip to content

Commit

Permalink
Merge pull request #68 from soee/indexExceptionAndOtherManuals
Browse files Browse the repository at this point in the history
[TASK] Index also documentation from Other manuals and Exceptions
  • Loading branch information
linawolf authored Feb 16, 2024
2 parents 6eb5b3d + a5a9b01 commit 3279a1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ parameters:
- ^m/
- ^c/
- ^p/
- ^other/
- ^typo3cms/
# should be relative paths to the main folders we search in, see DirectoryFinderService
docsearch.excluded_directories:
- other
- draft
- typo3cms/extensions
- extensions
.container.dumper.inline_class_loader: true
assets:
css:
Expand Down
4 changes: 4 additions & 0 deletions src/Config/ManualType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum ManualType: string
case Typo3Manual = 'TYPO3 manual';
case CoreChangelog = 'Core changelog';
case DocsHomePage = 'Docs Home Page';
case ExceptionReference = 'Exception Reference';

public function getKey(): string
{
Expand All @@ -20,6 +21,7 @@ public function getKey(): string
self::Typo3Manual => 'm',
self::CoreChangelog => 'changelog',
self::DocsHomePage => 'h',
self::ExceptionReference => 'typo3cms',
};
}

Expand All @@ -31,6 +33,8 @@ public static function getMap(): array
'm' => self::Typo3Manual->value,
'changelog' => self::CoreChangelog->value,
'h' => self::DocsHomePage->value,
'other' => self::Typo3Manual->value,
'typo3cms' => self::ExceptionReference->value,
];
}
}
8 changes: 8 additions & 0 deletions src/Dto/Manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public static function createFromFolder(\SplFileInfo $folder, $changelog = false
[$_, $vendor, $name, $__, $language, $type, $version] = $values;
$type = \strtolower($type);
$name .= '-' . $type;
} elseif (count($pathArray) >= 4 && array_slice($pathArray, -4, 1)[0] === ManualType::ExceptionReference->getKey()) {
// typo3 exceptions manuals have different structure than other manuals
// they are located in /typo3cms/exceptions/ folder, and we also ignore one other
// folder inside /typo3cms/ through services.yaml file and the docsearch.excluded_directories parameter
$values = array_slice($pathArray, -5, 5);
array_shift($values); // remove the Web part from the path
[$type, $name, $version, $language] = $values;
$vendor = 'typo3';
} else {
// e.g. "c/typo3/cms-workspaces/9.5/en-us"
$values = array_slice($pathArray, -5, 5);
Expand Down

0 comments on commit 3279a1c

Please sign in to comment.