Enhance documentation and improve API configuration
- Added VPN connection requirement to README.md for local access to the Logistics API. - Updated documentation_api_logistics.md to clarify usage environments and provide detailed connection instructions. - Modified update-documentation.mdc to include guidelines on handling sensitive information in examples. - Implemented automatic heading ID generation in Documentation.php for better navigation in the documentation. - Updated logistics.php configuration to include default values for base URL, API key, and folder. - Added support contact information in the dashboard view for API-related issues.
This commit is contained in:
@@ -25,7 +25,29 @@ class Documentation extends Page
|
||||
{
|
||||
$markdownPath = base_path('documentation/documentation_api_logistics.md');
|
||||
$markdown = file_get_contents($markdownPath);
|
||||
$this->htmlContent = Str::markdown($markdown);
|
||||
$html = (string) Str::markdown($markdown);
|
||||
|
||||
$this->htmlContent = preg_replace_callback(
|
||||
'/<(h[1-6])>(.*?)<\/\1>/i',
|
||||
function (array $matches): string {
|
||||
$tag = $matches[1];
|
||||
$content = $matches[2];
|
||||
$slug = self::slugify(strip_tags($content));
|
||||
|
||||
return "<{$tag} id=\"{$slug}\">{$content}</{$tag}>";
|
||||
},
|
||||
$html,
|
||||
) ?? $html;
|
||||
}
|
||||
|
||||
private static function slugify(string $text): string
|
||||
{
|
||||
$slug = mb_strtolower($text, 'UTF-8');
|
||||
$slug = preg_replace('/[.\s]+/', '-', $slug);
|
||||
$slug = preg_replace('/[^\w\x{00C0}-\x{024F}-]/u', '', $slug);
|
||||
$slug = preg_replace('/-+/', '-', $slug);
|
||||
|
||||
return trim($slug, '-');
|
||||
}
|
||||
|
||||
public function getHeaderActions(): array
|
||||
|
||||
Reference in New Issue
Block a user