Skip to content

Commit 391cf2b

Browse files
committed
📖 docs: revamp README with enhanced layout, new sections, and clearer descriptions for better user engagement
1 parent 6af34d2 commit 391cf2b

File tree

2 files changed

+37
-20
lines changed

2 files changed

+37
-20
lines changed

README.md

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
1-
# `@bedtime-coders/elysia-openapi`
2-
3-
[![npm][npm-version-src]][npm-version-href]
4-
[![Bundlephobia][bundle-src]][bundle-href]
5-
[![Elysia][elysia-src]][elysia-href]
6-
<!-- These 2 were not working when I tested. Enable them if it works -->
7-
<!-- [![License][license-src]][license-href]
8-
[![Stars][github-stars-src]][github-stars-href] -->
9-
10-
A plugin for [ElysiaJS](https://github.com/elysiajs/elysia) to auto-generate an [OpenAPI](https://github.com/OAI/OpenAPI-Specification) reference page.
11-
12-
## Installation
1+
<div align="center">
2+
<img src="./public/header.png" alt="header" width="100%" />
3+
<a href="https://npmjs.com/package/@bedtime-coders/elysia-openapi">
4+
<img src="https://img.shields.io/npm/v/@bedtime-coders/elysia-openapi.svg?style=flat-square" alt="npm version" />
5+
</a>
6+
<a href="https://bundlephobia.com/package/@bedtime-coders/elysia-openapi">
7+
<img src="https://img.shields.io/bundlephobia/minzip/@bedtime-coders/elysia-openapi.svg?style=flat-square" alt="bundlephobia" />
8+
</a>
9+
<a href="https://elysiajs.com/">
10+
<img src="https://img.shields.io/badge/%F0%9F%A6%8A-f6f8fa?label=elysia&color=blue" alt="elysia" />
11+
</a>
12+
</div>
13+
14+
<h1 align="center">
15+
@bedtime-coders/elysia-openapi
16+
</h1>
17+
18+
Use this plugin to expose a beautiful [OpenAPI](https://github.com/OAI/OpenAPI-Specification) reference page from your ElysiaJS application with zero configuration. Just add the plugin to your Elysia app and you're good to go!
19+
20+
👉 **Why use this over `@elysiajs/swagger`?** This is a fork of `@elysiajs/swagger` with updated dependencies and a few opinionated changes to the defaults. If [@elysiajs/swagger](https://github.com/elysiajs/elysia-swagger) suits your needs (and you don't need the latest version of [Scalar API Reference](https://github.com/scalar/scalar/tree/main/packages/api-reference)), then by all means, use that instead.
21+
22+
## Add it to your Elysia app
1323
```bash
1424
bun add @bedtime-coders/elysia-openapi
1525
```
1626

17-
## Example
27+
## Try it out
1828
```typescript
1929
import { Elysia, t } from 'elysia'
2030
import { openapi } from '@bedtime-coders/elysia-openapi'
@@ -53,30 +63,34 @@ const app = new Elysia()
5363

5464
Visit `http://localhost:8080/docs` to see the generated OpenAPI reference page ✨
5565

56-
# `config`
66+
## Give us a ⭐️
5767

58-
## `provider`
68+
Hey! If you like this plugin, please give us a ⭐️ on GitHub so more people can find it. Thank you!
69+
70+
## Configuration for nerds
71+
72+
### `provider`
5973
`@default 'scalar'`
6074

6175
Choose between [Scalar API Reference](https://github.com/scalar/scalar) & [Swagger UI](https://github.com/swagger-api/swagger-ui)
6276

63-
## `scalar`
77+
### `scalar`
6478
Customize `scalarConfig`, refers to [Scalar config](https://github.com/scalar/scalar/blob/main/documentation/configuration.md)
6579

66-
## `swagger`
80+
### `swagger`
6781
Customize Swagger config, refers to [Swagger 3.0.3 config](https://swagger.io/specification/v3)
6882

69-
## `path`
83+
### `path`
7084
`@default '/docs'`
7185

7286
The endpoint to expose Swagger UI
7387

74-
## `excludeStaticFile`
88+
### `excludeStaticFile`
7589
`@default true`
7690

7791
Determine if Swagger should exclude static files.
7892

79-
## `exclude`
93+
### `exclude`
8094
`@default []`
8195

8296
Paths to exclude from the Swagger endpoint
@@ -93,3 +107,6 @@ Paths to exclude from the Swagger endpoint
93107
[npm-version-href]: https://npmjs.com/package/@bedtime-coders/elysia-openapi
94108
[github-stars-src]: https://img.shields.io/github/stars/bedtime-coders/elysia-openapi?color=blue
95109
[github-stars-href]: https://github.com/bedtime-coders/elysia-openapi/stargazers
110+
111+
<!-- Public assets -->
112+
[header-src]: ./public/header.png

public/header.png

180 KB
Loading

0 commit comments

Comments
 (0)