@michaelmishin/speclens 0.3.0 → 0.4.0
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.
- package/README.md +12 -4
- package/dist/speclens.iife.js +208 -46
- package/dist/speclens.iife.js.map +1 -1
- package/dist/speclens.js +392 -45
- package/dist/speclens.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A modern, lightweight OpenAPI documentation renderer built as a web component. Drop it into any page via CDN — no build step required.
|
|
4
4
|
|
|
5
|
-
> **Version:** 0.
|
|
5
|
+
> **Version:** 0.4.0
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -10,9 +10,9 @@ A modern, lightweight OpenAPI documentation renderer built as a web component. D
|
|
|
10
10
|
- **Web component** — `<spec-lens>` custom element with Shadow DOM style isolation
|
|
11
11
|
- **Try It console** — live API request execution with support for JSON, `multipart/form-data`, and `application/x-www-form-urlencoded` bodies
|
|
12
12
|
- **Code samples** — generated snippets for cURL, JavaScript, Python, Node.js, Go, Java, PHP, Ruby, and C#
|
|
13
|
-
- **Full-text search** — fast in-page search powered by MiniSearch,
|
|
13
|
+
- **Full-text search** — fast in-page search powered by MiniSearch with keyword suggestions, scope filtering (All / API Reference / Guides), and fuzzy matching
|
|
14
14
|
- **Guides** — built-in documentation tab with category sidebar; load guides from an external JSON manifest or inline via config
|
|
15
|
-
- **Ask AI** — one-click buttons on every operation to open a structured prompt in ChatGPT or Claude
|
|
15
|
+
- **Ask AI** — one-click buttons on every operation to open a structured prompt in ChatGPT or Claude, or copy the prompt to use with any AI agent
|
|
16
16
|
- **Copy route** — hover a route header to copy its deeplink hash to the clipboard
|
|
17
17
|
- **Light & dark themes** — auto-detects system preference, overridable via CSS custom properties
|
|
18
18
|
- **OpenAPI 3.x support** — parsed and validated by `@apidevtools/swagger-parser`
|
|
@@ -94,9 +94,17 @@ SpecLens.init('#docs', {
|
|
|
94
94
|
|
|
95
95
|
Inline guides and an external manifest can be combined — inline guides override on slug collision.
|
|
96
96
|
|
|
97
|
+
## Search
|
|
98
|
+
|
|
99
|
+
The global search (triggered by the search icon or `Ctrl/Cmd+K`) indexes both API operations and guides. It supports:
|
|
100
|
+
|
|
101
|
+
- **Fuzzy matching** — typos and partial words still find results
|
|
102
|
+
- **Keyword suggestions** — common terms extracted from the spec and guides are shown as clickable chips before you start typing
|
|
103
|
+
- **Scope filtering** — when guides are configured, filter results by **All**, **API Reference**, or **Guides**
|
|
104
|
+
|
|
97
105
|
## Ask AI
|
|
98
106
|
|
|
99
|
-
Every operation header includes an **Ask AI** button that generates a structured Markdown prompt describing the endpoint (method, path, parameters, request body, responses) and opens it in ChatGPT or Claude.
|
|
107
|
+
Every operation header includes an **Ask AI** button that generates a structured Markdown prompt describing the endpoint (method, path, parameters, request body, responses) and opens it in ChatGPT or Claude. A **Copy Prompt** option is also available for pasting into any AI tool of your choice.
|
|
100
108
|
|
|
101
109
|
To hide the button, add the `hide-ask-ai` attribute:
|
|
102
110
|
|