Skip to content

Commit c0c57a7

Browse files
authored
Merge pull request #321 from filipwastberg/main
Add docs for how to document only Python files
2 parents 65fba43 + 8af57fa commit c0c57a7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

docs/get-started/basic-content.qmd

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,45 @@ Note these three important pieces of the page entry:
374374
`some_funcs.qmd` in the API reference folder.
375375
* `contents:` - lists out the contents of the page.
376376

377+
## Documenting source files that are not a package
378+
379+
In some cases you might want to create a page for a bunch of Python modules that are not a package.
380+
381+
Say you have a repository that look like this:
382+
383+
```
384+
project
385+
├── config
386+
├── data
387+
├── docs
388+
├── notebooks
389+
├── src
390+
```
391+
392+
Where `src` is the place where you have your `.py` files and `docs` is where your `_quarto.yml` is.
393+
394+
To make a quartodoc page of this project you have to set the package to `null` and tell Quarto where
395+
quartodoc should look. Then you can reference each file as usual with `file.function`.
396+
397+
Example:
398+
399+
```yaml
400+
quartodoc:
401+
package: null
402+
source_dir: ../src
403+
404+
# write sidebar data to this file
405+
sidebar: _sidebar.yml
406+
407+
sections:
408+
- title: Some functions
409+
desc: Some description
410+
contents:
411+
# the functions being documented in the package.
412+
# you can refer to anything: class methods, modules, etc..
413+
- analysis.plot_my_vars
414+
- training.train_and_evaluate
415+
```
377416

378417
## All content options
379418

0 commit comments

Comments
 (0)