knuckleswtf / knuckleswtf/scribe

theme 'elements' doesn't display properly

Open
#779 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
2.3k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

### Scribe version

4.28.0

### PHP version

8.1

### Framework

Laravel

### Framework version

10.37.3

### Scribe config

```ruby
when running the diff command, I got the following error:

ErrorException

Array to string conversion

at vendor/knuckleswtf/scribe/src/Tools/ConfigDiffer.php:62
58▕ if (!is_array($oldValue)) {
59▕ return "changed to a list";
60▕ }
61▕
➜ 62▕ $added = array_map(fn ($v) => "$v", array_diff($value, $oldValue));
63▕ $removed = array_map(fn ($v) => "$v", array_diff($oldValue, $value));
64▕
65▕ $diff = [];
66▕ if (!empty($added)) {

+17 vendor frames

18 artisan:37
```.
I changed the following lines in `config/scribe.php`:
'type' => 'laravel',
'theme' => 'elements',
'docs_url' => '/apidocs',
'order' => [
'User Auth',
'Slips'
],
```

### What happened?

when using the 'elements' theme, the pages are generated and displayed incorrectly. but if I switched back to the 'default' the pages look fine. Please see the attached screenshots: the 1st is taken from 'elements', and the 2nd is taken from 'default'
![Snipaste_2023-12-28_11-46-36](https://github.com/knuckleswtf/scribe/assets/3521826/a26b37dc-3c2b-427d-9bc8-53cdcef1159b)

![Snipaste_2023-12-28_11-58-52](https://github.com/knuckleswtf/scribe/assets/3521826/786bbc1c-4c19-4047-ac2f-08b091e56d1a)

### Docs

- [X] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the listed Scribe, PHP, and Laravel versions and the shown config, then inspect vendor/knuckleswtf/scribe/src/Tools/ConfigDiffer.php around line 62 and the Elements theme output. Compare generated Elements pages with the default theme and verify that the diff command completes without the reported conversion error and the generated pages display correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.