1- < details class ="group relative z-50 inline-block ">
2- < summary
3- class ="inline-flex cursor-pointer items-center gap-2 rounded border border-gray-light-200 bg-gray-light-200 px-4 py-2 text-base font-semibold text-black transition-colors hover:bg-gray-light-300 dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white dark:hover:bg-gray-dark-400 "
4- >
5- < span > Copy page</ span >
6- < svg
7- class ="h-2 w-2 transform transition-transform group-open:rotate-180 "
8- xmlns ="http://www.w3.org/2000/svg "
9- fill ="none "
10- viewBox ="0 0 24 24 "
11- stroke ="currentColor "
1+ < details class ="group relative z-50 inline-block " data-heap-id ="markdown-dropdown ">
2+ < summary
3+ class ="inline-flex cursor-pointer items-center gap-2 rounded border border-gray-light-200 bg-gray-light-200 px-4 py-2 text-base font-semibold text-black transition-colors hover:bg-gray-light-300 dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white dark:hover:bg-gray-dark-400 "
4+ data-heap-id ="markdown-dropdown-toggle "
125 >
13- < path
14- stroke-linecap ="round "
15- stroke-linejoin ="round "
16- stroke-width ="2 "
17- d ="M19 9l-7 7-7-7 "
18- />
19- </ svg >
20- </ summary >
6+ < span > Copy page</ span >
7+ < svg
8+ class ="h-2 w-2 transform transition-transform group-open:rotate-180 "
9+ xmlns ="http://www.w3.org/2000/svg "
10+ fill ="none "
11+ viewBox ="0 0 24 24 "
12+ stroke ="currentColor "
13+ >
14+ < path stroke-linecap ="round " stroke-linejoin ="round " stroke-width ="2 " d ="M19 9l-7 7-7-7 " />
15+ </ svg >
16+ </ summary >
2117
22- <!-- Dropdown menu -->
23- < div
24- class ="absolute right-0 z-50 mt-2 w-56 origin-top-right rounded border border-gray-light-200 bg-gray-light-200 p-2 text-sm text-black shadow-md [display:none] group-open:[display:block] dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white "
25- >
26- < button
27- onclick ="copyMarkdown() "
28- class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
18+ <!-- Dropdown menu -->
19+ < div
20+ class ="absolute right-0 z-50 mt-2 w-56 origin-top-right rounded border border-gray-light-200 bg-gray-light-200 p-2 text-sm text-black shadow-md [display:none] group-open:[display:block] dark:border-gray-dark-200 dark:bg-gray-dark-300 dark:text-white "
21+ data-heap-id ="markdown-dropdown-menu "
2922 >
30- < span class ="icon-svg mt-[2px] text-base leading-none ">
31- {{ partial "icon" "content_copy" }}
32- </ span >
33- < div class ="leading-tight ">
34- < div class ="text-base font-bold "> Copy page</ div >
35- < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
36- Copy this page as Markdown for LLMs
23+ < button
24+ onclick ="copyMarkdown() "
25+ data-heap-id ="copy-markdown-button "
26+ class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
27+ >
28+ < span class ="icon-svg mt-[2px] text-base leading-none ">
29+ {{ partial "icon" "content_copy" }}
30+ </ span >
31+ < div class ="leading-tight ">
32+ < div class ="text-base font-bold "> Copy page</ div >
33+ < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
34+ Copy this page as Markdown for LLMs
35+ </ div >
3736 </ div >
38- </ div >
39- </ button >
37+ </ button >
4038
41- < button
42- onclick ="viewPlainText() "
43- class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
44- >
45- < span class ="icon-svg mt-[2px] text-base leading-none ">
46- {{ partial "icon" "description" }}
47- </ span >
48- < div class ="leading-tight ">
49- < div class ="text-base font-bold "> View as Markdown</ div >
50- < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
51- View this page as plain text
39+ < button
40+ onclick ="viewPlainText() "
41+ data-heap-id ="view-markdown-button "
42+ class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
43+ >
44+ < span class ="icon-svg mt-[2px] text-base leading-none ">
45+ {{ partial "icon" "description" }}
46+ </ span >
47+ < div class ="leading-tight ">
48+ < div class ="text-base font-bold "> View as Markdown</ div >
49+ < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
50+ View this page as plain text
51+ </ div >
5252 </ div >
53- </ div >
54- </ button >
53+ </ button >
5554
56- < button
57- onclick ="openInDocsAI() "
58- class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
59- >
60- < span class ="icon-svg mt-[2px] text-base leading-none ">
61- {{ partial "icon" "search" }}
62- </ span >
63- < div class ="leading-tight ">
64- < div class ="text-base font-bold "> Search Docs AI</ div >
65- < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
66- Ask questions with Docs AI
55+ < button
56+ onclick ="openInDocsAI() "
57+ data-heap-id ="search-docs-ai-button "
58+ class ="flex w-full items-start gap-2 rounded px-2 py-2 text-left transition-colors hover:bg-gray-light-300 dark:hover:bg-gray-dark-400 "
59+ >
60+ < span class ="icon-svg mt-[2px] text-base leading-none ">
61+ {{ partial "icon" "search" }}
62+ </ span >
63+ < div class ="leading-tight ">
64+ < div class ="text-base font-bold "> Search Docs AI</ div >
65+ < div class ="text-sm text-gray-light-500 dark:text-gray-dark-500 ">
66+ Ask questions with Docs AI
67+ </ div >
6768 </ div >
68- </ div >
69- </ button >
70- </ div >
71- </ details >
72-
73- < script >
74- function getCurrentPlaintextUrl ( ) {
75- const url = window . location . href . split ( "#" ) [ 0 ] . replace ( / \/ $ / , "" ) ;
76- return `${ url } /index.md` ;
77- }
78-
79- function copyMarkdown ( ) {
80- fetch ( getCurrentPlaintextUrl ( ) )
81- . then ( ( response ) => response . text ( ) )
82- . then ( ( text ) => {
83- navigator . clipboard
84- . writeText ( text )
85- . then ( ( ) => alert ( "Markdown copied to clipboard!" ) )
86- . catch ( ( err ) => alert ( "Failed to copy markdown: " + err ) ) ;
87- } )
88- . catch ( ( err ) => alert ( "Error fetching markdown: " + err ) ) ;
89- }
90-
91- function viewPlainText ( ) {
92- window . open ( getCurrentPlaintextUrl ( ) , "_blank" ) ;
93- }
94-
95- function openInDocsAI ( ) {
96- const kapaButton = document . querySelector ( ".open-kapa-widget" ) ;
97- if ( kapaButton ) {
98- kapaButton . click ( ) ;
99- } else {
100- alert ( "Couldn't find Docs AI." ) ;
101- }
102- }
103- </ script >
69+ </ button >
70+ </ div >
71+ </ details >
0 commit comments