book icon indicating copy to clipboard operation
book copied to clipboard

listing hyperlinks added

Open Techy5042069 opened this issue 2 years ago • 1 comments
trafficstars

  • Added Listing [0-9]+-[0-9]+ hyperlinks across all files
  • Cross-file hyperlink
  • Anchored in the span tag below listings

Techy5042069 avatar Jul 31 '23 11:07 Techy5042069

  • The hyperlink jumps to making the anchored place on the top of the document, So a little scroll is required to see the whole listing.

Techy5042069 avatar Jul 31 '23 11:07 Techy5042069

Thanks for this, and I imagine it must have been a lot of effort (unless you built a tool to do it?). However, as you can see from the number of conflicts which have shown up as I have been working on the book over the past week, this is the kind of thing that needs to be 100% automated or needs to not be done at all, because otherwise it will be very difficult to keep in sync.

I am not sure whether we are even interested in trying to automate that, but if you'd like to open an issue to discuss it, feel free!

chriskrycho avatar Apr 08 '24 19:04 chriskrycho

No Problem! It wasn't much of a work really. I wrote a simple tool in python to do it. I think the regex was: Listing [0-9]+-[0-9]+ and it would just convert the matched substring to: Listing x-y The span element was also changed in a similar way.

I do not know how to set up python(or other) tools to format all the files on github, unless it is run manually before commiting. I'd be grateful if you share with me some resources to learn it.

Also, apologies for the clutter! It was tedious going back and forth to understand the code, so I felt the need for a hyperlink.

Techy5042069 avatar Apr 09 '24 14:04 Techy5042069

Totally understand, and no need to apologize! We appreciate the effort. And I figured it was probably regex-driven. As you say, the trick is making it 100% automate-able, because it just wouldn’t stay up to date otherwise.

chriskrycho avatar Apr 09 '24 16:04 chriskrycho