@@ -23,9 +23,9 @@ import dotty.dokka.model.api._
2323import org .jetbrains .dokka .CoreExtensions
2424import org .jetbrains .dokka .base .DokkaBase
2525
26+ import dotty .dokka .site .NavigationCreator
2627import dotty .dokka .site .SitePagesCreator
2728import dotty .dokka .site .StaticSiteContext
28- import dotty .dokka .site .RootIndexPageCreator
2929import dotty .dokka .site .SiteResourceManager
3030import dotty .dokka .site .StaticSiteLocationProviderFactory
3131
@@ -49,7 +49,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
4949 // Just turn off another translator since multiple overrides does not work
5050 val disableDescriptorTranslator = extend(
5151 _.extensionPoint(CoreExtensions .INSTANCE .getSourceToDocumentableTranslator)
52- .fromRecipe(ctx => new ScalaModuleProvider (using ctx.docContext))
52+ .fromRecipe(ctx => new ScalaModuleProvider (using ctx.config. docContext))
5353 .overrideExtension(dokkaBase.getDescriptorToDocumentableTranslator)
5454 .name(" disableDescriptorTranslator" )
5555 )
@@ -70,7 +70,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
7070
7171 val scalaResourceInstaller = extend(
7272 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
73- .fromRecipe(ctx => new ScalaResourceInstaller (ctx.args))
73+ .fromRecipe(ctx => new ScalaResourceInstaller (ctx.config. args))
7474 .after(dokkaBase.getCustomResourceInstaller)
7575 )
7676
@@ -111,7 +111,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
111111
112112 val ourRenderer = extend(
113113 _.extensionPoint(CoreExtensions .INSTANCE .getRenderer)
114- .fromRecipe(ctx => ScalaHtmlRenderer (ctx, ctx.args))
114+ .fromRecipe(ctx => ScalaHtmlRenderer (ctx, ctx.config. args))
115115 .overrideExtension(dokkaBase.getHtmlRenderer)
116116 )
117117
@@ -129,7 +129,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
129129
130130 val customDocumentationProvider = extend(
131131 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
132- .fromRecipe(c => SitePagesCreator (c.siteContext ))
132+ .fromRecipe(c => SitePagesCreator (c.config.staticSiteContext ))
133133 .name(" customDocumentationProvider" )
134134 .ordered(
135135 before = Seq (
@@ -142,25 +142,27 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
142142 )
143143 )
144144
145- val customIndexRootProvider = extend(
145+ val customNavigation = extend(
146146 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
147- .fromRecipe(c => RootIndexPageCreator (c.siteContext))
148- .name(" customIndexRootProvider " )
147+ .fromRecipe(c => NavigationCreator (c.config)) // Adding a parameter to constuctor to NavigationCreator failed inc compilation
148+ .name(" customNavigation " )
149149 .ordered(
150150 before = Seq (
151151 dokkaBase.getScriptsInstaller,
152152 dokkaBase.getStylesInstaller,
153153 ),
154- after = Seq (dokkaBase.getNavigationPageInstaller )
154+ after = Seq (customDocumentationProvider.getValue )
155155 )
156+ .overrideExtension(dokkaBase.getNavigationPageInstaller)
156157 )
157158
158159 val customDocumentationResources = extend(
159160 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
160- .fromRecipe(c => SiteResourceManager (c.siteContext ))
161+ .fromRecipe(c => SiteResourceManager (c.config.staticSiteContext ))
161162 .name(" customDocumentationResources" )
162163 .after(
163- scalaEmbeddedResourceAppender.getValue
164+ scalaEmbeddedResourceAppender.getValue,
165+ customDocumentationProvider.getValue
164166 )
165167 )
166168
@@ -171,9 +173,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
171173 )
172174
173175extension (ctx : DokkaContext ):
174- def siteContext : Option [StaticSiteContext ] = ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ].staticSiteContext
175- def args : Scala3doc .Args = ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ].args
176- def docContext = ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ].docContext
176+ def config = ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ]
177177
178178// TODO (https://github.com/lampepfl/scala3doc/issues/232): remove once problem is fixed in Dokka
179179extension [T ] (builder : ExtensionBuilder [T ]):
0 commit comments