From owner-freebsd-doc@FreeBSD.ORG Fri Feb 22 09:28:07 2013 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25B201D9; Fri, 22 Feb 2013 09:28:07 +0000 (UTC) (envelope-from cnst++@freebsd.org) Received: from Cns.Cns.SU (unknown [IPv6:2001:470:7240::]) by mx1.freebsd.org (Postfix) with ESMTP id A382B16E; Fri, 22 Feb 2013 09:28:06 +0000 (UTC) Received: from Cns.Cns.SU (cnst@localhost [127.0.0.1]) by Cns.Cns.SU (8.14.5/8.14.5) with ESMTP id r1M9S5cH012694; Fri, 22 Feb 2013 01:28:05 -0800 (PST) Received: (from cnst@localhost) by Cns.Cns.SU (8.14.5/8.14.5/Submit) id r1M9S5XC002558; Fri, 22 Feb 2013 01:28:05 -0800 (PST) X-Authentication-Warning: Cns.Cns.SU: cnst set sender to cnst++@freebsd.org using -f Date: Fri, 22 Feb 2013 01:28:05 -0800 From: "Constantine A. Murenin" To: Paul Schenkeveld Subject: Re: announcing mdoc.su, short manual page URLs Message-ID: <20130222092805.GA19524@Cns.Cns.SU> References: <20130219082700.GA9938@Cns.Cns.SU> <20130220143720.GA4368@psconsult.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20130220143720.GA4368@psconsult.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-doc@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2013 09:28:07 -0000 On 2013-W08-3 15:37 +0100, Paul Schenkeveld wrote: > On Tue, Feb 19, 2013 at 12:27:01AM -0800, Constantine A. Murenin wrote: > > Dear freebsd-{chat,current,doc}@, > > > > I would like to announce and introduce , > > a deterministic URL shortener for BSD manual pages, > > written entirely in nginx.conf. > > > > It supports several address schemes, for example: > > > > http://mdoc.su/f/zfs > > http://mdoc.su/f/zfs.8 > > http://mdoc.su/f/8/zfs > > http://mdoc.su/freebsd/zfs > > http://mdoc.su/FreeBSD/zfs > > > > http://mdoc.su/d/hammer.5 > > http://mdoc.su/d/hammer.8 > > > > etc. > > Very coooool! > > One question: is the os version accessible comewhere, i.e. can I ask for > a manpage from a specific version of FreeBSD? I have added OS version support today: http://mdoc.su/f91/aibs.4 http://mdoc.su/FreeBSD-9.1/aibs.4 http://mdoc.su/FreeBSD-8.1/acpi_aiboost.4 :-) OpenBSD and NetBSD versions are also supported (as mentioned, DragonFly doesn't provide versioned man-pages through web-man, so, it's always been supported). Through the long notation, any possible release should be supported, including point releases like 5.2.1, 4.6.2, 4.1.1, 2.2.8 etc (subject to man.cgi support, of course), and long releases like 4.11. Through the short "/f" notation, only versions from 4.0 to a futuristic 19.9 are supported (except for point releases and versions like 4.10 and 4.11). Still written completely in nginx.conf. :-) The FreeBSD portion is now: location ^~ /FreeBSD { rewrite "^/FreeBSD([ -/].*)?$" /freebsd$1 last; return 404; } location ^~ /f { set $fb "http://www.freebsd.org/cgi/man.cgi?query="; set $fs "&sektion="; rewrite ^/f([4-9]|1[0-9])([0-9])(/.*)?$ /freebsd-$1.$2$3; rewrite "^/freebsd[ -/](?[0-9]+(\.[0-9]+)+)(/.*)?$" /.$3; if ($fp) { set $fp "&manpath=FreeBSD+$fp-RELEASE"; } rewrite ^/freebsd(/.*)?$ /.$1; rewrite ^/./([^/.]+)/([^/]+)$ $fb$2$fs$1$fp redirect; rewrite ^/./([^/]+)\.([1-9])$ $fb$1$fs$2$fp redirect; rewrite ^/./([^/]+)$ $fb$1$fs$fp redirect; rewrite ^/./?$ / last; return 410; } Enjoy! Best regards, Constantine. > > I have to disagree with Darren Pilgrim however, this is not "slight abuse" > of rewrite rules but putting rewrite rules to "better use" :-) > > Kind regards, > > Paul Schenkeveld