Skip to content

Commit 25bc5a2

Browse files
authored
Merge pull request #49 from machow/feat-func-alias
Feat func alias
2 parents 6d0fbca + edc1c34 commit 25bc5a2

File tree

13 files changed

+81
-20
lines changed

13 files changed

+81
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
# TODO: temporary installs for examples
8282
# once quartodoc is stable we should move into their own libraries
8383
python -m pip install shiny shinylive
84-
python -m pip install --no-deps dascore
84+
python -m pip install --no-deps dascore==0.0.8
8585
- uses: quarto-dev/quarto-actions/setup@v2
8686
- name: Build docs
8787
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ docs/examples/%: examples/%/_site
1313
rm -rf docs/examples/$*
1414
cp -rv $< $@
1515

16-
docs-build-examples: docs/examples/single-page docs/examples/pkgdown docs/examples/shiny docs/examples/dascore
16+
docs-build-examples: docs/examples/single-page docs/examples/pkgdown docs/examples/shiny
1717

1818
docs-build: docs-build-examples
1919
cd docs && quarto add --no-prompt ..

examples/pkgdown/_quarto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ format:
2424
quartodoc:
2525
style: pkgdown
2626
dir: reference
27+
display_name: relative
2728
package: quartodoc
2829
sections:
2930
- title: Some functions
3031
desc: These functions inspect and parse docstrings.
3132
contents:
3233
- get_object
3334
- preview
35+
- Builder
36+
- Builder.build

