Skip to content

Commit

Permalink
Merge pull request #321 from filipwastberg/main
Browse files Browse the repository at this point in the history
Add docs for how to document only Python files
  • Loading branch information
machow authored Jan 19, 2024
2 parents 65fba43 + 8af57fa commit c0c57a7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/get-started/basic-content.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,45 @@ Note these three important pieces of the page entry:
`some_funcs.qmd` in the API reference folder.
* `contents:` - lists out the contents of the page.

## Documenting source files that are not a package

In some cases you might want to create a page for a bunch of Python modules that are not a package.

Say you have a repository that look like this:

```
project
├── config
├── data
├── docs
├── notebooks
├── src
```

Where `src` is the place where you have your `.py` files and `docs` is where your `_quarto.yml` is.

To make a quartodoc page of this project you have to set the package to `null` and tell Quarto where
quartodoc should look. Then you can reference each file as usual with `file.function`.

Example:

```yaml
quartodoc:
package: null
source_dir: ../src
# write sidebar data to this file
sidebar: _sidebar.yml
sections:
- title: Some functions
desc: Some description
contents:
# the functions being documented in the package.
# you can refer to anything: class methods, modules, etc..
- analysis.plot_my_vars
- training.train_and_evaluate
```

## All content options

Expand Down

0 comments on commit c0c57a7

Please sign in to comment.