Open GoogleCodeExporter opened 9 years ago
Do you ever call prettyPrint as described at
https://code.google.com/p/google-code-prettify/wiki/GettingStarted#Serving_your_
own_JS_&_CSS ?
Original comment by mikesamuel@gmail.com
on 27 Feb 2014 at 3:55
Yes, we do call prettyPrint(). Rhe default/built-in languages work and
highlight (Python/PHP/Javascript) just not the added language Go.
Original comment by i...@nodesocket.com
on 27 Feb 2014 at 8:52
Can you post a standalone HTML example? Also, what rules do you use in your
code-pretty.css
Original comment by mikesamuel@gmail.com
on 27 Feb 2014 at 9:37
Sure, here is a JS fiddle of exactly what I am doing (js and csss):
http://jsfiddle.net/f9rQ9/
Notice that I simply added the Go language support to the bottom of the
JavaScript. However, I don't think JSFiddle likes that prettyify.js injects
html.
Original comment by i...@nodesocket.com
on 28 Feb 2014 at 12:24
Here is a screenshot of what I currently see: http://i.imgur.com/1bKAYJr.png
Original comment by i...@nodesocket.com
on 28 Feb 2014 at 12:28
Any update on this? Would love to have go pigmenting working.
Original comment by i...@nodesocket.com
on 7 Apr 2014 at 9:53
I added a call to prettyPrint at the end and it seems to work.
http://jsfiddle.net/fJjwB/1/
Note that the go language handler included at the end only styles comments.
Original comment by mikesamuel@gmail.com
on 7 Apr 2014 at 11:27
Ahh so go is not fully supported with colored keywords, strings, functions, etc?
Original comment by i...@nodesocket.com
on 8 Apr 2014 at 12:25
https://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-go.j
s#28
On Thursday, July 22, 2010, Mike Samuel <...> wrote:
> On Thu, Jul 22, 2010, Rob 'Commander' Pike <...> wrote:
>> Personally, I would vote for the subdued style godoc presents at
http://golang.org
>>
>> Not as fancy as some like, but a case can be made it's the official style.
>> If people want more colors, I wouldn't fight too hard, in the interest of
>> encouragement through familiarity, but even then I would ask to shy away
>> from technicolor starbursts.
>
> Like http://golang.org/pkg/go/scanner/ where comments are blue and all
> other content is black? I can do that.
It looks like since that was written things have gotten a bit more colorful on
golang.org.
Original comment by mikesamuel@gmail.com
on 8 Apr 2014 at 2:12
SInce go has gone with more colors, can we get an updated lang-go.js?
Thanks.
Original comment by i...@nodesocket.com
on 10 Apr 2014 at 8:15
solved using http://pygments.org/
The Go language handler, as defined, works just fine. Here is a live example: https://jsfiddle.net/amroamroamro/empkm4c5/
Now as noted in the previous discussion, it was by design that only comments be highlighted, while everything else is plain text (at least that was the opinion of Rob Pike at the time). Whether it should now add detection for more constructs and keywords is another matter...
Original issue reported on code.google.com by
i...@nodesocket.com
on 27 Feb 2014 at 2:24