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

Add contents entries for object & :nocontentsentry: #43

Closed n-peugnet closed 1 year ago

n-peugnet commented 1 year ago

This allows to automatically add entries for domain objects in contents table with Sphinx >= 5.2. See https://github.com/sphinx-doc/sphinx/pull/10807 and https://github.com/sphinx-doc/sphinx/pull/10886

See also an example here with my (still small) documentation : https://club-1.github.io/sphinx-inventory-parser/index.html

(I didn't add the php:namespace in my docs as it caused issues with :php:attr: references for some reason, I will open an issue (and/or a PR) for this bug soon)

No namespace

toc_object_entries_show_parents = hide

Screen Shot 2023-04-06 at 12 53 48 Screen Shot 2023-04-06 at 12 53 56

toc_object_entries_show_parents = domain

Screen Shot 2023-04-06 at 12 55 02 Screen Shot 2023-04-06 at 12 55 08

toc_object_entries_show_parents = all

_Same results as toc_object_entries_show_parents = domain_

With namespace

toc_object_entries_show_parents = hide

Screen Shot 2023-04-06 at 12 58 48 Screen Shot 2023-04-06 at 12 58 52

toc_object_entries_show_parents = domain

Screen Shot 2023-04-06 at 12 58 20 Screen Shot 2023-04-06 at 12 58 30

toc_object_entries_show_parents = all

Screen Shot 2023-04-06 at 12 57 25 Screen Shot 2023-04-06 at 12 57 33

_the default theme does not support it very well :sweatsmile:

n-peugnet commented 1 year ago

I didn't think to check your tests until now, it behaves as expected except for the all parameter which throws an error. I'm working on a fix.

EDIT: done!

markstory commented 1 year ago

It would be good to have this behaviour included in the tests. We could have separate documents for different modes.

Having some examples in the test builds will help ensure that these modes continue to build without errors.

n-peugnet commented 1 year ago

We could have separate documents for different modes.

The issue is that this is a global sphinx parameter. One possibility could be to run the test multiple times with a different value each time using sphinx-build -D option.

markstory commented 1 year ago

I can take care of updating the CI configuration to build with different option values.

markstory commented 1 year ago

Thank you 🎉