Skip to content

Commit e9c90c8

Browse files
committed
Give the renderer a reference to the builder
The builder keeps usefult config settings like the package being documented and the directory where the generated qmd files are placed. The builder also keeps track of the documented items that are later converted into the inventory on which interlinking depends. With this change the renderers have access to this information as well.
1 parent adc946f commit e9c90c8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

quartodoc/autosummary.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ def __init__(
507507
self.parser = parser
508508

509509
self.renderer = Renderer.from_config(renderer)
510+
self.renderer.builder = self
510511
if render_interlinks:
511512
# this is a top-level option, but lives on the renderer
512513
# so we just manually set it there for now.

quartodoc/renderers/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import re
2+
import typing
23

34
from plum import dispatch
45

6+
if typing.TYPE_CHECKING:
7+
from ..autosummary import Builder
58

69
# utils -----------------------------------------------------------------------
710

@@ -37,6 +40,9 @@ class Renderer:
3740
style: str
3841
_registry: "dict[str, Renderer]" = {}
3942

43+
builder: "Builder"
44+
"""The builder that uses this renderer for generating docs"""
45+
4046
def __init_subclass__(cls, **kwargs):
4147
super().__init_subclass__(**kwargs)
4248

0 commit comments

Comments
 (0)