Skip to content

Commit

Permalink
deploy: baa6c57
Browse files Browse the repository at this point in the history
  • Loading branch information
machow committed Jun 17, 2024
1 parent 0675c2a commit 6605201
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions get-started/dev-big-picture.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ <h2 class="anchored" data-anchor-id="the-builder">The Builder</h2>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a>builder <span class="op">=</span> Builder.from_quarto_config(cfg)</span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a>builder</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="1">
<pre><code>&lt;quartodoc.autosummary.BuilderPkgdown at 0x7f479855a950&gt;</code></pre>
<pre><code>&lt;quartodoc.autosummary.BuilderPkgdown at 0x7fc0bc222860&gt;</code></pre>
</div>
</div>
<p>Note that .from_quarto_config used the <code>style:</code> field to decide which Builder to create (in this case, <code>BuilderPkgdown</code>).</p>
Expand Down Expand Up @@ -534,7 +534,7 @@ <h2 class="anchored" data-anchor-id="rendering-and-writing">Rendering and writin
<div class="cell" data-execution_count="9">
<div class="sourceCode cell-code" id="cb17"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>builder.renderer</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="9">
<pre><code>&lt;quartodoc.renderers.md_renderer.MdRenderer at 0x7f479856e470&gt;</code></pre>
<pre><code>&lt;quartodoc.renderers.md_renderer.MdRenderer at 0x7fc0bc236230&gt;</code></pre>
</div>
</div>
<p>The <code>render</code> method of of the <a href="../api/MdRenderer.html#quartodoc.MdRenderer"><code>MdRenderer</code></a> returns a markdown string that can be rendered by Quarto:</p>
Expand Down
10 changes: 5 additions & 5 deletions get-started/dev-docstrings.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ <h3 class="anchored" data-anchor-id="parsed-docstring">Parsed docstring</h3>
<div class="cell" data-execution_count="5">
<div class="sourceCode cell-code" id="cb9"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>f_obj.docstring.parsed</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-display" data-execution_count="5">
<pre><code>[&lt;griffe.docstrings.dataclasses.DocstringSectionText at 0x7fc270397820&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionParameters at 0x7fc2703971f0&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionAdmonition at 0x7fc2604618a0&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionExamples at 0x7fc260461780&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionReturns at 0x7fc260461690&gt;]</code></pre>
<pre><code>[&lt;griffe.docstrings.dataclasses.DocstringSectionText at 0x7f9b8c12f1c0&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionParameters at 0x7f9b8c12f100&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionAdmonition at 0x7f9b8c12edd0&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionExamples at 0x7f9b8c12eec0&gt;,
&lt;griffe.docstrings.dataclasses.DocstringSectionReturns at 0x7f9b8c12ee60&gt;]</code></pre>
</div>
</div>
<p>The docstring into a tree lets us define visitors, which can visit each element and do useful things. For example, print a high-level overview of its structure, or render it to markdown.</p>
Expand Down
2 changes: 1 addition & 1 deletion get-started/interlinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ <h2 class="anchored" data-anchor-id="what-is-a-sphinx-inventory-file">What is a
</div>
</div>
<div class="callout-body-container callout-body">
<p><a href="https://github.com/machow/quartodoc/tree/main/docs/objects-test.txt">objects-test.txt</a> is an example file with one entry: <a href="https://pr-350–quartodoc.netlify.app/api/Auto.html#quartodoc.Auto"><code>qd2.Auto</code></a>.</p>
<p><a href="https://github.com/machow/quartodoc/tree/main/docs/objects-test.txt">objects-test.txt</a> is an example file with one entry: <a href="https://machow.github.io/quartodoc/api/Auto.html#quartodoc.Auto"><code>qd2.Auto</code></a>.</p>
</div>
</div>
</section>
Expand Down
6 changes: 3 additions & 3 deletions search.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
"href": "get-started/dev-big-picture.html#the-builder",
"title": "The big picture: Builder",
"section": "The Builder",
"text": "The Builder\nThe code below shows a Builder object being loaded from a _quarto.yml config (loaded as a Python dictionary).\n\nimport yaml\n\nfrom quartodoc import Builder, blueprint, collect, MdRenderer\n\ncfg = yaml.safe_load(\"\"\"\nquartodoc:\n package: quartodoc\n style: pkgdown\n sections:\n - title: \"Some section\"\n desc: \"Some description\"\n contents:\n - name: MdRenderer\n members: [\"render\", \"summarize\"]\n children: separate\n\"\"\")\n\nbuilder = Builder.from_quarto_config(cfg)\nbuilder\n\n<quartodoc.autosummary.BuilderPkgdown at 0x7f479855a950>\n\n\nNote that .from_quarto_config used the style: field to decide which Builder to create (in this case, BuilderPkgdown).\nWe can view the config as a layout.Layout, by looking at the .layout attribute.\n\nbuilder.layout\n\nLayout(sections=[Section(kind='section', title='Some section', subtitle=None, desc='Some description', package=MISSING(), contents=[Auto(signature_name='relative', members=['render', 'summarize'], include_private=False, include_imports=False, include_empty=False, include_inherited=False, include_attributes=True, include_classes=True, include_functions=True, include=None, exclude=None, dynamic=None, children=<ChoicesChildren.separate: 'separate'>, package=MISSING(), member_options=None, kind='auto', name='MdRenderer')], options=None)], package='quartodoc', options=None)\n\n\nThis can be a bit difficult to read, so quartodoc implements a preview function, which spaces things out.\n\nfrom quartodoc import preview\npreview(builder.layout)\n\n█─Layout\n├─sections = █─list\n│ └─0 = █─Section\n│ ├─title = 'Some section'\n│ ├─desc = 'Some description'\n│ └─contents = █─list\n│ └─0 = █─Auto\n│ ├─members = █─list\n│ │ ├─0 = 'render'\n│ │ └─1 = 'summarize'\n│ ├─children = <ChoicesChildren.separate: 'separate'>\n│ └─name = 'MdRenderer'\n└─package = 'quartodoc'\n\n\nNotice the following:\n\npreview represents calls like Layout() with a box to the left, and then a pipe connecting it to each of its arguments.\nThe content entry MdRenderer is represented by an Auto class. This specifies a Python object to look up and document.\n\nWe can follow the path in the preview above, to pull out just this first piece of content containing MdRenderer:\n\ncontent = builder.layout.sections[0].contents[0]\npreview(content)\n\n█─Auto\n├─members = █─list\n│ ├─0 = 'render'\n│ └─1 = 'summarize'\n├─children = <ChoicesChildren.separate: 'separate'>\n└─name = 'MdRenderer'\n\n\nNext, we’ll look at blueprint(), which processes the layout, including transforming Auto objects (like the one representing the MdRenderer above) into more concrete instructions."
"text": "The Builder\nThe code below shows a Builder object being loaded from a _quarto.yml config (loaded as a Python dictionary).\n\nimport yaml\n\nfrom quartodoc import Builder, blueprint, collect, MdRenderer\n\ncfg = yaml.safe_load(\"\"\"\nquartodoc:\n package: quartodoc\n style: pkgdown\n sections:\n - title: \"Some section\"\n desc: \"Some description\"\n contents:\n - name: MdRenderer\n members: [\"render\", \"summarize\"]\n children: separate\n\"\"\")\n\nbuilder = Builder.from_quarto_config(cfg)\nbuilder\n\n<quartodoc.autosummary.BuilderPkgdown at 0x7fc0bc222860>\n\n\nNote that .from_quarto_config used the style: field to decide which Builder to create (in this case, BuilderPkgdown).\nWe can view the config as a layout.Layout, by looking at the .layout attribute.\n\nbuilder.layout\n\nLayout(sections=[Section(kind='section', title='Some section', subtitle=None, desc='Some description', package=MISSING(), contents=[Auto(signature_name='relative', members=['render', 'summarize'], include_private=False, include_imports=False, include_empty=False, include_inherited=False, include_attributes=True, include_classes=True, include_functions=True, include=None, exclude=None, dynamic=None, children=<ChoicesChildren.separate: 'separate'>, package=MISSING(), member_options=None, kind='auto', name='MdRenderer')], options=None)], package='quartodoc', options=None)\n\n\nThis can be a bit difficult to read, so quartodoc implements a preview function, which spaces things out.\n\nfrom quartodoc import preview\npreview(builder.layout)\n\n█─Layout\n├─sections = █─list\n│ └─0 = █─Section\n│ ├─title = 'Some section'\n│ ├─desc = 'Some description'\n│ └─contents = █─list\n│ └─0 = █─Auto\n│ ├─members = █─list\n│ │ ├─0 = 'render'\n│ │ └─1 = 'summarize'\n│ ├─children = <ChoicesChildren.separate: 'separate'>\n│ └─name = 'MdRenderer'\n└─package = 'quartodoc'\n\n\nNotice the following:\n\npreview represents calls like Layout() with a box to the left, and then a pipe connecting it to each of its arguments.\nThe content entry MdRenderer is represented by an Auto class. This specifies a Python object to look up and document.\n\nWe can follow the path in the preview above, to pull out just this first piece of content containing MdRenderer:\n\ncontent = builder.layout.sections[0].contents[0]\npreview(content)\n\n█─Auto\n├─members = █─list\n│ ├─0 = 'render'\n│ └─1 = 'summarize'\n├─children = <ChoicesChildren.separate: 'separate'>\n└─name = 'MdRenderer'\n\n\nNext, we’ll look at blueprint(), which processes the layout, including transforming Auto objects (like the one representing the MdRenderer above) into more concrete instructions."
},
{
"objectID": "get-started/dev-big-picture.html#from-config-to-blueprint",
Expand All @@ -641,7 +641,7 @@
"href": "get-started/dev-big-picture.html#rendering-and-writing",
"title": "The big picture: Builder",
"section": "Rendering and writing",
"text": "Rendering and writing\nA Builder instantiates a Renderer (like MdRenderer). Use the .renderer attribute to access it:\n\nbuilder.renderer\n\n<quartodoc.renderers.md_renderer.MdRenderer at 0x7f479856e470>\n\n\nThe render method of of the MdRenderer returns a markdown string that can be rendered by Quarto:\n\nprint(builder.renderer.render(pages[0]))\n\n# render { #quartodoc.MdRenderer.render }\n\n`MdRenderer.render(el)`\n\n\n\n\n\n\n\n\n\n\nCross References\n\n\n\nThe { #quartodoc.MdRenderer.render } in the output above is extended Quarto markdown that is a cross reference."
"text": "Rendering and writing\nA Builder instantiates a Renderer (like MdRenderer). Use the .renderer attribute to access it:\n\nbuilder.renderer\n\n<quartodoc.renderers.md_renderer.MdRenderer at 0x7fc0bc236230>\n\n\nThe render method of of the MdRenderer returns a markdown string that can be rendered by Quarto:\n\nprint(builder.renderer.render(pages[0]))\n\n# render { #quartodoc.MdRenderer.render }\n\n`MdRenderer.render(el)`\n\n\n\n\n\n\n\n\n\n\nCross References\n\n\n\nThe { #quartodoc.MdRenderer.render } in the output above is extended Quarto markdown that is a cross reference."
},
{
"objectID": "get-started/dev-big-picture.html#writing-pages",
Expand Down Expand Up @@ -683,7 +683,7 @@
"href": "get-started/dev-docstrings.html#reading-docstrings",
"title": "Inspecting docstrings",
"section": "Reading docstrings",
"text": "Reading docstrings\nUse the function get_object to read in a docstring from a module.\n\nfrom quartodoc import get_object, preview\n\nf_obj = get_object(\"quartodoc\", \"get_object\")\nf_obj\n\nAlias('get_object', 'quartodoc.autosummary.get_object')\n\n\nThe result above is a griffe object representing the function quartodoc.get_object, which has two important attributes:\n\n.name: the function’s name.\n.parameters: the function’s parameters.\n.docstring.value: the actual docstring\n.docstring.parsed: the docstring parsed into a tree of griffe objects\n\n\nFunction name\n\nf_obj.name\n\n'get_object'\n\n\n\n\nFunction parameters\n\nf_obj.parameters\n\nParameters(Parameter(name='path', annotation=ExprName(name='str', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py'))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default=None), Parameter(name='object_name', annotation=\"'str | None'\", kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='None'), Parameter(name='parser', annotation=ExprName(name='str', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py'))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default=\"'numpy'\"), Parameter(name='load_aliases', annotation=None, kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='True'), Parameter(name='dynamic', annotation=None, kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='False'), Parameter(name='loader', annotation=ExprBinOp(left='None', operator='|', right=ExprName(name='GriffeLoader', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py')))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='None'))\n\n\n\n\nRaw docstring value\n\nprint(f_obj.docstring.value)\n\nFetch a griffe object.\n\nParameters\n----------\npath: str\n An import path to the object. This should have the form `path.to.module:object`.\n For example, `quartodoc:get_object` or `quartodoc:MdRenderer.render`.\nobject_name: str\n (Deprecated). A function name.\nparser: str\n A docstring parser to use.\nload_aliases: bool\n For aliases that were imported from other modules, should we load that module?\ndynamic: bool\n Whether to dynamically import object. Useful if docstring is not hard-coded,\n but was set on object by running python code.\n\nSee Also\n--------\npreview: print a user-friendly preview of a griffe object.\n\nExamples\n--------\n\n>>> get_function(\"quartodoc\", \"get_function\")\n<Function('get_function', ...\n\nReturns\n-------\nx:\n abc\n\n\n\n\nParsed docstring\n\nf_obj.docstring.parsed\n\n[<griffe.docstrings.dataclasses.DocstringSectionText at 0x7fc270397820>,\n <griffe.docstrings.dataclasses.DocstringSectionParameters at 0x7fc2703971f0>,\n <griffe.docstrings.dataclasses.DocstringSectionAdmonition at 0x7fc2604618a0>,\n <griffe.docstrings.dataclasses.DocstringSectionExamples at 0x7fc260461780>,\n <griffe.docstrings.dataclasses.DocstringSectionReturns at 0x7fc260461690>]\n\n\nThe docstring into a tree lets us define visitors, which can visit each element and do useful things. For example, print a high-level overview of its structure, or render it to markdown."
"text": "Reading docstrings\nUse the function get_object to read in a docstring from a module.\n\nfrom quartodoc import get_object, preview\n\nf_obj = get_object(\"quartodoc\", \"get_object\")\nf_obj\n\nAlias('get_object', 'quartodoc.autosummary.get_object')\n\n\nThe result above is a griffe object representing the function quartodoc.get_object, which has two important attributes:\n\n.name: the function’s name.\n.parameters: the function’s parameters.\n.docstring.value: the actual docstring\n.docstring.parsed: the docstring parsed into a tree of griffe objects\n\n\nFunction name\n\nf_obj.name\n\n'get_object'\n\n\n\n\nFunction parameters\n\nf_obj.parameters\n\nParameters(Parameter(name='path', annotation=ExprName(name='str', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py'))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default=None), Parameter(name='object_name', annotation=\"'str | None'\", kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='None'), Parameter(name='parser', annotation=ExprName(name='str', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py'))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default=\"'numpy'\"), Parameter(name='load_aliases', annotation=None, kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='True'), Parameter(name='dynamic', annotation=None, kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='False'), Parameter(name='loader', annotation=ExprBinOp(left='None', operator='|', right=ExprName(name='GriffeLoader', parent=Module(PosixPath('/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/quartodoc/autosummary.py')))), kind=<ParameterKind.positional_or_keyword: 'positional or keyword'>, default='None'))\n\n\n\n\nRaw docstring value\n\nprint(f_obj.docstring.value)\n\nFetch a griffe object.\n\nParameters\n----------\npath: str\n An import path to the object. This should have the form `path.to.module:object`.\n For example, `quartodoc:get_object` or `quartodoc:MdRenderer.render`.\nobject_name: str\n (Deprecated). A function name.\nparser: str\n A docstring parser to use.\nload_aliases: bool\n For aliases that were imported from other modules, should we load that module?\ndynamic: bool\n Whether to dynamically import object. Useful if docstring is not hard-coded,\n but was set on object by running python code.\n\nSee Also\n--------\npreview: print a user-friendly preview of a griffe object.\n\nExamples\n--------\n\n>>> get_function(\"quartodoc\", \"get_function\")\n<Function('get_function', ...\n\nReturns\n-------\nx:\n abc\n\n\n\n\nParsed docstring\n\nf_obj.docstring.parsed\n\n[<griffe.docstrings.dataclasses.DocstringSectionText at 0x7f9b8c12f1c0>,\n <griffe.docstrings.dataclasses.DocstringSectionParameters at 0x7f9b8c12f100>,\n <griffe.docstrings.dataclasses.DocstringSectionAdmonition at 0x7f9b8c12edd0>,\n <griffe.docstrings.dataclasses.DocstringSectionExamples at 0x7f9b8c12eec0>,\n <griffe.docstrings.dataclasses.DocstringSectionReturns at 0x7f9b8c12ee60>]\n\n\nThe docstring into a tree lets us define visitors, which can visit each element and do useful things. For example, print a high-level overview of its structure, or render it to markdown."
},
{
"objectID": "get-started/dev-docstrings.html#previewing-docstrings",
Expand Down

0 comments on commit 6605201

Please sign in to comment.