-
Notifications
You must be signed in to change notification settings - Fork 17.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Add highlight for golang code, golang doc/blog or other document web page #13178
Comments
Please no. |
I don't understand the logic of the highlighting in the screenshot you provided. Some identifiers are black and some are purple. Why? It doesn't follow any logic that I can discern. Overall, that screenshot is less legible than the status quo in my opinion. The current docs highlight comments. The code/comment distinction is objective, and so is therefore an uncontroversial stance. The rest is a matter of opinion. Historically the project does not encourage syntax highlighting. |
The code highlight style is powered by google's implement https://github.com/google/code-prettify Code highlight in IDE were good for reading code. Why not support code highlight? What Text Editor you guys using? No any color ? just black and white text? |
Code highlight can make code more easily to read and understand. will save our time to read and understand the code. why you think that was nonsense and useless? |
They also easily allow changing the color scheme. Not everybody likes the colours that you, or some service, pick. They even allow modifying the patterns used for highlighting.
There is a large enough group of programmers that prefer no syntax highlighting whatsoever, among them a large portion of the Go team. Personally I recommend that you use something like greasemonkey, or the equivalent for your browser, and add syntax highlighting to any page you wish. That way, you get to control all aspects of the syntax highlighting.
That is subjective. Also, it is more relevant for languages with too complex syntax. Go is a very simple language syntactically. One shouldn't require colours to tell a few syntactic elements apart. Also, as adg pointed out, the highlighting in your screenshot is inconsistent. It is either not designed for Go specifically, or it is inadequate. |
Thanks @dominikh , I made a script , https://github.com/netroby/golang-org-code-highlight-userscript |
That's not what I said. |
Not at all times. I use the lack of syntax highlighting as a readability test. I find standard library godoc and examples quite readable without syntax highlighting. It is a sign that the language and the standard library APIs are simple enough. Maybe we should always keep godoc this way to have a reality check with the verbosity. |
Thanks for you time, i choose to die. |
i choose to die, too |
Proposal: Add highlight for golang code for golang doc/blog or other document web page.
The current document, blog and other document, even online source code browser doese not have code highlight.
See following page, do you feel it ?
Example none highlight page
Blog page: https://blog.golang.org/context
Packge page: https://golang.org/pkg/bufio/#example_Scanner_custom
Source code page: https://golang.org/src/bufio/scan.go
Ok,let's testing the highlight result.
Testing highlight result
<pre>
tags, change it to<pre class="prettyprint">
How to do this?
The highlight is powered by google's dog food:
https://github.com/google/code-prettify
To use it very simple
class="prettyprint"
to the<pre>
tagThe text was updated successfully, but these errors were encountered: