DEV Community

Cover image for A better pkg.go.dev
JackTT
JackTT

Posted on

1 1

A better pkg.go.dev

#go

About pkgo.dev

I have never been able to read a package's documentation on pkg.go.dev since all the code there is in black & white...
Image description

This is the reason I created this repository to make it possible to read.

Image description

Usage

Every time you want to read a package's documentation, you just need to replace pkg.go.dev with pkgo.dev. (remove the .g).

E.g.

How it works

We use Nginx as proxy server.

Every time a request come in, we forward it to the pkg.go.dev server, then append the highlight.js script to the response before sending it back to the client.

Since some README files do not specify the code language, we also update <code> tags to <code class="language-go"> to enable syntax highlighting.

If you don't trust me, no worry, you can deploy it yourself:

  • Append 127.0.0.1 pkg.go.dev.local to /etc/hosts
  • Run docker-compose up -d --build
  • Access http://pkg.go.dev.local

Source code

https://github.com/huantt/better-pkg-go-dev

GitHub logo huantt / better-pkg-go-dev

Make pkg.go.dev more readable

About

I have never been able to read a package's documentation on pkg.go.dev since all the code there is in black & white... original.png

This is the reason I created this repository to make it possible to read.

original.png

Usage

Every time you want to read a package's documentation, you just need to replace pkg.go.dev with pkgo.dev. (remove the .g).

How it works

We use Nginx as proxy server.

Every time a request come in, we forward it to the pkg.go.dev server, then append the highlight.js script to the response before sending it back to the client.

Since some README files do not specify the code language, we also update <code> tags to <code class="language-go"> to enable syntax highlighting.

If you don't trust me, no worry, you can deploy it yourself:

  • Append 127.0.0.1 pkg.go.dev.local to /etc/hosts
  • Run docker-compose up -d --build
  • Access http://pkg.go.dev.local



Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay