You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/get-started/dev-big-picture.qmd
+18-10Lines changed: 18 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ The code below shows a Builder object being loaded from a `_quarto.yml` config (
28
28
```{python}
29
29
import yaml
30
30
31
-
from quartodoc import Builder, preview, blueprint, collect, MdRenderer
31
+
from quartodoc import Builder, blueprint, collect, MdRenderer
32
32
33
33
cfg = yaml.safe_load("""
34
34
quartodoc:
@@ -48,7 +48,7 @@ builder
48
48
```
49
49
50
50
Note that .from_quarto_config used the `style:` field to decide which Builder to create
51
-
(in this case, PkgdownBuilder).
51
+
(in this case, `BuilderPkgdown`).
52
52
53
53
We can view the config as a [layout.Layout](`quartodoc.layout.Layout`), by looking at the `.layout` attribute.
54
54
@@ -59,6 +59,7 @@ builder.layout
59
59
This can be a bit difficult to read, so quartodoc implements a [preview](`quartodoc.preview`) function, which spaces things out.
60
60
61
61
```{python}
62
+
from quartodoc import preview
62
63
preview(builder.layout)
63
64
```
64
65
@@ -69,14 +70,14 @@ a pipe connecting it to each of its arguments.
69
70
* The content entry `MdRenderer` is represented by an [Auto](`quartodoc.Auto`) class.
70
71
This specifies a Python object to look up and document.
71
72
72
-
We can follow the path in the preview above, to pull out just the contents piece:
73
+
We can follow the path in the preview above, to pull out just this first piece of content containing `MdRenderer`:
73
74
74
75
```{python}
75
76
content = builder.layout.sections[0].contents[0]
76
77
preview(content)
77
78
```
78
79
79
-
Next, we'll look at `blueprint()`, which processes the layout, including transforming `Auto` objects into more concrete instructions.
80
+
Next, we'll look at `blueprint()`, which processes the layout, including transforming `Auto` objects (like the one representing the `MdRenderer` above) into more concrete instructions.
80
81
81
82
## From config to blueprint
82
83
@@ -96,7 +97,7 @@ Notice two key pieces:
96
97
This element holds everything needed to render this doc, including the class signature
97
98
and parsed docstring.
98
99
99
-
Importantly, the `.members` attribute specifies how to render the class methods we specified (`.render()` and `.summarize()`).
100
+
Importantly, the `.members` attribute stores how to render the class methods we listed in our configuration yaml, `.render()` and `.summarize()`:
@@ -112,7 +113,7 @@ Before to building the site, we need to `collect()` all the pages.
112
113
The [collect](`quartodoc.collect`) function pulls out two important pieces of information:
113
114
114
115
***pages** - each page to be rendered.
115
-
***items** - information on where each documented object lives in the site.
116
+
***items** - information on where each documented object lives in the site, which is used for things like [interlinks](interlinks.qmd).
116
117
117
118
```{python}
118
119
pages, items = collect(bp, builder.dir)
@@ -130,21 +131,28 @@ Notice that if you wanted to look up `quartodoc.MdRenderer.render`, the first it
130
131
131
132
## Rendering and writing
132
133
133
-
A `Builder` instantiates a `Renderer` (like [MdRenderer](`quartodoc.MdRenderer`)).
134
-
Use the `.renderer` attribute to access it.
134
+
A `Builder` instantiates a `Renderer` (like [](`~quartodoc.MdRenderer`)).
135
+
Use the `.renderer` attribute to access it:
135
136
136
137
```{python}
137
138
builder.renderer
138
139
```
139
140
141
+
The `render` method of of the [](`~quartodoc.MdRenderer`) returns a markdown string that can be rendered by Quarto:
140
142
```{python}
141
143
print(builder.renderer.render(pages[0]))
142
-
143
144
```
144
145
146
+
:::{.callout-note}
147
+
### Cross References
148
+
149
+
The `{ #quartodoc.MdRenderer.render }` in the output above is extended Quarto markdown that is a [cross reference](https://quarto.org/docs/authoring/cross-references.html).
150
+
151
+
:::
152
+
145
153
## Writing pages
146
154
147
-
The builder has a number of methods it uses during build.
155
+
The builder has a number of methods it uses while materializing files that will be rendered by Quarto.
148
156
The main method is [.build()](`quartodoc.Builder.build`).
149
157
See the [Builder section of the API](#api-builders) for a list of methods,
150
158
or this [giant build process diagram](/get-started/extra-build-sequence.qmd) for a full breakdown.
0 commit comments