Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Suggestion for new shortcut-tags: [man://] and [mskb://]

by Perlbotics (Chancellor)
on Oct 30, 2008 at 18:37 UTC ( #720539=note: print w/replies, xml ) Need Help??

in reply to Suggestion for new shortcut-tags: [man://] and [mskb://]

After fiddling around a bit with the FreeBSD man.cgi interface, I came up with a small heuristic (argl!) for specifying the OS and a Perl program that created the table below. It shall provide an impression of what the results might look like and summarise the feedback, I've got so far (thanks).

My assumptions:
  • the vast majority of users (of the minority that requires UNIX Man Pages anyhow) will need something like [man://program] only
  • a section is rarely necessary, e.g. for passwd (1+5)
  • someone requiring a special manual section for a distinct version of a given OS should use a direct link - as offered at the bottom of a FreeBSD manpage: e.g
  • maintenance overhead at PM should be close to nothing, thus the release of an OS is not processed
  • format: [man://PROG (opt. SECTION) (opt. OS)], order of OS and SECTION insignificant
  • optional (\d+) is a hint for a SECTION
  • optional (\D+) is a hint for an OS plus optional release (latter: ignored!); The FreeBSD site is quite good at guessing the current OS for a given manpath-attribute without a release number.
  • currently, the OS is simply uppercased (e.g. SUSE instead of SuSE)
  • [manX://abc] is offered as convenience shortcut for [man://abc (X)]
  • whitespace-tolerant, case-tolerant
  • class="man", class="mskb" for individual styling
  • using the format [man://prog (section) (os rel)] or [man://prog/section/os/rel] is mainly a matter of taste..., so I started with my favourite pattern
  • personally, I think the reference should contain no whitespaces
  • restriction of current implementation: no nested (...(..)..) or [..[..]..] allowed
  • handling of MSKB entries is trivial
  • ....
Some testcases (including ill. formatted entries) below. Some very simple heuristics are applied to find the manpath attribute for a given Unix flavour keeping the maintenance overhead small at PerlMonks. If the heuristic fails, the FreeBSD site will fallback to the default OS (FreeBSD) - which is OK for me. Although, abandoning the requirement to identify a certain OS would simplify the maintenance burden significantly. The lookup-table is:
my %patch = ('hp-ux' => 'hpux', x => 'x11', plan => 'plan9', osf => 'osf1', xfree => 'xfree86', minix => 'Minix+2.0', opensuse => 'suse', rhel => 'redhat', );

So, how shall we proceed?

Update: Right, RHEL is not identical to RedHat Linux, but the intention was to come close to the family, which is rather RedHat than FreeBSD... However, it can be corrected by removing the rhel => 'redhat' entry from the hash above (see: mr_mischief's comment).
Update2: If you like to experiment with the effect of the man and mskb styles, go to your Display Settings and add something to the On-Site CSS Markup - section, e.g. (nobody says it has to look good!)

.man { border: 1px solid #ff0000; background-color: #e6e6e6; } .mskb { border: 1px dotted #0000ff; background-color: #e6e6e6; }

shell shell <a class="man" href="">shell</a>
env man:env <a class="man" href="">man:env</a>
env(1) man:env(1) <a class="man" href="">man:env(1)</a>
env (1) man:env(1) <a class="man" href="">man:env(1)</a>
[man1://env] man:env(1) <a class="man" href="">man:env(1)</a>
env (sunos) SUNOS:env <a class="man" href="">SUNOS:env</a>
env (sunos) SUNOS:env <a class="man" href="">SUNOS:env</a>
env (sOlarIS 77) SOLARIS_77:env <a class="man" href="">SOLARIS_77:env</a>
env(1)(susE 55.11) SUSE_55.11:env(1) <a class="man" href="">SUSE_55.11:env(1)</a>
passwd (hp-ux) (5) HP-UX:passwd(5) <a class="man" href="">HP-UX:passwd(5)</a>
[man1://passwd(5) (redhat)| should override section 1 by 5] should override section 1 by 5 <a class="man" href="">should override section 1 by 5</a>
man page of env section(1) man page of env section(1) <a class="man" href="">man page of env section(1)</a>
man page of env section(1)|blah man page of env section(1)|blah <a class="man" href="">man page of env section(1)|blah</a>
passwd ( 1 ) ( Solaris) SOLARIS:passwd(1) <a class="man" href="">SOLARIS:passwd(1)</a>
passwd(5)(suse) SUSE:passwd(5) <a class="man" href="">SUSE:passwd(5)</a>
passwd(5)(rhel) RHEL:passwd(5) <a class="man" href="">RHEL:passwd(5)</a>
passwd (5) (opensuse) OPENSUSE:passwd(5) <a class="man" href="">OPENSUSE:passwd(5)</a>
passwd (5) (openSuSE) (11) OPENSUSE:passwd(11)(5) <a class="man" href="">OPENSUSE:passwd(11)(5)</a>
[mskb://245225] MSKB:245225 <a class="mskb" href="">MSKB:245225</a>
[mskb:// 24 5 225 ] MSKB:245225 <a class="mskb" href="">MSKB:245225</a>
[msKB:// 24 5225| ] MSKB:245225 <a class="mskb" href="">MSKB:245225</a>
[mskb://245225 | Perl and IE ] Perl and IE <a class="mskb" href="">Perl and IE</a>

Replies are listed 'Best First'.
Re^2: Suggestion for new shortcut-tags: [man://] and [mskb://]
by mr_mischief (Monsignor) on Oct 31, 2008 at 20:56 UTC
    The RedHat links do not appear to be RHEL as you seem to assume. They appear to be for "RedHat Linux" versions 4.2 through 9 which predate RedHat Enterprise Linux 1 and Fedora Core 1.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://720539]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-05-27 02:06 GMT
Find Nodes?
    Voting Booth?