examples/pkgdown/objects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"project": "quartodoc", "version": "0.0.9999", "count": 2, "items": [{"name": "quartodoc.get_object", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_object.html", "dispname": "get_object"}, {"name": "quartodoc.preview", "domain": "py", "role": "function", "priority": "1", "uri": "reference/preview.html", "dispname": "preview"}]}
1+
{"project": "quartodoc", "version": "0.0.9999", "count": 4, "items": [{"name": "quartodoc.get_object", "domain": "py", "role": "function", "priority": "1", "uri": "reference/get_object.html", "dispname": "get_object"}, {"name": "quartodoc.preview", "domain": "py", "role": "function", "priority": "1", "uri": "reference/preview.html", "dispname": "preview"}, {"name": "quartodoc.Builder", "domain": "py", "role": "class", "priority": "1", "uri": "reference/Builder.html", "dispname": "Builder"}, {"name": "quartodoc.Builder.build", "domain": "py", "role": "function", "priority": "1", "uri": "reference/Builder.build.html", "dispname": "Builder.build"}]}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## build { #build }
2+
3+
`build(self)`
4+
5+
Build index page, sphinx inventory, and individual doc pages.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Builder { #Builder }
2+
3+
`Builder(self, package, sections, version=None, dir='reference', title='Function reference', renderer='markdown', out_index=None, sidebar=None, use_interlinks=False, display_name='name')`
4+
5+
Base class for building API docs.
6+
7+
### Parameters
8+
9+
| Name | Type | Description | Default |
10+
|----------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
11+
| `package` | str | The name of the package. | required |
12+
| `sections` | list[Any] | A list of sections, with items to document. | required |
13+
| `version` | str \| None | The package version. By default this attempts to look up the current package version (TODO). | `None` |
14+
| `dir` | str | Name of API directory. | `'reference'` |
15+
| `title` | str | Title of the API index page. | `'Function reference'` |
16+
| `renderer` | dict \| Renderer \| str | The renderer used to convert docstrings (e.g. to markdown). | `'markdown'` |
17+
| `out_index` | str | The output path of the index file, used to list all API functions. | `None` |
18+
| `sidebar` | str \| None | The output path for a sidebar yaml config (by default no config generated). | `None` |
19+
| `display_name` | str | The default name shown for documented functions. Either "name", "relative", "full", or "canonical". These options range from just the function name, to its full path relative to its package, to including the package name, to its the its full path relative to its .__module__. | `'name'` |

examples/pkgdown/reference/index.qmd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ These functions inspect and parse docstrings.
77
| | |
88
| --- | --- |
99
| [get_object](/reference/get_object.qmd) | Fetch a griffe object. |
10-
| [preview](/reference/preview.qmd) | Print a friendly representation of a griffe object (e.g. function, docstring) |
10+
| [preview](/reference/preview.qmd) | Print a friendly representation of a griffe object (e.g. function, docstring) |
11+
| [Builder](/reference/Builder.qmd) | Base class for building API docs. |
12+
| [Builder.build](/reference/Builder.build.qmd) | Build index page, sphinx inventory, and individual doc pages. |

examples/single-page/_quarto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ format:
2323
quartodoc:
2424
style: single-page
2525
dir: reference
26+
display_name: relative
2627
package: quartodoc
2728
sections:
2829
- title: Some functions
2930
desc: These functions inspect and parse docstrings.
3031
contents:
3132
- get_object
3233
- preview
34+
- Builder
35+
- Builder.build

examples/single-page/objects.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"project": "quartodoc", "version": "0.0.9999", "count": 2, "items": [{"name": "quartodoc.get_object", "domain": "py", "role": "function", "priority": "1", "uri": "reference/index.html#quartodoc.get_object", "dispname": "get_object"}, {"name": "quartodoc.preview", "domain": "py", "role": "function", "priority": "1", "uri": "reference/index.html#quartodoc.preview", "dispname": "preview"}]}
1+
{"project": "quartodoc", "version": "0.0.9999", "count": 4, "items": [{"name": "quartodoc.get_object", "domain": "py", "role": "function", "priority": "1", "uri": "reference/index.html#quartodoc.get_object", "dispname": "get_object"}, {"name": "quartodoc.preview", "domain": "py", "role": "function", "priority": "1", "uri": "reference/index.html#quartodoc.preview", "dispname": "preview"}, {"name": "quartodoc.Builder", "domain": "py", "role": "class", "priority": "1", "uri": "reference/index.html#quartodoc.Builder", "dispname": "Builder"}, {"name": "quartodoc.Builder.build", "domain": "py", "role": "function", "priority": "1", "uri": "reference/index.html#quartodoc.Builder.build", "dispname": "Builder.build"}]}

examples/single-page/reference/index.qmd

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,30 @@ Print a friendly representation of a griffe object (e.g. function, docstring)
4646
```python
4747
>>> preview(obj)
4848
...
49-
```
49+
```
50+
51+
## Builder { #Builder }
52+
53+
`Builder(self, package, sections, version=None, dir='reference', title='Function reference', renderer='markdown', out_index=None, sidebar=None, use_interlinks=False, display_name='name')`
54+
55+
Base class for building API docs.
56+
57+
### Parameters
58+
59+
| Name | Type | Description | Default |
60+
|----------------|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
61+
| `package` | str | The name of the package. | required |
62+
| `sections` | list[Any] | A list of sections, with items to document. | required |
63+
| `version` | str \| None | The package version. By default this attempts to look up the current package version (TODO). | `None` |
64+
| `dir` | str | Name of API directory. | `'reference'` |
65+
| `title` | str | Title of the API index page. | `'Function reference'` |
66+
| `renderer` | dict \| Renderer \| str | The renderer used to convert docstrings (e.g. to markdown). | `'markdown'` |
67+
| `out_index` | str | The output path of the index file, used to list all API functions. | `None` |
68+
| `sidebar` | str \| None | The output path for a sidebar yaml config (by default no config generated). | `None` |
69+
| `display_name` | str | The default name shown for documented functions. Either "name", "relative", "full", or "canonical". These options range from just the function name, to its full path relative to its package, to including the package name, to its the its full path relative to its .__module__. | `'name'` |
70+
71+
## build { #build }
72+
73+
`build(self)`
74+
75+
Build index page, sphinx inventory, and individual doc pages.

0 commit comments

Comments
 (0)