File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/webui/quarto-preview/src Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,13 @@ export interface Options {
2323 isPresentation : boolean ;
2424}
2525
26+ // Store the current options
27+ let currentOptions : Options | null = null ;
28+
2629function init ( options : Options ) {
30+ // Store the options for export
31+ currentOptions = options ;
32+
2733 try {
2834 // detect dark mode
2935 const darkMode = detectDarkMode ( ) ;
@@ -51,6 +57,13 @@ function init(options: Options) {
5157 } else {
5258 handleViewerMessages ( options . inputFile ) ;
5359 }
60+
61+ // Dispatch event when initialized
62+ const event = new CustomEvent ( "quarto-preview-initialized" , {
63+ detail : options ,
64+ } ) ;
65+
66+ document . dispatchEvent ( event ) ;
5467 } catch ( error ) {
5568 console . error ( error ) ;
5669 }
@@ -65,4 +78,9 @@ function detectDarkMode() {
6578 }
6679}
6780
68- export { init } ;
81+ // Export the current options
82+ function getOptions ( ) {
83+ return currentOptions ;
84+ }
85+
86+ export { init , getOptions } ;
You can’t perform that action at this time.
0 commit comments