# Materin View An [Obsidian](https://obsidian.md) plugin that reads OpenAPI/Swagger specifications and renders them as a knife4j-style documentation view — with both **browsing** and **debugging** (send real requests) support. ## Features - **Multi-document sources**: add spec files from your vault (`.json` / `.yaml` / `.yml`) or remote URLs — each source renders as an independent collapsible document menu - **Markdown-embedded specs**: OpenAPI JSON/YAML inside fenced code blocks in your notes is extracted and rendered - **Workspace scan**: detect OpenAPI files across the vault by content (not filename), one click to add - **Context menu / commands**: right-click a spec file → "Open with Materin View"; or scan via command palette - **knife4j-style docs**: tag tree, method badges, parameters table, request/response schemas with `$ref` resolution (OpenAPI 3.x `components` + Swagger 2.0 `definitions`) - **Debug panel**: editable base URL per document, parameter forms generated from the spec, request headers, JSON body — send requests from inside Obsidian (via `requestUrl`, no CORS issues) and inspect status / headers / body - **Variables**: `{{key}}` substitution in URL / headers / body with **global** and **per-document** scopes (document scope wins) ## Install From this repository's [releases](https://github.com/leapord/Materin-view/releases): 1. Download `main.js`, `manifest.json`, `styles.css` 2. Put them into `/.obsidian/plugins/materin-view/` 3. Enable "Materin View" in Obsidian's community plugin settings ## Usage 1. Open the view from the ribbon icon (globe) or command "打开 OpenAPI 视图" 2. Add documents via "+ 添加文档" (manual path/URL or workspace scan), or right-click a spec file in the file explorer 3. Pick an endpoint on the left — "文档" tab for the spec, "调试" tab to send requests ## Development ```bash npm install npm run dev # watch build npm run build # type-check + production build -> main.js npm test # unit tests (vitest) ``` ## License [MIT](LICENSE)