Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/godoc: Current online source code site makes it difficult to copy blocks of code #9042
Whenever i copy and paste blocks from http://golang.org/src I get line numbers with it, which i have to cleanup. Would be great if the #golang online src was easier to copy and paste from similar to the way github shows sources. To reproduce navigate to http://golang.org/src/pkg/net/http/server.go?s=53505:53596#L1942 and copy then paste a block, in this case the handy internal tcpKeepalive helper. Cheers
Comment 2 by email@example.com:
Started trying to fix this myself by moving the code into a table and putting the line numbers in one column, and code in another however as soon as I change tags they aren't emitted. And I have NO IDEA why!? Currently using the code layout on https://bitbucket.org as a starting point as it is neat and simple, and has the desired behaviour.
Comment 3 by firstname.lastname@example.org:
After some work to make this work while retaining styling for code in other places I have a patch which demonstrates the new view. This supports just copying the code. Note: This will require you to run bake.sh to regenerate static.go under code.google.com/p/go.tools/godoc/static. Cheers