Skip to content

Commit

Permalink
Change documentation viewer order
Browse files Browse the repository at this point in the history
  • Loading branch information
arifszn committed Sep 1, 2022
1 parent ae405b7 commit bccf352
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

- [Dockerized](https://arifszn.github.io/pandora/docs/installation#with-docker-sail)
- [OpenAPI Specification](https://arifszn.github.io/pandora/docs/features/openapi-specification)
- [Swagger UI](https://arifszn.github.io/pandora/docs/api-documentation/swagger-ui)
- [Redoc](https://arifszn.github.io/pandora/docs/api-documentation/redoc)
- [Swagger UI](https://arifszn.github.io/pandora/docs/api-documentation/swagger-ui)
- [Service Repository Pattern](https://arifszn.github.io/pandora/docs/features/service-repository-pattern)
- [API Resource](https://arifszn.github.io/pandora/docs/features/api-resource)
- [Code Style & Lint](https://arifszn.github.io/pandora/docs/features/code-style-and-lint)
Expand Down
3 changes: 1 addition & 2 deletions resources/views/openapi-spec/redoc.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="SwaggerUI" />
<meta name="description" content="{{Config::get('app.name')}} - Documentation" />
<title>{{Config::get('app.name')}} - Documentation</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/swagger-ui.css" />
<link rel="icon" href={{asset('favicon.ico')}} />
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
</head>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/openapi-spec/swagger.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="SwaggerUI" />
<meta name="description" content="{{Config::get('app.name')}} - Documentation" />
<title>{{Config::get('app.name')}} - Documentation</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/swagger-ui.css" />
<link rel="icon" href={{asset('favicon.ico')}} />
Expand Down
12 changes: 6 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
});
}

if (Config::get('pandora.api_doc.display_swagger_ui')) {
Route::get('/swagger-ui', function () {
return view('openapi-spec.swagger');
});
}

if (Config::get('pandora.api_doc.display_redoc')) {
Route::get('/redoc', function () {
return view('openapi-spec.redoc');
});
}

if (Config::get('pandora.api_doc.display_swagger_ui')) {
Route::get('/swagger-ui', function () {
return view('openapi-spec.swagger');
});
}
2 changes: 1 addition & 1 deletion website/docs/1-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ hide_title: true

- [Dockerized](/docs/installation#with-docker-sail)
- [OpenAPI Specification](/docs/features/openapi-specification)
- [Swagger UI](/docs/api-documentation/swagger-ui)
- [Redoc](/docs/api-documentation/redoc)
- [Swagger UI](/docs/api-documentation/swagger-ui)
- [Service Repository Pattern](/docs/features/service-repository-pattern)
- [API Resource](/docs/features/api-resource)
- [Code Style & Lint](/docs/features/code-style-and-lint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ hide_table_of_contents: true

import ApiDocMdx from '@theme/ApiDocMdx';

<ApiDocMdx id="redoc-nested" />
<div class="card">
<div class="card__body">
<ApiDocMdx id="redoc-nested" />
</div>
</div>
10 changes: 0 additions & 10 deletions website/docs/3-api-documentation/1-swagger-ui.md

This file was deleted.

14 changes: 14 additions & 0 deletions website/docs/3-api-documentation/2-swagger-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Swagger UI
hide_title: true
hide_table_of_contents: true
---

import SwaggerUI from "swagger-ui-react";
import "../../src/css/swagger-ui.css";

<div class="card">
<div class="card__body">
<SwaggerUI url="https://raw.githubusercontent.com/arifszn/pandora/main/public/openapi.yaml" persistAuthorization={true} displayOperationId={true} filter={true} />
</div>
</div>
2 changes: 1 addition & 1 deletion website/docs/4-features/1-openapi-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ To generate the OpenAPI Specification file, run command:
composer openapi
```

It will generate the `openapi.yaml` file in the public folder which can be viewed in the Swagger UI.
It will generate the `openapi.yaml` file in the public folder which can be viewed in the Redoc or Swagger UI.
4 changes: 0 additions & 4 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ div[class^='announcementBar_'] {
width: 24px;
}

.swagger-ui .info .title small pre {
background-color: unset;
}

html[data-theme='dark'] .header-github-link:before {
background: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23fff' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
no-repeat;
Expand Down
3 changes: 2 additions & 1 deletion website/src/css/swagger-ui.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bccf352

Please sign in to comment.