opencode-mermaid-renderer 0.0.2 → 0.0.3

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/index.ts +2 -17
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -10,10 +10,6 @@ const MERMAID_BLOCK_REGEX = /```mermaid\n([\s\S]*?)```/g
10
10
  /**
11
11
  * OpenCode plugin that renders mermaid diagrams as ASCII art
12
12
  *
13
- * Features:
14
- * - Renders diagrams inline as ASCII art (shown by default)
15
- * - Preserves original mermaid source in expandable <details> section
16
- *
17
13
  * Supported diagram types:
18
14
  * - Flowcharts (graph TD/LR/BT/RL)
19
15
  * - State diagrams (stateDiagram-v2)
@@ -53,25 +49,14 @@ function renderMermaidBlocks(text: string): string {
53
49
 
54
50
  /**
55
51
  * Render a single mermaid diagram to ASCII
56
- * Shows rendered diagram by default with expandable source code
57
52
  * On error, returns the original code block with an error comment
58
53
  */
59
54
  function renderSingleBlock(mermaidCode: string): string {
60
55
  try {
61
56
  const ascii = renderMermaidAscii(mermaidCode)
62
57
 
63
- // Show rendered diagram with expandable source code section
64
- return (
65
- "```\n" +
66
- ascii +
67
- "\n```\n\n" +
68
- "<details>\n" +
69
- "<summary>View Mermaid Source</summary>\n\n" +
70
- "```mermaid\n" +
71
- mermaidCode +
72
- "\n```\n\n" +
73
- "</details>"
74
- )
58
+ // Wrap in a code block for proper formatting
59
+ return "```\n" + ascii + "\n```"
75
60
  } catch (error) {
76
61
  // Keep original mermaid block and add error as comment
77
62
  const errorMessage = (error as Error).message || "Unknown error"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-mermaid-renderer",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Render mermaid diagrams as beautiful ASCII art in OpenCode",
5
5
  "keywords": [
6
6
  "opencode",