@@ -45,6 +45,46 @@ export async function main() {
4545 const federatedMimeExtensionPromises = [ ] ;
4646 const federatedStylePromises = [ ] ;
4747
48+ const notebookLinkExtensionsString = PageConfig . getOption (
49+ "notebookLinkExtensions"
50+ ) ;
51+ if ( notebookLinkExtensionsString && notebookLinkExtensionsString . length > 0 ) {
52+ const notebookLinkExtensions = JSON . parse ( notebookLinkExtensionsString ) ;
53+ const notebookLinkExtensionPromises = [ ]
54+ const notebookLinkStylePromises = [ ] ;
55+ notebookLinkExtensions . forEach ( ( data ) => {
56+ if ( data . extension ) {
57+ notebookLinkExtensionPromises . push (
58+ createModule ( data . name , data . extension )
59+ ) ;
60+ }
61+ if ( data . style ) {
62+ notebookLinkStylePromises . push ( createModule ( data . name , data . style ) ) ;
63+ }
64+ } ) ;
65+
66+ // Add the notebook.link extensions.
67+ const notebookLinkExtensionsResult = await Promise . allSettled (
68+ notebookLinkExtensionPromises
69+ ) ;
70+ notebookLinkExtensionsResult . forEach ( ( p ) => {
71+ if ( p . status === "fulfilled" ) {
72+ for ( let plugin of activePlugins ( p . value ) ) {
73+ pluginsToRegister . push ( plugin ) ;
74+ }
75+ } else {
76+ console . error ( p . reason ) ;
77+ }
78+ } ) ;
79+
80+ // Load all notebook.link styles and log errors for any that do not
81+ ( await Promise . allSettled ( notebookLinkStylePromises ) )
82+ . filter ( ( { status } ) => status === "rejected" )
83+ . forEach ( ( { reason } ) => {
84+ console . error ( reason ) ;
85+ } ) ;
86+ }
87+
4888 // This is all the data needed to load and activate plugins. This should be
4989 // gathered by the server and put onto the initial page template.
5090 const extensions = JSON . parse (
0 commit comments