-
Notifications
You must be signed in to change notification settings - Fork 14
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
Native directive params support #55
Comments
It seems the types are defined in https://pydoc.dev/sphinx/latest/sphinx.directives.ObjectDescription.html?private=1#doc_field_types 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:
|
I am migrating sphinx docs from .rst to .md.
Rst file:
Md/MyST file:
Currently the output looks like:
![image](https://private-user-images.githubusercontent.com/2228672/253511790-9d0dd103-47b0-468d-abfc-f9e9e0c7bc66.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2MDQxMDEsIm5iZiI6MTcyNTYwMzgwMSwicGF0aCI6Ii8yMjI4NjcyLzI1MzUxMTc5MC05ZDBkZDEwMy00N2IwLTQ2OGQtYWJmYy1mOWU5ZTBjN2JjNjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDZUMDYyMzIxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDk3YTgzOGY1N2VhNzRhNTNlZDU0ZDViNTlhNmI0YWEzZWI3ZWJjN2VjM2E3ZmUzYjc1OTlhZGZlMmU3NDVhZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.E8f36ivXc98UqvhnTIxrea07d-79JfXlYqm_345L73s)
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
sphinx<5 sphinx-rtd-theme sphinxcontrib-phpdomain +myst-parser
The text was updated successfully, but these errors were encountered: