golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 266 forks source link

Add syntax highlighting to code snippets #605

Open frederikhors opened 5 years ago

frederikhors commented 5 years ago

Is there a way to add colorization (read highlighting) to code snippets?

Maybe we can start with nothing but anyone can choose it's own schema for snippets (using cookie for saving preferences).

Please, for newbies like me this is an extreme improvement.

Thanks.

urandom2 commented 5 years ago

To confirm, you are looking for something like this?

Unfortunately, since gddo does not serve source, only api docs, it relies on the underlying hosting provider for features like snippet highlighting:

If you have more familiarity with the undocumented features of any of these hosting providers, feel free to propose new syntaxes for any currently configured.

jackwilsdon commented 5 years ago

gddo does serve some source in the form of documentation (which I believe is what @frederikhors is referring to).

For example;

image

urandom2 commented 5 years ago

ok, so @frederikhors is asking about syntax highlighting, which iirc is a dupe of #187; may be better to continue the discussion there.

frederikhors commented 5 years ago

@arnottcr I think that thread is on a different path. Can we leave this open just for syntax highlighting?