knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.58k stars 280 forks source link

Suggestion: Add allow-try to the rapidoc.blade.php #777

Closed rabol closed 6 months ago

rabol commented 6 months ago

Scribe version

4.28.0

Your question

Super cool to see the 'external' configuration option

Rapidoc allow one to disable the 'Try' and it could be done like this:

<!doctype html> <!-- Important: must specify -->
<html>
<head>
    <meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
    <script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
</head>
<body>

<rapi-doc spec-url="{!! $metadata['openapi_spec_url'] !!}"
          render-style="read"
          allow-try="{!! $metadata['try_it_out']['enabled'] == true ? 'true' : 'false'!!}"
> </rapi-doc>
</body>
</html>

I know that I can publish the views and do the change myself, but then I have to publish all resources and that seems a little overkill to add a singe thing especially when the 'Try' is a config value

Docs

shalvah commented 6 months ago

Oh, cool. I'm sure there's ways to configure the external renderers , but I didn't have time to look into that. Could you send a PR for that?

shalvah commented 6 months ago

Fixed in 4.29.0. Also, you can now specify custom HTML attributes: https://scribe.knuckles.wtf/laravel/reference/config#external