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
Understanding how`Auto`an object created is helpful in case you need to debug`quartodoc`. If you find that a configuration option is not being set as you expect, you can create an `Auto` object for the Python object in question and compare it to the `Auto` object that you expect to be created from your yaml configuration.
79
+
Understanding the`Auto` object is helpful for debugging`quartodoc`. If you find that a configuration option is not being set as you expect, you can create an `Auto` object for the Python object in question and compare it to the `Auto` object that you expect to be created from your yaml configuration.
80
80
81
-
## Blueprint: create a renderable doc recipe
81
+
## `blueprint`: Parse Metadata From Objects
82
82
83
-
### From Auto
83
+
`blueprint` parses all of the metadata about the python object and stores it in a hierarchal tree structure that is convenient for a renderer to transform into a renderable format like HTML or Markdown. For example, here is the blueprint for the `MdRenderer` class:
84
84
85
85
```{python}
86
86
from quartodoc import blueprint
87
87
doc = blueprint(auto)
88
-
doc
88
+
preview(doc, max_depth=2)
89
89
```
90
90
91
+
To give you a sense of this tree structure, we can look at the `obj.docstring` field of the above blueprint, which contains information about the [Python docstring](https://peps.python.org/pep-0257/):
92
+
91
93
```{python}
92
94
preview(doc.obj.docstring, max_depth=2)
93
95
```
94
96
97
+
We can see from this output that the parser for the docstring is `numpy`, which means the docstring is expected to be in the [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html).
98
+
99
+
Furthermore, we can see from the tree structure that the `DocstringSectionText` is stored as the first element in a list under the `parsed` attribute:
100
+
101
+
```{python}
102
+
preview(doc.obj.docstring.parsed[0])
103
+
```
104
+
105
+
`DocstringSectionText` stores the "text" field of a [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) docstring, which is the first line of the docstring, which is otherwise known as the [short summary](https://numpydoc.readthedocs.io/en/latest/format.html#short-summary).
106
+
Furthermore, we can see from the output above that the actual text of this short summary is stored in the `value` attribute:
0 commit comments