sphinxcontrib-phpdomain
sphinxcontrib-phpdomain copied to clipboard
Absolute class name must be supported
There is namespace support like:
.. php:namespace:: Foo\Bar
.. php:class:: X
which renders class Foo\Bar\X correctly.
but
.. php:namespace:: Foo\Bar
.. php:class:: \Foo\Data\Y
support is broken. I would expect Foo\Bar ignored as the class name is fully qualified, ie. class Foo\Data\Y rendered.
The same for traits, references...
I would expect Foo\Bar ignored as the class name is fully qualified, ie. class Foo\Data\Y rendered.
This isn't a scenario I had accounted for. Why are you mixing namespace directives with fully qualified class names in another namespace?
See https://github.com/atk4/ui/blob/3074d460793109f802e3542f6de0fdfec191d38a/docs/js.md?plain=1#L1 for example. The docs page mostly document Js\Xxx (Atk4\Ui\Js\Xxx) classes, but still need to refer to many Yyy (Atk4\Ui\Yyy) classes.
So I would expect .. php:namespace:: to define: "the namespace for context below until redefined" and allow .. php:class:: in form of:
X(unqualified name),X\Sub(Subclass name under global NS +XNS)- and
\Foo\Y(fully qualified name).
This issue seems tobe related with https://github.com/markstory/sphinxcontrib-phpdomain/pull/47 - what is the difference of ~ vs. the standartized leading \?
The ~ operator in role directives allows the classname to be omitted from link text.