From 58ded33a69d6cd7a77693b3cf29302aa9b698ae7 Mon Sep 17 00:00:00 2001 From: "yakumo.izuru" Date: Fri, 9 Feb 2024 21:22:42 +0000 Subject: [PATCH] Change godoc path to pkg.go.dev and add a manual page Signed-off-by: Izuru Yakumo git-svn-id: file:///srv/svn/repo/toyohime/trunk@113 922d331f-388e-da47-97a9-ad700dc0b8b9 --- Makefile | 6 ++++-- README.md | 8 ++++---- toyohime.1 | 23 +++++++++++++++++++++++ toyohime.go | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 toyohime.1 diff --git a/Makefile b/Makefile index 349a778..903799b 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,10 @@ toyohime: clean: rm toyohime install: - install -m0755 toyohime $(PREFIX)/bin/yorihime + install -m0755 toyohime ${DESTDIR}${PREFIX}/bin/yorihime + install -Dm0044 toyohime.1 ${DESTDIR}${PREFIX}/share/man/man1/toyohime.1 test: ${GO} test . uninstall: - rm -f $(PREFIX)/bin/toyohime + rm -f ${DESTDIR}${PREFIX}/bin/toyohime + rm -f ${DESTDIR}${PREFIX}/share/man/man1/toyohime.1 diff --git a/README.md b/README.md index 56f9bd1..08a2111 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ BitBucket, etc.). A commonly used vanity import path is ## Features - - Redirects browsers to godocs.io (or somewhere else) - - Redirects Go tool to VCS - - Redirects godocs.io to browsable files +* Redirects browsers to godocs.io (or somewhere else) +* Redirects Go tool to VCS +* Redirects pkg.go.dev to browsable files ## Installation ```bash -go get marisa.chaotic.ninja/toyohime +go install marisa.chaotic.ninja/toyohime/cmd/toyohime@latest ``` ## Specification diff --git a/toyohime.1 b/toyohime.1 new file mode 100644 index 0000000..41d2e04 --- /dev/null +++ b/toyohime.1 @@ -0,0 +1,23 @@ +.Dd $Mdocdate$ +.Dt TOYOHIME 1 +.Os +.Sh NAME +.Nm toyohime +.Nd Library and CLI for hosting custom vanity URIs for the Go tool +.Sh SYNOPSIS +.Nm +.Op Fl index +.Op Fl listen Ar :port +.Op Fl nohealthz +.Op Fl watch +.Sh DESCRIPTION +.Nm +is a library and command line implementation +that allows developers to have their own path +for their Go packages, closely replicating +the behavior of golang.org/x/.. as much as +possible. +.Sh AUTHORS +.An Jon Betti Aq Mt jonbetti@gmail.com +.Sh MAINTAINERS +.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja diff --git a/toyohime.go b/toyohime.go index 951c79a..0439d4d 100644 --- a/toyohime.go +++ b/toyohime.go @@ -100,7 +100,7 @@ Nothing to see here; move along. // Use default GDDO Redirector. if cfg.redir == nil { cfg.redir = func(pkg string) string { - return "https://godocs.io/" + pkg + return "https://pkg.go.dev/" + pkg } }