PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / blocks / code-snippet-tab / src / index.js

index.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/blocks/code-snippet-tab/src/index.js

38 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { registerBlockType } from '@wordpress/blocks';
3
4 import './style.scss';
5 import Edit from './edit';
6 import attributes from './attributes';
7 import icon from './icon';
8
9 registerBlockType('betterdocs/code-snippet-tab', {
10 title: __('BetterDocs Code Snippet Tab', 'betterdocs'),
11 description: __('Show HTTP responses as status-code tabs (200, 404, …), each with a copyable code example.', 'betterdocs'),
12 category: 'betterdocs',
13 icon: icon,
14 keywords: [
15 __('response', 'betterdocs'),
16 __('api', 'betterdocs'),
17 __('http', 'betterdocs'),
18 __('status', 'betterdocs'),
19 __('betterdocs', 'betterdocs'),
20 ],
21 supports: {
22 align: ['wide', 'full'],
23 html: false,
24 },
25 example: {
26 attributes: {
27 responses: [
28 { status: '200', language: 'json', codeContent: '{\n "success": true,\n "data": {}\n}' },
29 { status: '404', language: 'json', codeContent: '{\n "success": false,\n "message": "Not found"\n}' },
30 ],
31 theme: 'light',
32 },
33 },
34 attributes,
35 edit: Edit,
36 save: () => null, // Dynamic block
37 });
38