sphinx-codeautolink icon indicating copy to clipboard operation
sphinx-codeautolink copied to clipboard

Line numbering breaks the linking

Open kuliyys opened this issue 2 years ago • 2 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.

kuliyys avatar Apr 17 '23 16:04 kuliyys

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"]

felix-hilden avatar Apr 17 '23 17:04 felix-hilden

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.

kuliyys avatar Apr 26 '23 14:04 kuliyys

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!

felix-hilden avatar Mar 14 '24 18:03 felix-hilden

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

felix-hilden avatar Apr 17 '24 16:04 felix-hilden