Skip to content

Commit

Permalink
Theme fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Jun 24, 2021
1 parent 69cc301 commit d79be99
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion camel/Camel.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ public static function groupEndpoints(array $endpoints, array $endpointGroupInde
'description' => Arr::first($endpointsInGroup, function (ExtractedEndpointData $endpointData) {
return !empty($endpointData->metadata->groupDescription);
})->metadata->groupDescription ?? '',
'endpoints' => $sortedEndpoints->map(fn(ExtractedEndpointData $endpointData) => $endpointData->forSerialisation()->toArray())->values()->all(),
'endpoints' => $sortedEndpoints->map(
fn(ExtractedEndpointData $endpointData) => $endpointData->forSerialisation()->toArray()
)->values()->all(),
];
})->values()->all();
}
Expand Down
7 changes: 3 additions & 4 deletions resources/views/components/body-parameters.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
@if($name === '[]')
<p>
Body: <code>{{ $parameter['type'] }}</code> {!! Parsedown::instance()->text($parameter['description'] ?? '') !!}
@foreach($parameter['__fields'] as $subfieldName => $subfield)
</p>
@foreach($parameter['__fields'] as $subfieldName => $subfield)
@if(!empty($subfield['__fields']))
@component('scribe::components.body-parameters', ['parameters' => [$subfieldName => $subfield], 'endpointId' => $endpointId,])
@endcomponent
Expand All @@ -22,11 +23,10 @@
</p>
@endif
@endforeach
</p>
@elseif(!empty($parameter['__fields']))
<p>
<details>
<summary>
<summary style="padding-bottom: 10px;">
@component('scribe::components.field-details', [
'name' => $parameter['name'],
'type' => $parameter['type'] ?? 'string',
Expand All @@ -38,7 +38,6 @@
])
@endcomponent
</summary>
<br>
@foreach($parameter['__fields'] as $subfieldName => $subfield)
@if(!empty($subfield['__fields']))
@component('scribe::components.body-parameters', ['parameters' => [$subfieldName => $subfield], 'endpointId' => $endpointId,])
Expand Down
5 changes: 3 additions & 2 deletions resources/views/partials/example-requests/bash.md.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@endforeach
@endforeach
@elseif(count($endpoint->cleanBodyParameters))
--data "{!! addslashes(json_encode($endpoint->cleanBodyParameters, JSON_UNESCAPED_UNICODE)) !!}"
--data "{!! addslashes(json_encode($endpoint->cleanBodyParameters, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)) !!}"
@endif
```

```
2 changes: 1 addition & 1 deletion resources/views/themes/default/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

</head>

<body class="" data-languages="{{ json_encode($metadata['example_languages'] ?? []) }}">
<body data-languages="{{ json_encode($metadata['example_languages'] ?? []) }}">
<a href="#" id="nav-button">
<span>
MENU
Expand Down
1 change: 0 additions & 1 deletion src/Extracting/ApiDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function writeMarkdownFiles(): void
ConsoleOutputUtils::info('Extracted intro and auth Markdown files to: ' . $this->markdownOutputPath);
}


public function writeIntroMarkdownFile(): void
{
$introMarkdownFile = $this->markdownOutputPath . '/intro.md';
Expand Down
5 changes: 3 additions & 2 deletions src/Writing/HtmlWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ protected function transformMarkdownFileToHTML(string $markdownFilePath): string

protected function getMetadata(): array
{
// NB:These paths are wrong for laravel type but will be set correctly by the Writer class
$links = [];

// NB:These paths are wrong for laravel type but will be set correctly by the Writer class
if ($this->config->get('postman.enabled', true)) {
$links[] = '<a href="../docs/collection.json">View Postman collection</a>';
}
Expand All @@ -120,7 +121,7 @@ protected function getMetadata(): array
'last_updated' => date("F j Y"),
'auth' => $auth,
'try_it_out' => $this->config->get('try_it_out'),
'links' => $links + ['<a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a>'],
'links' => array_merge($links, ['<a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a>']),
];
}
}

0 comments on commit d79be99

Please sign in to comment.