markstory / sphinxcontrib-phpdomain

A PHP domain for sphinx. Allows you to annotate PHP objects in your sphinx docs.
Other
19 stars 15 forks source link

Improve UX with namespace #57

Open mvorisek opened 1 year ago

mvorisek commented 1 year ago

Currently when NS is defined, it is prepended before every class name.

With a lot of classes, it is quite hard to visually locate the desired class (method, ...) quickly.

This is a feature request and I propose to render namespace in class name with lighter color like:

image

This feature request is only about the visual UX, anchors should remain fully qualified (as they are now).

Together with #56 fixed, this will help large projects to have NS defined to project's NS on top of each doc file.

mvorisek commented 1 year ago

class declaration/directives names are already separated in HTML render and can be styled:

image

the problem is with methods (constants/methods) only

the NS is rendered with short class name in 1 <span class="sig-prename">


another alternative might be to render the namespace directive like class:

image

and then not render the NS before any class

this will save a lot of visual real estate

markstory commented 1 year ago

another alternative might be to render the namespace directive like class: and then not render the NS before any class.

Not all projects that document namespaced classes include a namespace directive on the page. I can see the argument for skipping the namespace prefix on every method. Perhaps this could be a good place to add a configuration option to allow either the full namespace prefix (current behavior) or just the classname, or no prefix.