Open mvorisek opened 1 year ago
It seems the types are defined in https://github.com/markstory/sphinxcontrib-phpdomain/blob/0.11.1/sphinxcontrib/phpdomain.py#L124 but not registered for other parsers like in this example: https://gist.github.com/shimizukawa/4498647#file-conf-py-L33
https://pydoc.dev/sphinx/latest/sphinx.directives.ObjectDescription.html?private=1#doc_field_types doc_field_types
is not documented much
here is docs for field: https://pydoc.dev/sphinx/latest/sphinx.util.docfields.Field.html?private=1, code: https://github.com/sphinx-doc/sphinx/blob/v5.3.0/sphinx/util/docfields.py
I have no context on alternative parsers for sphinx, and won't be able to support them well. You'd need to submit a pull request with some form of regression tests in order to get support for this use case added.
For classes I would also expect attributes like "extends", "implements", ex:
:::{php:class} Car
:extends: ObjectModel
:implements: JsonSerializable
:implements: Iterator
Car class that can be serialized to JSON and iterated.
:::
I am migrating sphinx docs from .rst to .md.
Rst file:
Md/MyST file:
Currently the output looks like:![image](https://github.com/markstory/sphinxcontrib-phpdomain/assets/2228672/9d0dd103-47b0-468d-abfc-f9e9e0c7bc66)
Notice, the native MyST param is missing/ignored and the 2nd param not parsed [1]/formated. I think the problem is
sphinxcontrib-phpdomain
extension tries to parse the params from rst text directly instead of supporting directive/AST params directly.[1] MyST spec https://myst-parser.readthedocs.io/en/latest/syntax/roles-and-directives.html#parameterizing-directive - directives are parsed at the directive start only
I would expect
sphinxcontrib-phpdomain
extension to honor natively parsed directive parameters.Sphinx build log:
To reproduce this issue, edit any rst sphinx project like:
conf.py:
requirements.txt