File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 6868 </ div >
6969 </ button >
7070 </ div >
71- </ details >
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 >
You can’t perform that action at this time.
0 commit comments