Skip to content

Commit 334074f

Browse files
committed
refactor: change signature_path option to signature_name
1 parent 9b7162a commit 334074f

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

quartodoc/builder/blueprint.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,11 @@ def enter(self, el: Auto):
327327

328328
is_flat = el.children == ChoicesChildren.flat
329329
return Doc.from_griffe(
330-
el.name, obj, children, flat=is_flat, signature_path=el.signature_path
330+
el.name,
331+
obj,
332+
children,
333+
flat=is_flat,
334+
signature_name=el.signature_name,
331335
)
332336

333337
@staticmethod

quartodoc/layout.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class ChoicesChildren(Enum):
207207
class AutoOptions(_Base):
208208
"""Options available for Auto content layout element."""
209209

210-
signature_path: SignatureOptions = "relative"
210+
signature_name: SignatureOptions = "relative"
211211
members: Optional[list[str]] = None
212212
include_private: bool = False
213213
include_imports: bool = False
@@ -335,7 +335,7 @@ class Doc(_Docable):
335335
name: str
336336
obj: Union[dc.Object, dc.Alias]
337337
anchor: str
338-
signature_path: SignatureOptions = "relative"
338+
signature_name: SignatureOptions = "relative"
339339

340340
class Config:
341341
arbitrary_types_allowed = True
@@ -349,7 +349,7 @@ def from_griffe(
349349
members=None,
350350
anchor: str = None,
351351
flat: bool = False,
352-
signature_path: str = "relative",
352+
signature_name: str = "relative",
353353
):
354354
if members is None:
355355
members = []
@@ -361,7 +361,7 @@ def from_griffe(
361361
"name": name,
362362
"obj": obj,
363363
"anchor": anchor,
364-
"signature_path": signature_path,
364+
"signature_name": signature_name,
365365
}
366366

367367
if kind == "function":

quartodoc/renderers/md_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def signature(self, el: layout.Doc):
137137
# TODO: this is for backwards compatibility with the old approach
138138
# of only defining signature over griffe objects, which projects
139139
# like shiny currently extend
140-
self.display_name = el.signature_path
140+
self.display_name = el.signature_name
141141
res = self.signature(el.obj)
142142
self.display_name = orig
143143

quartodoc/tests/__snapshots__/test_renderers.ambr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
A function
233233
'''
234234
# ---
235-
# name: test_render_doc_signature_path
235+
# name: test_render_doc_signature_name
236236
'''
237237
# example.a_func { #quartodoc.tests.example.a_func }
238238

quartodoc/tests/test_builder_blueprint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ def test_blueprint_fetch_members_include_inherited():
188188
def test_blueprint_member_options():
189189
auto = lo.Auto(
190190
name="quartodoc.tests.example",
191-
member_options={"signature_path": "short"},
191+
member_options={"signature_name": "short"},
192192
members=["AClass"],
193193
)
194194
bp = blueprint(auto)
195195
doc_a_class = bp.members[0]
196196

197197
# member has option set
198-
assert doc_a_class.signature_path == "short"
198+
assert doc_a_class.signature_name == "short"
199199

200200
# this currently does not apply to members of members
201-
assert doc_a_class.members[0].signature_path == "relative"
201+
assert doc_a_class.members[0].signature_name == "relative"

quartodoc/tests/test_renderers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ def test_render_docstring_numpy_linebreaks(snapshot, renderer):
147147
assert res == snapshot
148148

149149

150-
def test_render_doc_signature_path(snapshot, renderer):
150+
def test_render_doc_signature_name(snapshot, renderer):
151151
package = "quartodoc.tests"
152-
auto = Auto(name="example.a_func", package=package, signature_path="short")
152+
auto = Auto(name="example.a_func", package=package, signature_name="short")
153153
bp = blueprint(auto)
154154

155155
res = renderer.render(bp)

0 commit comments

Comments
 (0)