docus 3.0.4-20250623-095727-5f8fbb3 → 3.0.4
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.
|
@@ -36,45 +36,47 @@
|
|
|
36
36
|
|
|
37
37
|
<script setup lang="ts">
|
|
38
38
|
const route = useRoute()
|
|
39
|
+
const toast = useToast()
|
|
39
40
|
const copyStatus = ref<'idle' | 'copying' | 'copied'>('idle')
|
|
40
41
|
|
|
42
|
+
const markdownLink = computed(() => `${window?.location?.origin}/raw${route.path}.md`)
|
|
43
|
+
|
|
41
44
|
const items = [
|
|
42
45
|
{
|
|
43
46
|
label: 'Copy Markdown link',
|
|
44
47
|
icon: 'i-lucide-link',
|
|
45
48
|
onSelect() {
|
|
46
|
-
copyToClipboard(
|
|
49
|
+
copyToClipboard(markdownLink.value)
|
|
50
|
+
toast.add({
|
|
51
|
+
title: 'Markdown link copied to clipboard',
|
|
52
|
+
icon: 'i-lucide-check-circle',
|
|
53
|
+
color: 'success',
|
|
54
|
+
})
|
|
47
55
|
},
|
|
48
56
|
},
|
|
49
57
|
{
|
|
50
58
|
label: 'View as Markdown',
|
|
51
59
|
icon: 'i-simple-icons:markdown',
|
|
52
60
|
target: '_blank',
|
|
53
|
-
|
|
54
|
-
window.open(`${window.location.origin}/raw${route.path}.md`, '_blank')
|
|
55
|
-
},
|
|
61
|
+
to: markdownLink.value,
|
|
56
62
|
},
|
|
57
63
|
{
|
|
58
64
|
label: 'Open in ChatGPT',
|
|
59
65
|
icon: 'i-simple-icons:openai',
|
|
60
66
|
target: '_blank',
|
|
61
|
-
|
|
62
|
-
window.open(`https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${window.location.origin}/raw${route.path}.md so I can ask questions about it.`)}`, '_blank')
|
|
63
|
-
},
|
|
67
|
+
to: `https://chatgpt.com/?hints=search&q=${encodeURIComponent(`Read ${markdownLink.value} so I can ask questions about it.`)}`,
|
|
64
68
|
},
|
|
65
69
|
{
|
|
66
70
|
label: 'Open in Claude',
|
|
67
71
|
icon: 'i-simple-icons:anthropic',
|
|
68
72
|
target: '_blank',
|
|
69
|
-
|
|
70
|
-
window.open(`https://claude.ai/new?q=${encodeURIComponent(`Read ${window.location.origin}/raw${route.path}.md so I can ask questions about it.`)}`, '_blank')
|
|
71
|
-
},
|
|
73
|
+
to: `https://claude.ai/new?q=${encodeURIComponent(`Read ${markdownLink.value} so I can ask questions about it.`)}`,
|
|
72
74
|
},
|
|
73
75
|
]
|
|
74
76
|
|
|
75
77
|
async function copyPage() {
|
|
76
78
|
copyStatus.value = 'copying'
|
|
77
|
-
const markdown = await $fetch<string>(
|
|
79
|
+
const markdown = await $fetch<string>(markdownLink.value)
|
|
78
80
|
copyToClipboard(markdown)
|
|
79
81
|
copyStatus.value = 'copied'
|
|
80
82
|
setTimeout(() => {
|