@docsector/docsector-reader 0.9.0 → 0.9.1
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/bin/docsector.js +1 -1
- package/package.json +1 -1
- package/src/components/DPageBar.vue +78 -0
- package/src/i18n/helpers.js +14 -2
package/bin/docsector.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docsector/docsector-reader",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "A documentation rendering engine built with Vue 3, Quasar v2 and Vite. Transform Markdown into beautiful, navigable documentation sites.",
|
|
5
5
|
"productName": "Docsector Reader",
|
|
6
6
|
"author": "Rodrigo de Araujo Vieira",
|
|
@@ -92,13 +92,52 @@ const MCP_PATHS = [
|
|
|
92
92
|
'M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z',
|
|
93
93
|
'M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z'
|
|
94
94
|
]
|
|
95
|
+
const VSCODE_PATH = 'M70.9119 99.3171C72.4869 99.9307 74.2828 99.8914 75.8725 99.1264L96.4608 89.2197C98.6242 88.1787 100 85.9892 100 83.5872V16.4133C100 14.0113 98.6243 11.8218 96.4609 10.7808L75.8725 0.873756C73.7862 -0.130129 71.3446 0.11576 69.5135 1.44695C69.252 1.63711 69.0028 1.84943 68.769 2.08341L29.3551 38.0415L12.1872 25.0096C10.589 23.7965 8.35363 23.8959 6.86933 25.2461L1.36303 30.2549C-0.452552 31.9064 -0.454633 34.7627 1.35853 36.417L16.2471 50.0001L1.35853 63.5832C-0.454633 65.2374 -0.452552 68.0938 1.36303 69.7453L6.86933 74.7541C8.35363 76.1043 10.589 76.2037 12.1872 74.9905L29.3551 61.9587L68.769 97.9167C69.3925 98.5406 70.1246 99.0104 70.9119 99.3171ZM75.0152 27.2989L45.1091 50.0001L75.0152 72.7012V27.2989Z'
|
|
96
|
+
const CODEX_PATH = 'M15.672 11.249a.75.75 0 00-.006-1.5 3.504 3.504 0 01-3.26-2.26.75.75 0 00-1.392 0 3.504 3.504 0 01-3.26 2.26.75.75 0 000 1.5 3.504 3.504 0 013.258 2.252.75.75 0 001.396-.004A3.504 3.504 0 0115.672 11.249zM21.665 7.317a.75.75 0 000-1.5 5.253 5.253 0 01-4.887-3.386.75.75 0 00-1.392 0A5.253 5.253 0 0110.5 5.817a.75.75 0 000 1.5 5.253 5.253 0 014.886 3.386.75.75 0 001.392 0 5.253 5.253 0 014.887-3.386z'
|
|
97
|
+
|
|
95
98
|
const mcpIcon = computed(() => buildIconURI(MCP_PATHS, 'evenodd'))
|
|
96
99
|
|
|
100
|
+
function buildVSCodeIconURI () {
|
|
101
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill-rule="evenodd" clip-rule="evenodd" d="${VSCODE_PATH}" fill="%23007ACC"/></svg>`
|
|
102
|
+
return `img:data:image/svg+xml,${svg}`
|
|
103
|
+
}
|
|
104
|
+
const vscodeIcon = computed(() => buildVSCodeIconURI())
|
|
105
|
+
const codexIcon = computed(() => buildIconURI(CODEX_PATH))
|
|
106
|
+
|
|
97
107
|
const mcpURL = computed(() => {
|
|
98
108
|
if (!docsectorConfig.mcp) return null
|
|
99
109
|
return `${window.location.origin}/mcp`
|
|
100
110
|
})
|
|
101
111
|
|
|
112
|
+
const vscodeMcpURL = computed(() => {
|
|
113
|
+
if (!docsectorConfig.mcp) return null
|
|
114
|
+
const name = docsectorConfig.mcp.serverName
|
|
115
|
+
const url = `${window.location.origin}/mcp`
|
|
116
|
+
return `vscode:mcp/install?${encodeURIComponent(JSON.stringify({ name, url }))}`
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const claudeCodeCommand = computed(() => {
|
|
120
|
+
if (!docsectorConfig.mcp) return null
|
|
121
|
+
const name = docsectorConfig.mcp.serverName
|
|
122
|
+
const url = `${window.location.origin}/mcp`
|
|
123
|
+
return `claude mcp add ${name} --scope user --transport http ${url}`
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const codexCommand = computed(() => {
|
|
127
|
+
if (!docsectorConfig.mcp) return null
|
|
128
|
+
const name = docsectorConfig.mcp.serverName
|
|
129
|
+
const url = `${window.location.origin}/mcp`
|
|
130
|
+
return `codex mcp add ${name} --url ${url}`
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
const copiedMcp = ref(null)
|
|
134
|
+
const copyMcpCommand = (command, type) => {
|
|
135
|
+
copyToClipboard(command).then(() => {
|
|
136
|
+
copiedMcp.value = type
|
|
137
|
+
setTimeout(() => { copiedMcp.value = null }, 2000)
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
|
|
102
141
|
const copyPage = () => {
|
|
103
142
|
if (!rawMarkdown.value) return
|
|
104
143
|
|
|
@@ -193,6 +232,45 @@ const copyPage = () => {
|
|
|
193
232
|
<q-icon name="open_in_new" size="xs" />
|
|
194
233
|
</q-item-section>
|
|
195
234
|
</q-item>
|
|
235
|
+
|
|
236
|
+
<q-item clickable v-close-popup :href="vscodeMcpURL" class="q-py-sm">
|
|
237
|
+
<q-item-section avatar>
|
|
238
|
+
<q-icon :name="vscodeIcon" size="xs" />
|
|
239
|
+
</q-item-section>
|
|
240
|
+
<q-item-section>
|
|
241
|
+
<q-item-label>{{ t('page.connectVSCode') }}</q-item-label>
|
|
242
|
+
<q-item-label caption>{{ t('page.connectVSCodeCaption') }}</q-item-label>
|
|
243
|
+
</q-item-section>
|
|
244
|
+
<q-item-section side>
|
|
245
|
+
<q-icon name="open_in_new" size="xs" />
|
|
246
|
+
</q-item-section>
|
|
247
|
+
</q-item>
|
|
248
|
+
|
|
249
|
+
<q-item clickable v-close-popup @click="copyMcpCommand(claudeCodeCommand, 'claude')" class="q-py-sm">
|
|
250
|
+
<q-item-section avatar>
|
|
251
|
+
<q-icon :name="claudeIcon" size="xs" />
|
|
252
|
+
</q-item-section>
|
|
253
|
+
<q-item-section>
|
|
254
|
+
<q-item-label>{{ copiedMcp === 'claude' ? t('page.copied') : t('page.connectClaudeCode') }}</q-item-label>
|
|
255
|
+
<q-item-label caption>{{ t('page.connectClaudeCodeCaption') }}</q-item-label>
|
|
256
|
+
</q-item-section>
|
|
257
|
+
<q-item-section side>
|
|
258
|
+
<q-icon :name="copiedMcp === 'claude' ? 'check' : 'content_copy'" size="xs" />
|
|
259
|
+
</q-item-section>
|
|
260
|
+
</q-item>
|
|
261
|
+
|
|
262
|
+
<q-item clickable v-close-popup @click="copyMcpCommand(codexCommand, 'codex')" class="q-py-sm">
|
|
263
|
+
<q-item-section avatar>
|
|
264
|
+
<q-icon :name="codexIcon" size="xs" />
|
|
265
|
+
</q-item-section>
|
|
266
|
+
<q-item-section>
|
|
267
|
+
<q-item-label>{{ copiedMcp === 'codex' ? t('page.copied') : t('page.connectCodex') }}</q-item-label>
|
|
268
|
+
<q-item-label caption>{{ t('page.connectCodexCaption') }}</q-item-label>
|
|
269
|
+
</q-item-section>
|
|
270
|
+
<q-item-section side>
|
|
271
|
+
<q-icon :name="copiedMcp === 'codex' ? 'check' : 'content_copy'" size="xs" />
|
|
272
|
+
</q-item-section>
|
|
273
|
+
</q-item>
|
|
196
274
|
</template>
|
|
197
275
|
</q-list>
|
|
198
276
|
</q-btn-dropdown>
|
package/src/i18n/helpers.js
CHANGED
|
@@ -35,7 +35,13 @@ const engineDefaults = {
|
|
|
35
35
|
openInClaude: 'Open in Claude',
|
|
36
36
|
openInClaudeCaption: 'Ask Claude about this page',
|
|
37
37
|
mcpServer: 'MCP Server',
|
|
38
|
-
mcpServerCaption: 'Connect AI assistants via MCP'
|
|
38
|
+
mcpServerCaption: 'Connect AI assistants via MCP',
|
|
39
|
+
connectVSCode: 'Connect to VSCode',
|
|
40
|
+
connectVSCodeCaption: 'Use this MCP in VSCode',
|
|
41
|
+
connectClaudeCode: 'Connect to Claude Code',
|
|
42
|
+
connectClaudeCodeCaption: 'Use this MCP in Claude Code',
|
|
43
|
+
connectCodex: 'Connect to Codex',
|
|
44
|
+
connectCodexCaption: 'Use this MCP in Codex'
|
|
39
45
|
}
|
|
40
46
|
},
|
|
41
47
|
'pt-BR': {
|
|
@@ -51,7 +57,13 @@ const engineDefaults = {
|
|
|
51
57
|
openInClaude: 'Abrir no Claude',
|
|
52
58
|
openInClaudeCaption: 'Pergunte ao Claude sobre esta página',
|
|
53
59
|
mcpServer: 'Servidor MCP',
|
|
54
|
-
mcpServerCaption: 'Conecte assistentes de IA via MCP'
|
|
60
|
+
mcpServerCaption: 'Conecte assistentes de IA via MCP',
|
|
61
|
+
connectVSCode: 'Conectar ao VSCode',
|
|
62
|
+
connectVSCodeCaption: 'Use este MCP no VSCode',
|
|
63
|
+
connectClaudeCode: 'Conectar ao Claude Code',
|
|
64
|
+
connectClaudeCodeCaption: 'Use este MCP no Claude Code',
|
|
65
|
+
connectCodex: 'Conectar ao Codex',
|
|
66
|
+
connectCodexCaption: 'Use este MCP no Codex'
|
|
55
67
|
}
|
|
56
68
|
}
|
|
57
69
|
}
|