Skip to content

Commit

Permalink
Merge pull request #366 from machow/fix-render-linked
Browse files Browse the repository at this point in the history
fix: use shortname for member children linked style
  • Loading branch information
machow authored Sep 30, 2024
2 parents 4739a4e + a98bf47 commit 75c8477
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion quartodoc/renderers/md_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def summarize(
@dispatch
def summarize(self, el: layout.Link):
description = self.summarize(el.obj)
return self._summary_row(f"[](`{el.name}`)", description)
return self._summary_row(f"[](`~{el.name}`)", description)

@dispatch
def summarize(self, obj: Union[dc.Object, dc.Alias]) -> str:
Expand Down
27 changes: 27 additions & 0 deletions quartodoc/tests/__snapshots__/test_renderers.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,33 @@
A function
'''
# ---
# name: test_render_doc_module[linked]
'''
# quartodoc.tests.example { #quartodoc.tests.example }

`tests.example`

A module

## Attributes

| Name | Description |
| --- | --- |
| [](`~quartodoc.tests.example.a_attr`) | An attribute |

## Classes

| Name | Description |
| --- | --- |
| [](`~quartodoc.tests.example.AClass`) | A class |

## Functions

| Name | Description |
| --- | --- |
| [](`~quartodoc.tests.example.a_func`) | A function |
'''
# ---
# name: test_render_doc_signature_name
'''
# example.a_func { #quartodoc.tests.example.a_func }
Expand Down
2 changes: 1 addition & 1 deletion quartodoc/tests/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_render_doc_section_admonition(renderer):
assert res == "quartodoc.tests.example: Method for doing a thing"


@pytest.mark.parametrize("children", ["embedded", "flat"])
@pytest.mark.parametrize("children", ["embedded", "flat", "linked"])
def test_render_doc_module(snapshot, renderer, children):
bp = blueprint(Auto(name="quartodoc.tests.example", children=children))
res = renderer.render(bp)
Expand Down

0 comments on commit 75c8477

Please sign in to comment.