felix-hilden/sphinx-codeautolink

Line numbering breaks the linking

Closed this issue ยท 4 comments

Issue

When adding :lineno: to code-blocks and literalinclude's this breaks the linking and all the links are absent with the compiler giving Could not resolve and Could not match a code example to HTML errors respectively.

I am sorry, I would like to elaborate, but I cannot understand, how to submit minimal reproducible example. Please tell me, how I can be more helpful in any way.

Thanks for submitting the issue! Your description was to the point and I think gives most of the information to debug, so don't worry ๐Ÿ‘ What is meant by a minimal reproducible example would be a minimal but complete project that when built with Sphinx would produce the error. So in this case most likely just an index.rst and a simple config.py. For small stuff, just including it in the issue is entirely fine, like so:

# index.rst
Example
*******

.. code-block:: python
    :linenos:

    import numpy

# conf.py
extensions = ["sphinx-codeautolink"]

Thank you for the detailed answer!
Attached here is my minimal_reproducible_sample.zip. Sorry that it took a week to do it, I will respond more quickly now.

Hey! Sorry for dropping this for the longest time. I've now pushed a fix, expect this to be released in the coming days once I've had a look at the other issues. I'll leave this open in the meantime and close it on release so you'll get a notification. In the meantime you can git-install to try it out if you want to!

Finally, on the 1st anniversary of this ticket, the new version has been published and this can be closed! :P