Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute class name must be supported #56

Open
mvorisek opened this issue Jul 14, 2023 · 4 comments · May be fixed by #62
Open

Absolute class name must be supported #56

mvorisek opened this issue Jul 14, 2023 · 4 comments · May be fixed by #62
Labels

Comments

@mvorisek
Copy link
Contributor

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...

@markstory
Copy link
Owner

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?

@mvorisek
Copy link
Contributor Author

mvorisek commented Jul 14, 2023

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 (Sub class name under global NS + X NS)
  • and \Foo\Y (fully qualified name).

@mvorisek
Copy link
Contributor Author

This issue seems tobe related with #47 - what is the difference of ~ vs. the standartized leading \?

@markstory
Copy link
Owner

The ~ operator in role directives allows the classname to be omitted from link text.

@mvorisek mvorisek linked a pull request Aug 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants