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

[BUG] C domain does not work #32

Open
ISSOtm opened this issue Feb 27, 2025 · 3 comments
Open

[BUG] C domain does not work #32

ISSOtm opened this issue Feb 27, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ISSOtm
Copy link

ISSOtm commented Feb 27, 2025

Describe the bug
AssertionError: Empty title when using the C domain

To Reproduce
Steps to reproduce the behavior:

  1. Write .. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) (lifted from the official Sphinx documentation) in index.rst
  2. sphinx-build -b markdown <source> <dest> trips the assertion
  3. Disabling the assertion (python -O path/to/sphinx-build -b markdown <source> <dest>) instead yields an empty title on the function documentation

Expected behavior
A clear and concise description of what you expected to happen.

Environment:

  • OS: Arch Linux
  • Sphinx==8.2.1
  • sphinx-markdown-builder==0.6.8

Additional context
I tried looking into this issue, but I'm failing to grasp what the data flow is. Sorry, I don't have any more details than this.

@ISSOtm ISSOtm added the bug Something isn't working label Feb 27, 2025
@ISSOtm ISSOtm changed the title [BUG] [BUG] C domain does not work Feb 27, 2025
@ISSOtm
Copy link
Author

ISSOtm commented Feb 27, 2025

Ah, I figured it out: it seems like adding the following to translator.py fixes the issue although I don't know if it's a proper fix 😅

    def visit_desc_signature_line(self, node):
    	pass

Please let me know if you'd like this PR'd?

@liran-funaro
Copy link
Owner

Thanks. I'll look into it.

@liran-funaro
Copy link
Owner

Thanks for taking the time to report this.
I added fix and test per your suggestion. It seems to work for me.
Please let me know if it solves the issue for your use case.

You can install the latest commit and see if it solves this issue for you.
If it solves it, I'll upload a new version soon.

pip uninstall sphinx-markdown-builder
pip install git+https://github.com/liran-funaro/sphinx-markdown-builder.git@main

@liran-funaro liran-funaro reopened this Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants