From 4facd639274762c9c3efe1584e2b1b14fe1d9104 Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Thu, 5 Oct 2023 13:32:04 -0400 Subject: [PATCH 1/2] docs: add signature_name to docstring and all content options section --- docs/get-started/basic-content.qmd | 18 ++++++++++++++++++ quartodoc/layout.py | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/get-started/basic-content.qmd b/docs/get-started/basic-content.qmd index 015776ec..45358f29 100644 --- a/docs/get-started/basic-content.qmd +++ b/docs/get-started/basic-content.qmd @@ -375,3 +375,21 @@ Note these three important pieces of the page entry: * `contents:` - lists out the contents of the page. +## All content options + +```{python} +#| echo: false +#| output: asis + +# print out the attributes table of ChoicesChildren +# this is overkill, but maybe a nice case of dogfooding +from quartodoc import get_object, MdRenderer, Auto +from quartodoc.builder.utils import extract_type +from griffe.docstrings.dataclasses import DocstringSectionAttributes + +renderer = MdRenderer() +choices = get_object("quartodoc.Auto") +res = extract_type(DocstringSectionAttributes, choices.docstring.parsed)[0] + +print(renderer.render(res)) +``` \ No newline at end of file diff --git a/quartodoc/layout.py b/quartodoc/layout.py index 86b5629f..406f952d 100644 --- a/quartodoc/layout.py +++ b/quartodoc/layout.py @@ -241,9 +241,12 @@ class Auto(AutoOptions): Attributes ---------- - kind: name: Name of the object. This should be the path needed to import it. + signature_name: + Style of name to use in the signature. Can be "relative", "full", or "short". + Relative is whatever was used as the name argument, full is the fully qualified + path the object, and short is the name of the object (i.e. no periods). members: A list of members, such as attributes or methods on a class, to document. include_private: @@ -275,7 +278,6 @@ class Auto(AutoOptions): member_options: Options to apply to members. These can include any of the options above. - """ kind: Literal["auto"] = "auto" From 442d09fa42de82a9e444ab40d258391ce230e83c Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Thu, 5 Oct 2023 13:55:37 -0400 Subject: [PATCH 2/2] docs: tweak content doc --- docs/get-started/basic-content.qmd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/get-started/basic-content.qmd b/docs/get-started/basic-content.qmd index 45358f29..8fa45ac0 100644 --- a/docs/get-started/basic-content.qmd +++ b/docs/get-started/basic-content.qmd @@ -377,12 +377,13 @@ Note these three important pieces of the page entry: ## All content options +Below is a summary of all the options that can be applied to individual content entries. + + ```{python} #| echo: false #| output: asis -# print out the attributes table of ChoicesChildren -# this is overkill, but maybe a nice case of dogfooding from quartodoc import get_object, MdRenderer, Auto from quartodoc.builder.utils import extract_type from griffe.docstrings.dataclasses import DocstringSectionAttributes