跳到主内容 / Skip to content
Materin

首页Home / 内容Content / Materin View

Materin View v0.2.1

读取 OpenAPI / Swagger 规范并渲染为 knife4j 风格文档视图 —— 同时支持浏览与调试(发送真实请求)。

An Obsidian plugin that reads OpenAPI / Swagger specifications and renders them as a knife4j-style documentation view — with both browsing and debugging (send real requests).

与系列共用同一套 UI 规范:Materin UIShares one UI spec with the series: Materin UI

概览

把 OpenAPI / Swagger 规范放进 vault,Materin View 就能在 Obsidian 内渲染出接近 knife4j 的接口文档:左侧标签树与端点列表,右侧参数表、请求体与响应 schema;需要验证接口时切到「调试」标签,直接发请求、看响应。

请求经 Obsidian 的 requestUrl 发出,因此不受浏览器 CORS 限制。

特性

  • 多文档来源:添加 vault 内的规范文件(.json / .yaml / .yml)或远程 URL,每个来源渲染为一个独立可折叠的文档菜单;
  • Markdown 内嵌规范:笔记中围栏代码块里的 OpenAPI JSON / YAML 会被提取并渲染;
  • 工作区扫描:按内容(而非文件名)识别 vault 中的 OpenAPI 文件,一键添加;
  • 右键菜单 / 命令:右键规范文件 →「Open with Materin View」,或通过命令面板扫描;
  • knife4j 风格文档:标签树、method 徽标、参数表、请求 / 响应 schema,支持 $ref 解析(OpenAPI 3.x components 与 Swagger 2.0 definitions);
  • 调试面板:每个文档可编辑 base URL,按规范生成参数表单、请求头、JSON body —— 在 Obsidian 内发请求并查看状态 / 响应头 / 响应体;
  • 变量:URL / 请求头 / body 中支持 {{key}} 替换,分全局与按文档两级作用域(文档级优先)。

安装

  1. 从 Release 页下载 main.js、manifest.json、styles.css;
  2. 放入 <vault>/.obsidian/plugins/materin-view/;
  3. 在 Obsidian 社区插件设置中启用 Materin View。

使用

  1. 通过 ribbon 图标(地球)或命令「打开 OpenAPI 视图」打开面板;
  2. 用「+ 添加文档」添加(手动输入路径 / URL,或工作区扫描),也可在文件浏览器中右键规范文件;
  3. 左侧选择端点:「文档」标签看规范,「调试」标签发请求。

开发

npm install
npm run dev     # watch 构建
npm run build   # 类型检查 + 生产构建 -> main.js
npm test        # 单元测试(vitest)

许可

MIT。

内容来源

本页同步自仓库 README(leapord/Materin-view,最后提交 2026-08-30,版本 0.2.1)。以源码仓库为准。

Overview

Drop an OpenAPI / Swagger specification into your vault and Materin View renders a knife4j-style API document inside Obsidian: a tag tree and endpoint list on the left, parameter tables, request bodies and response schemas on the right. Switch to the debug tab to fire real requests and inspect responses.

Requests go out through Obsidian's requestUrl, so there are no CORS issues.

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 the command palette;
  • knife4j-style docs: tag tree, method badges, parameter 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 and inspect status / headers / body;
  • Variables: {{key}} substitution in URL / headers / body with global and per-document scopes (document scope wins).

Install

  1. Download main.js, manifest.json and styles.css from the releases page;
  2. Put them into <vault>/.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 the "打开 OpenAPI 视图" command;
  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 — the "文档" tab shows the spec, the "调试" tab sends requests.

Development

npm install
npm run dev     # watch build
npm run build   # type-check + production build -> main.js
npm test        # unit tests (vitest)

License

MIT.

Source

This page is synced from the repository README (leapord/Materin-view, last commit 2026-08-30, version 0.2.1). The source repository is authoritative.