Skip to content

Commit bd54720

Browse files
committed
docs: doc improvements for pr review
1 parent c00e848 commit bd54720

File tree

3 files changed

+35
-27
lines changed

3 files changed

+35
-27
lines changed

docs/get-started/basic-content.qmd

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ The functions listed in `contents` are assumed to be imported from the package.
6161

6262
Documentation for modules and classes can automatically include their members (e.g. class methods and attributes; everything defined inside a module).
6363

64+
By default, all attributes and functions (including methods on a class) are documented by embedding them inside the module or class documentation.
65+
6466
There are four styles for presenting child members:
6567

6668
```{python}
@@ -170,4 +172,20 @@ quartodoc:
170172
```
171173

172174
:::
173-
::::::
175+
::::::
176+
177+
178+
## Dynamic lookup
179+
180+
By default, quartodoc uses static analysis to look up objects.
181+
This means it gets information about your docstring without actually running your package's code.
182+
183+
This usually works well, but may get the docstring wrong for those created in an extremely dynamic way (e.g. you manually set the `__doc__` attribute on an object).
184+
185+
In this case, you can set the dynamic option on a piece of content.
186+
187+
```yaml
188+
contents:
189+
- name: get_object
190+
dynamic: true
191+
```

docs/get-started/dev-big-picture.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ a pipe connecting it to each of its arguments.
7272
We can follow the path in the preview above, to pull out just the contents piece:
7373

7474
```{python}
75-
content = builder.layout.sections[0].contents
75+
content = builder.layout.sections[0].contents[0]
7676
preview(content)
7777
```
7878

@@ -84,13 +84,13 @@ The code below shows how `blueprint()` transforms the `Auto` entry for `MdRender
8484

8585
```{python}
8686
bp = blueprint(builder.layout)
87-
bp_contents = bp.sections[0].contents
88-
preview(bp_contents[0], max_depth=3)
87+
bp_contents = bp.sections[0].contents[0]
88+
preview(bp_contents, max_depth=3)
8989
```
9090

9191
Notice two key pieces:
9292

93-
* The outermost element is now a [layout.Page](`quartodoc.layout.Page`).
93+
* The `Auto` element is now a [layout.Page](`quartodoc.layout.Page`).
9494
The `.path` indicates that the documentation will be on a page called `"MdRenderer"`.
9595
* The content of the page is a [layout.DocClass](`quartodoc.layout.DocClass).
9696
This element holds everything needed to render this doc, including the class signature
@@ -99,7 +99,7 @@ Notice two key pieces:
9999
Importantly, the `.members` attribute specifies how to render the class methods we specified (`.render()` and `.summarize()`).
100100

101101
```{python}
102-
preview(bp_contents[0].contents[0].members, max_depth=2)
102+
preview(bp_contents.contents[0].members, max_depth=2)
103103
```
104104

105105
Note that they are also a instances of `Page` (`MemberPage` to be exact).

docs/get-started/overview.qmd

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ jupyter:
99
name: python3
1010
---
1111

12-
::: {.callout-warning}
13-
quartodoc is work in progress!
12+
::: {.callout-note}
13+
quartodoc is used to create the API documentation for [shiny], [siuba], and [vetiver].
14+
15+
It's full-featured and relatively stable, but may see some small changes in the the name of making API documentation a real delight.
16+
17+
If you're interested in using quartodoc for your package's documentation, please open an issue, so we can make sure it does exactly what you want.
1418
:::
1519

16-
quartodoc let's you quickly generate python package documentation,
20+
quartodoc lets you quickly generate python package documentation,
1721
using markdown and [quarto](https://quarto.org).
1822
It is designed as an alternative to Sphinx.
1923

@@ -36,17 +40,16 @@ First, create a `_quarto.yml` file with the following:
3640
```yaml
3741
project:
3842
type: website
39-
resources:
40-
- objects.json
4143

4244
quartodoc:
43-
style: single-page
44-
dir: reference
45+
# the name used to import the package
4546
package: quartodoc
4647
sections:
4748
- title: Some functions
4849
desc: Functions to inspect docstrings.
4950
contents:
51+
# the functions being documented in the package.
52+
# you can refer to anything: class methods, modules, etc..
5053
- get_object
5154
- preview
5255
```
@@ -86,7 +89,7 @@ python -m quartodoc build
8689

8790
## Looking up objects
8891

89-
Finding Python objects to document involves two pieces of configuration:
92+
Finding python objects to document involves two pieces of configuration:
9093

9194
* the package name.
9295
* a list of objects for content.
@@ -110,19 +113,6 @@ quartodoc:
110113
The functions listed in `contents` are assumed to be imported from the package.
111114

112115

113-
## Key Features
114-
115-
* Load docstrings (with [griffe](https://github.com/mkdocstrings/griffe))
116-
* Render docstrings (e.g. with [MdRenderer](/api/#sec-MdRenderer))
117-
* Enable cross references to function documentation (with interlinks filter).
118-
- Link to functions within a doc.
119-
- Link to functions in other docs.
120-
- Generate an inventory file for other docs to link to yours.
121-
* Generate high-level summaries (with [Builder](/api/#api-builders)).
122-
- First line of docstring used as description.
123-
- Class doc pages have table of class attributes.
124-
- Index pages list function names and descriptions.
125-
126116
## Example sites
127117

128118
### Demo sites

0 commit comments

Comments
 (0)