Permalinks for code-blocks

chebee7i avatarchebee7i created an issue

Would it be possible to (optionally) have Sphinx insert permalinks for each code block? The idea would be that if you hover over the code-block, then the permalink marker (¶) would appear---perhaps immediately before the code-block. One thought would be that it could float at the upper right corner of the block, but note that the Python documentation puts a >>> in the upper-right corner to hide prompts and outputs.

Comments (3)

  1. Georg Brandl

    I don't think this is a good idea: what would the anchor be? Of course you could say a hash of the code block content, but then a minor change would ruin it... better to link to a section containing the code block.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.