File tree Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Expand file tree Collapse file tree 5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 6161
6262.. py :data :: __version__
6363 :canonical: autodoc2.__version__
64- :value: '0.3.0 '
64+ :value: '0.4.2 '
6565
6666 .. autodoc2-docstring :: autodoc2.__version__
6767
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ For example, the following:
1010 :renderer: myst
1111
1212 aiida.orm.Node
13+ ~aiida.orm.Dict
1314 autodoc2.sphinx.docstring._example my example
1415````
1516
@@ -19,13 +20,15 @@ creates:
1920:renderer: myst
2021
2122aiida.orm.Node
23+ ~aiida.orm.Dict
2224autodoc2.sphinx.docstring._example my example
2325```
2426
2527Note that fully qualified names can be used to refer to objects in other packages,
2628and they will also resolve against public API names, i.e. if the object is specified in an ` __all__ ` variable.
2729
28- Any text after the fully qualified name will be used as the title for the object.
30+ Any text after the fully qualified name will be used as the title for the object,
31+ or alternatively, if the name begins with ` ~ ` then the last component will be used as the title.
2932
3033The ` :renderer: ` option can also be used to specify the renderer to use for the summary.
3134
Original file line number Diff line number Diff line change 11"""Analyse a python project and create documentation for it."""
22
3- __version__ = "0.4.1 "
3+ __version__ = "0.4.2 "
44
55
66def setup (app ): # type: ignore
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ def run(self) -> list[nodes.Node]:
5050 continue
5151 full_name = parts [0 ]
5252 alias : str | None = None
53+ if full_name .startswith ("~" ):
54+ full_name = full_name [1 :]
55+ alias = full_name .split ("." )[- 1 ]
5356 if len (parts ) > 1 :
5457 alias = parts [1 ]
5558 if (item := db .get_item (full_name )) is None and (
@@ -63,7 +66,9 @@ def run(self) -> list[nodes.Node]:
6366 self .env .note_dependency (file_path )
6467 break
6568 if alias :
66- aliases [full_name ] = alias
69+ aliases [item ["full_name" ]] = alias
70+ elif full_name != item ["full_name" ]:
71+ aliases [item ["full_name" ]] = full_name
6772 objects .append (item )
6873 else :
6974 warn_sphinx (
Original file line number Diff line number Diff line change 6969 <row >
7070 <entry >
7171 <paragraph >
72- <pending_xref py : class =" True" py : module =" True" refdoc =" index" refdomain =" py" refexplicit =" False " reftarget =" package.a.a1" reftype =" obj" refwarn =" False" >
72+ <pending_xref py : class =" True" py : module =" True" refdoc =" index" refdomain =" py" refexplicit =" True " reftarget =" package.a.a1" reftype =" obj" refwarn =" False" >
7373 <literal classes =" xref py py-obj" >
74- package.a. a1
74+ package.a1
7575 <entry >
7676 <paragraph >
7777 a1 can be documented here.
You can’t perform that action at this time.
0 commit comments