@scalar/hono-api-reference 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +23 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Scalar Hono API Reference Plugin
2
2
 
3
- ![Version](https://img.shields.io/npm/v/%40scalar/hono-api-reference)
4
- ![Downloads](https://img.shields.io/npm/dm/%40scalar/hono-api-reference)
5
- ![License](https://img.shields.io/npm/l/%40scalar%2Fhono-api-reference)
3
+ [![Version](https://img.shields.io/npm/v/%40scalar/hono-api-reference)](https://www.npmjs.com/package/@scalar/hono-api-reference)
4
+ [![Downloads](https://img.shields.io/npm/dm/%40scalar/hono-api-reference)](https://www.npmjs.com/package/@scalar/hono-api-reference)
5
+ [![License](https://img.shields.io/npm/l/%40scalar%2Fhono-api-reference)](https://www.npmjs.com/package/@scalar/hono-api-reference)
6
6
  [![Discord](https://img.shields.io/discord/1135330207960678410?style=flat&color=5865F2)](https://discord.gg/8HeZcRGPFS)
7
7
 
8
8
  This middleware provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with Hono.
9
9
 
10
+ ![hono-js](https://github.com/scalar/scalar/assets/6176314/6f5a2102-e377-4d4e-9cfb-a512f5e0a9ba)
11
+
10
12
  ## Installation
11
13
 
12
14
  ```bash
@@ -32,6 +34,24 @@ app.get(
32
34
 
33
35
  The Hono middleware takes our universal configuration object, [read more about configuration](https://github.com/scalar/scalar/tree/main/packages/api-reference#props) in the core package README.
34
36
 
37
+ ### Themes
38
+
39
+ The middleware comes with a custom theme for Hono. You can use one of [the other predefined themes](https://github.com/scalar/scalar/blob/main/packages/themes/src/index.ts#L15) (`alternate`, `default`, `moon`, `purple`, `solarized`) or overwrite it with `none`. All themes come with a light and dark color scheme.
40
+
41
+ ```ts
42
+ import { apiReference } from '@scalar/hono-api-reference'
43
+
44
+ app.get(
45
+ '/reference',
46
+ apiReference({
47
+ theme: 'purple',
48
+ spec: {
49
+ url: '/swagger.json',
50
+ },
51
+ }),
52
+ )
53
+ ```
54
+
35
55
  ### Custom page title
36
56
 
37
57
  There’s one additional option to set the page title:
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@scalar/hono-api-reference",
3
3
  "description": "A middleware for using the Scalar API reference in Hono",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "dependencies": {
6
- "@scalar/api-reference": "1.0.3"
6
+ "@scalar/api-reference": "1.0.4"
7
7
  },
8
8
  "devDependencies": {
9
9
  "hono": "3.9.2",