diff options
Diffstat (limited to 'web')
145 files changed, 0 insertions, 19439 deletions
diff --git a/web/.gitignore b/web/.gitignore deleted file mode 100644 index d2ec122..0000000 --- a/web/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.var -*.en.html -*.tmp -*.pod
\ No newline at end of file diff --git a/web/.htaccess b/web/.htaccess deleted file mode 100644 index 8d5d297..0000000 --- a/web/.htaccess +++ /dev/null @@ -1,25 +0,0 @@ -DirectoryIndex index.en.html index.html -ErrorDocument 404 http://oss.oetiker.ch/mrtg/404.en.html -RewriteEngine On -RewriteRule mrtg.html http://oss.oetiker.ch/mrtg/ [R=301,L] -RewriteRule index.html http://oss.oetiker.ch/mrtg/ [R=301,L] -RewriteRule reference.html http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html [R=301,L] -RewriteRule mrtg-nt-guide.html http://oss.oetiker.ch/mrtg/doc/mrtg-nt-guide.en.html [R=301,L] -RewriteRule cfgmaker.html http://oss.oetiker.ch/mrtg/doc/cfgmaker.en.html [R=301,L] -RewriteRule unix-guide.html http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html [R=301,L] -RewriteRule mrtg-unix-guide.html http://oss.oetiker.ch/mrtg/doc/mrtg-unix-guide.en.html [R=301,L] -RewriteRule links.html http://oss.oetiker.ch/mrtg/3party.en.html [R=301,L] -RewriteRule mrtg-rrd.html http://oss.oetiker.ch/mrtg/doc/mrtg-rrd.en.html [R=301,L] -RewriteRule users.html http://people.ee.ethz.ch/~oetiker/webtools/mrtg-trac/wiki/MrtgUsers [R=302,L] -RewriteRule compat.html http://people.ee.ethz.ch/~oetiker/webtools/mrtg-trac/wiki/MrtgCompat [R=302,L] -#RewriteRule pub(/.*) http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub$1 [R=302,L] -#RewriteRule pub$ http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/ [R=302,L] -# for some reason there are odd requests sometimes -RewriteRule http:/([^/].*) http://$1 [R=301,L] -<FilesMatch ".htaccess"> - Order Allow,Deny - Allow From All -</FilesMatch> -<FilesMatch "mirror.html"> - SetHandler cgi-script -</FilesMatch> diff --git a/web/.wmkrc b/web/.wmkrc deleted file mode 100755 index 9600053..0000000 --- a/web/.wmkrc +++ /dev/null @@ -1,3 +0,0 @@ --o LANG_VAR:%BASE.var --o (ALL-LANG_*)+LANG_EN:%BASE.en.html@ug+x -#-o (ALL-LANG_*)+LANG_DE:%BASE.de.html@ug+x diff --git a/web/.wmlrc b/web/.wmlrc deleted file mode 100755 index 5643506..0000000 --- a/web/.wmlrc +++ /dev/null @@ -1,17 +0,0 @@ --DROOT~. - -############################### -# Language setup --DLANGS="en" - -############################### - -#-I/home/eedesign/public_html -# last has priority --I. - --E $(ROOT)/bin/htmlfix.sh --P $(ROOT)/bin/headfix.pl - -# tune mp4h behaviour (expansion 0 means complain about everything) --W "2,--expansion=0" diff --git a/web/192.33.92.249_fa4_1-day.png b/web/192.33.92.249_fa4_1-day.png Binary files differdeleted file mode 100644 index faea063..0000000 --- a/web/192.33.92.249_fa4_1-day.png +++ /dev/null diff --git a/web/3party.wml b/web/3party.wml deleted file mode 100644 index f1110b6..0000000 --- a/web/3party.wml +++ /dev/null @@ -1,228 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "3party"> - - <h1>MRTG Companion Sites</h1> - - <p>If you have a new URL for this page, please drop <a href="mailto:oetiker@ee.ethz.ch">me a note</a> with the relevant Information.</p> - - <h2>MRTG Comunities and Portals</h2> - - <ul> - <li><a href="http://www.steveshipway.org/cfgmaker">Steve Shipway's MRTG Template Library</a></li> - - <li><a href="http://www.plixer.com/support/mrtg_repository.php">Plixer MRTG Configuration Template Archive</a></li> - - <li><a href="http://howto.aphroland.org/HOWTO/MRTG">MRTG Howto Collection</a> by <a href="mailto:mrtg{at}aphroland.org">nate</a></li> - - <li><a href="http://fr.groups.yahoo.com/group/Reseaux-Supervision">French Language MRTG and RRDTOOL Mailinglist</a></li> - - <li><a href="http://www.wtcs.org/snmp4tpc/">Support web for SNMP, Windows NT, NetWare and MRTG</a> by Garth K. Williams.</li> - </ul> - - - <h2>Setup Instructions and Installer</h2> - <ul> - <li><a href="http://www.openxtra.co.uk/products/mrtg-xtra.htm">Prepackaged MRTG for windows</a> by OPENXTRA Limited</li> - - <li><a href="http://open-innovations.com/mrtgbundle.html">MRTG Bundle 2.0</a> a ready to run MRTG setup for Windows by <a href="mailto:chris{at}chrisdos.com">Chris Dos</a></li> - - <li><a href="http://www.darwinports.org/ports/?by=name&substr=mrtg">Installing MRTG on a Mac from darwinports.</a></li> - - <li><a href="http://www.seyhan.biz/dokuman/MRTG.pdf">Turkish MRTG documentation</a> by <a href="mailto:seyhan{at}hotmail.com">Seyhan Tekelioglu</a></li> - - <li><a href="http://www.persianadmins.com/site/articles/linux/install_and_config_mrtg.html">How to install and configure MRTG for Linux (in Farsi)</a> by <a href="mailto:reza{at}behroozi.info">Reza Behroozi</a></li> - - <li><a href=" http://www.murat.ws/mrtg-ve-cisco/">Setup Instructions for MRTG and CISCO (and USR9108) on Fedora 7 in Turkish</a> by <a href="mailto:murat{AT}murat.ws">Murat Ugur EMINOGLU</a></li> - - <li><a href="http://oss.oetiker.ch/mrtg/pub/contrib/MRTG_turkish_tutorial.pdf">Another Turkish MRTG tutorial</a> by <a href="mailto:celak{at}ttnet.net.tr">Celal Ünalp</a></li> - - <li><a href="http://www.eidenberger.com/mrtg/mrtgtut1.php">Implémenter Mrtg sur une plateforme Windows Nt/2k/2k3/Xp et son serveur web IIS</a> par <a href="mailto:Manuel{at}eidenberger.com">Manuel Eidenberger</a></li> - - <li><a href="http://linuxeiros.planetaclix.pt/software/mrtg.html">MRTG Install instructions in Portugese</a> par <a href="mailto:joaomiguelrebelo{at}clix.pt">João Rebelo</a></li> - - <li><a href="http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/mrtg/">Setup MRTG with Red hat Enterprise Linux 3</a> by <a href="mailto:vivek{at}nixcraft.com">Vivek G Gite</a></li> - - <li><a href="http://www.netmon.org/">NetMon Website</a> by Jim Hunt. It is the home of the MRTG for Dummies tutorial</li> - - <li>MRTG on Linux setup instructions in <a href="http://www.linux-sottises.net/mrtg.php">French</a> and <a href="http://www.linux-sottises.net/en_mrtg.php">English</a> by TNK</li> - - <li><a href="http://www.debianhelp.co.uk/mrtg.htm">MRTG Configuration in Debian</a></li> - - <li><a href="http://www.geocities.com/rjayasin/RH7X-mrtg-howto.htm">MRTG Installation in 6 Steps for RH7X</a> by Ruwan Jayasinghe (rjayasin-at-lausd.k12.ca.us)</li> - - <li><a href="http://www.leh.net/~kevin/docs/mrtg/index_1.html">Tips for how mrtg can assist a NOC or Monitoring Center in first line troubleshooting</a> by <a href="mailto:kevin{at}leh.net">Kevin Howard</a></li> - - <li><a href="http://www.linuxtech.cc/article001.php">Building Linux Monitoring Portals with Open Source</a> by O'Neill, Donald</li> - </ul> - - <h2>Config Builders</h2> - <ul> - <li><a href="http://home.no.net/viggoeri/TorpXTG/">TorpX-TG</a> MRTG Configuration Frontend for Windows users by <a href="http://www.vman-software.tk/">Viggo Eriksen</a>.</li> - - <li><a href="http://projects.virtualflat.ch/mct/">MCT: MRTG Configuration Tool</a>. A PHP based frontend to configuring mrtg.</li> - - <li><a href="http://www.claridion.com/downloads/MRTGgui.htm">MRTG GUI - Rapid CFG Builder</a> a Windows GUI for the quick creation and maintainance of MRTG configuration files. <a href="mailto:salvatore.cimmino{at}claridion.com">Salvatore Cimmino</a></li> - - <li><a href="http://sourceforge.net/projects/mrtgconfig">Mrtg Config Generator</a> by <a href="mailto:DElder{at}novacoast.com">Dan Elder</a>.</li> - - <li><a href="http://sourceforge.net/projects/gnulsms2mrtg/">A mrtg config generator</a> supporting Allot NetEnforcer, Bluecoat/Cacheflow Security Products, Cyclades TS and ACS, Fortinet firewalls, Lucent LSMS / Brick firewalls, and any MIB2 device, Microsoft Windows 2000/XP/2003 by John Baker</li> - - <li><a href="http://savannah.gnu.org/projects/cfgstoragemk/">Cfgstoragemaker</a> can be used to generate a MRTG config file in order to graph all the storage devices (disk, memory and swap) of one or more specific host(s) via SNMP by <a href="mailto:cyril{at}bouthors.org">Cyril Bouthors</a></li> - - <li><a href="http://www.novell.chel.ru/start.php?dir=plugin/project/mrtgwebcfg&app=main&lng=english">MRTGWebCfg</a> a php based web frontend to mrtg with rrdtool by <a href="mailto:neo@chel.skbkontur.ru">Michael Grigorjev</a>.</li> - </ul> - - <h2>MRTG Add-Ons</h2> - <ul> - <li><a href="http://bangbangsoundslikemachinery.blogspot.com/2010/12/mrtg-percentile-calculation.html">Obtaining percentiles from MRTG Logs</a> Philip Damian-Grint has a solution.</li> - - <li><a href="http://mkmrtg.blogspot.com/">mkmrtg.sh</a> An easy way to see your stats; Designed for new and old users of MRTG by Joe McShinsky.</li> - - <li><a href="http://www.tenox.tc/out/#ttg">Little cli for queering a routers bandwith info live via snmp </a> by Antoni Sawicki</li> - - <li><a href="http://chuck.steel.googlepages.com/googlemodules">iGoogle module for mrtg</a> by <a href="http://chuck.steel.googlepages.com">Chuck Steel</a></li> - - <li><a href="http://ipsyn.net/projects/rotate_url/">Rotate MRTG graphs inside a single web browser session</a> by <a href="mailto:nstefani{at}ipsyn.net">Nicolas STEFANI</a></li> - - <li><a href="http://www.ronny-goerner.de/patch/">95%ile patch for MRTG-2.4.17</a> by <a href="mailto:support{at}pghosting.de">pgHosting</a></li> - - <li><a href="http://www.geocities.com/aisvc">MRTG-Central front end</a> by <a href="mailto:aisvc{at}yahoo.com">Mark Anderson</a></li> - - <li><a href="http://phpmrtgadmin.sourceforge.net">phpMrtgAdmin front end</a> by <a href="mailto:phpmrtgadmin{at}users.sourceforge.net">Ildar N. Shaimordanov</a></li> - - <li><a href="http://mrtgfe.sourceforge.net">MRTGFE --- builds a dynamic target index with php</a> by <a href="mailto:i_am_fishing{at}bigpond.com">Greg West</a></li> - - <li>Baer explains how to <a href="http://members.tik.com.au/mrtg/default.htm">setup mrtg, 14all and rrdtool on NT</a></li> - - <li><a href="http://www.steveshipway.org/software/">Frontend for the MRTG/RRDTOOL combo</a> by Steve Shipway. There is also a <a href="http://www.steveshipway.org/forum">support forum</a> for this on Steves site.</li> - - <li><a href="http://www.genis-x.com/launcher">Launcher</a> a free cron-like service for Windows NT/2k by <a href="mailto:adstar{at}genis-x.com">Adam Niedzwiedzki</a></li> - - <li><a href="http://www.geocities.com/mrtg_daemon">Windows users - A daemon that enables you to make changes to your MRTG scripts without having to end the Perl task</a>. This site also contains the Windows GUI script maker for MRTG (by <a href="mailto:david.sawyer{at}uk.mckhboc.com">David Sawyer)</a></li> - - <li><a href="http://www.loplop.net/projects/1minMRTG">How to patch MRTG w/ RRDTool to get 1 minute updates in the RRD databases and so on the graphs</a> by <a href="mailto:Nick{at}loplop.net">Nicolas Sayer</a></li> - - <li><a href="http://cmeik.gawble.net/mrtg/">A Very Customizable Perl MRTG Config Builder</a> by <a href="mailto:cmeik{at}gawble.net">Chris Meiklejohn</a></li> - - <li><a href="http://iserv.nl/traffic/totaal/">Analyze *.log files for monthly total</a> by <a href="mailto:Stimpy{at}iserv.nl">Seth Mos</a>.</li> - - <li><a href="http://www.netmail.kz/adgsoft/mrtg_lp.zip">Windows version of Seth's *.log analyzer</a> by <a href="mailto:noc{at}netmail.kz">Eugeny Hohlov</a>.</li> - - <li><a href="http://www.geocities.com/josef_wendel">Collects and outputs daily and monthly totals as html file with embedded png-graphic.</a> by <a href="mailto:josef.wendel{at}web.de">Josef Wendel</a>.</li> - - <li><a href="http://www.geocities.com/mrtgutil/">Script to collect and store the daily MRTG graph</a> by <a href="mailto:yijie_li{at}hotmail.com">Yijie Li</a>.</li> - - <li><a href="http://wizardsworks.org/GoofyTG/">Goofy TG</a> -- create a webpage with physical images of your network gear and get mrtg graphs by clicking on ports by <a href="mailto:chandleg{at}wizardsworks.org">Sir Ace</a></li> - - <li><a href="http://net-snmp.sourceforge.net/tutorial/tutorial-5/mrtg/index.html">The official word on using NET-SNMP with mrtg</a>. Net-SNMP is the <a href="http://net-snmp.sourceforge.net/">sourceforged</a> version of UCD-SNMP.</li> - - <li><a href="http://www.snert.com/Software/mod_watch/">mod_watch</a> an Apache to MRTG interface module that allows you to collect bytes in & out per virtual host or per file owner. by <a href="mailto:achowe{at}snert.com">Anthony Howe</a>.</li> - </ul> - - - - - <h2>Monitoring Special Devices and Applications</h2> - - <ul> - <li>Snippets on monitoring <a href="./pub/contrib/UPSAPC.txt">APC UPS</a>, <a href="./pub/contrib/EMUAPC.txt">APC EMU</a> and a <a href="./pub/contrib/ContivityNortel.txt"> Nortel Contivity VPN Router</a> with MRTG.</a> by Arkadiusz Nowicki</li> - - <li><a href="http://www.cluebyfour.org/~streiner/mrtg/fwsm.html">Cisco Firewall Service Modules (FWSMs) monitoring with MRTG.</a> by Justin M. Streiner</li> - - <li><a href="http://www.david-taylor.myby.co.uk/mrtg/daily_ntp.html">NTP Monitoring</a> by David J. Taylor</li> - - <li><a href="http://www.david-taylor.myby.co.uk/mrtg/Eumetcast.html">Satelite Signal Quality Monitoring</a> by David J. Taylor</li> - - <li><a href="http://www.timewind.se/rsyncmrtg/index_eng.html">Monitoring an Rsync Server</a> by Stefan Sundberg</li> - - <li><a href="http://alex.kruijff.org/FreeBSD/Traffic_Report.html">Monitoring FreeBSD IPFW with MRTG</a> by Alex de Kruijff</li> - - <li><a href="http://forge.novell.com/modules/xfmod/project/?mrtgext">MRTG Extensions for Netware</a> by <a href="mailto:drews{at}engr.wisc.edu">James Drews</a></li> - - <li><a href="http://www.castellan.net/mrtg.html">How to setup MRTG to monitor your windows servers</a> by Chris Willis</li> - - <li><a href="http://www.serverroomstuff.com/reviews/management/062005/06032005-a1.asp">Monitoring APC AP9319 EMU with mrtg/rrdtool</a> by <a href="mailto:andras.bellak{at}serverroomstuff.com">Andras Bellak</a>.</li> - - <li><a href="http://pwo.de/projects/mrtg/">Variouse software probes for mrtg</a> by <a href="mailto:pwo{at}guug.de">Peter "WWW" Osel</a>.</li> - - <li><a href="http://www.rdrop.com/mrtg/weather.html">Weather monitoring monitoring with Davis Weather Wizard III</a> by e <a href="mailto:alan{at}batie.org">Alan Batie</a></li> - - <li><a href="http://www.blahz.ab.ca/mrtginfo">Basice SETI Monitoring</a> by <a href="mailto:msroest{at}blahz.ab.ca">Mike Roest</a></li> - - <li><a href="http://www.nwlab.net/tutorials/m0n0wall/monowall-mrtg.html">Use MRTG with m0n0wall</a> by <a href="mailto:mail{at}uridium.net">Mirko Kulpa</a></li> - - <li><a href="http://www.ionum.ch/tools/">Netgear Router MR314</a> MRTG poller script by <a href="mailto:info{at}ionum.ch">Stefan Kolb</a>.</li> - - <li><a href="http://www.joerg.cc/cgi-bin/wiki.pl?MyMRTG_Page">Monitoring Firewall 1</a> by Joerg Fritsch</li> - - <li><a href="http://www.geocities.com/passportmrtg/">Using MRTG with Nortel Passport Devices</a></li> - - <li><a href="http://members.cox.net/jeepnsam/linksys.html">Monitoring Linksys Router</a> by Brian Akins</li> - - <li><a href="http://www.networktechinc.com/enviro-sems-mrtg-app.html">NTI's ENVIROMUX Server Environment Monitoring System Graphs Critical Environmental Conditions with MRTG by Deepa Nair.</a></li> - - <li><a href="http://www.triponthis.net/Matt/USGII/index.htm">Notes on monitoring the Nomadix Universal Service Gateway II</a> by <a href="mailto:mevans3%20.%20triad.rr.com">Matthew Evans</a></li> - - <li><a href="http://www.thiscow.com/dl/bgp-peers-1.5.pl">Program that generates a MRTG configuration file for graphing traffic to and from all peers present on an exchange point (MAE...), using mac-accounting. Tested with Cisco 720x and Cisco 750x</a> by by <a href="mailto:erwan{at}de.clara.net">Lerale Erwan</a></li> - - <li><a href="http://www.mikrotik.com/docs/ros/2.8/appex/mrtg1.content">MRTG monitoring of a MikroTik LINUX based router, as documented by MikroTik.</a></li> - - <li><a href="http://www.cisco.com/univercd/cc/td/doc/cisintwk/intsolns/dialsol/nmssol/mrtg.htm">Ciscos Page on MRTG and AS5300</a></li> - - <li><a href="http://www.cyberguard.com/snapgear/cgi-bin/fom?_highlightWords=mrtg&file=240">Configuring MRTG for SnapGear Routers</a></li> - - <li><a href="http://www.xolution.ch/mrtg/">Monitoring Brocade Silkworm Fibre Channel Switches</a> by <a href="mailto:rolf{at}xolution.ch">Jordi Rolf</a></li> - - <li><a href="http://www.cluebyfour.org/~streiner/redback.html">Using MRTG with Redback SMS platforms</a> by <a href="mailto:streiner{at}stargate.net">Justin M. Streiner</a></li> - - <li><a href="http://vegan.net/MRTG">MRTG and Loadbalancing Devices</a> by <a href="mailto:tony{at}vegan.net">Tony Bourke</a></li> - - <li><a href="http://home.online.no/~jorner/Bay_and_FR.html">How to monitor FrameRelay PVC's on BayNetworks routers</a> by <a href="mailto:jorn{at}jorneriksen.com">Jørn Eriksen</a>.</li> - - <li><a href="http://feenix.burgiss.net/linux/mrtg/5660/">Monitor Efficient Networks SS 5660 ADSL modem/router</a>. By <a href="mailto:hburgiss{at}bellsouth.net">Hal Burgiss</a>.</li> - - <li><a href="http://www.polesye.net/roma/">Monitoring Atmel chipset based Access Points (GL2411AP and Linksys WAP11)</a> by <a href="mailto:roma{at}polesye.net">Roman Festchook</a></li> - - <li><a href="http://www.anetzb.de/upnp2mrtg/">Monitoring a FritzBox</a> by <a href="mailto:upnp2mrtg{at}anetzb.de">Michael Tomschitz</a></li> - - <li><a href="http://www.sensatronics.com/downloads/mrtg_temptrax_howto.pdf">Graph server room temperatures using the Sensatronics TempTrax device</a> by <a href="mailto:kwright{at}sensatronics.com">Keith A.Wright</a>.</li> - - <li><a href="http://www.geek.net.au/mrtg.html">Assorted Linux RedHat 7.x MRTG stand-alone configurations for graphing system activity incl network traffic without using SNMP</a> by <a href="mailto:cnd{at}geek.net.au">Chris Drake</a> .</li> - - <li><a href="http://www.dmzs.com/~dmz/projects/mrtgsystemload.html">Basic Script to graph load/memory/[system|user|idle]load/cpu/etc</a> by <a href="mailto:zendzidm{at}wellsfargo.com">David M. Zendzian</a></li> - - <li><a href="http://itc1.inftech.com/mrtg/mrtg.html">Monitor system memory with Top (version 3.5beta12) on Solaris</a> by <a href="mailto:admin{at}inftech.com">Ben Fallah</a></li> - - <li><a href="http://www.bursztein.net/prog/stat/">Generic Stats Gatherer for Linux and FreeBSD</a> use it with mrtg or rrdtool for you monitoring tasks. By <a href="mailto:elie{at}bursztein.net">Elie Bursztein</a>.</li> - - <li><a href="http://www.visi.com/~corwin/mrtg/">Monitoring Novel 5.1</a> by <a href="mailto:greg.riedesel{at}ci.stpaul.mn.us">Greg Riedesel</a></li> - - <li><a href="http://mbm2mrtg.hn.org">MBM2MRTG</a> lets you graph MBM5 (Motherboard Monitor) data by <a href="mailto:dev{at}mbm2mrtg.hn.org">MBM2MRTG Team</a></li> - - <li><a href="http://snmpboy.msft.net">Monitoring NT Servers with MRTG</a> Courtesy of Microsoft Global Networking, <a href="mailto:ottoh{at}microsoft.com">Otto J. Helweg</a></li> - - <li><a href="http://www.crossley-nilsen.com/Linux/Mrtg_and_Trend_Viruswall/mrtg_and_trend_viruswall.html">Monitoring Trend InterScan Viruswall</a> by <a href="mailto:thomas.nilsen{at}doc-s.co.uk">Thomas Nilsen</a></li> - - <li><a href="http://www.megalinux.net/archives/38.html">Monitoring DNS Server(BIND) by Ram Prasad</a></li> - - <li><a href="http://www.inter7.com/qmailmrtg7">Qmail Monitoring</a> by Ken Jones</li> - - <li><a href="http://dev.publicshout.org/qmrtg/">Alternative Qmail Monitoring</a> by mij at dev.publicshout.org</li> - - <li><a href="http://datacenter.seven.it//modules.php?name=Content&pa=showpage&pid=2">Graph ipfm data</a> by Enrico Centenaro</li> - - <li><a href="http://users.2z.net/rpuhek/scripts_public/spamd/">Spamassassin Monitoring</a> by <a href="mailto:rpuhek{at}etnsystems.com">Rich Puhek</a>.</li> - - <li><a href="http://www.earlham.edu/~littejo/software/mrtg-mailstats.html">Alternate MRTG Mailstats program</a> by <a href="mailto:littejo{at}earlham.edu">John Rowan Littell</a></li> - - <li><a href="http://www.bitbybit.dk/mysqlfaq/mrtg-mysql-load/">A small extension to MRTG which will allow people running MySQL servers to monitor the performance of the server.</a> by <a href="mailto:carsten.pedersen{at}bitbybit.dk">Carsten H. Pedersen</a></li> - - <li><a href="http://web.csma.biz/apps/ntpstat.shtml">Script to display NTP clock drift</a> by <a href="mailto:c{at}csma.biz">Corey S. McFadden</a></li> - - <li><a href="http://vvv.csma.biz/apps/mrtg-spamscorer.shtml">Graph Spam Scores from MailScanner / SpamAssassin</a> by <a href="mailto:c{at}csma.biz">Corey S. McFadden</a></li> - - <li><a href="http://anhold.com/mrtgstuff/">FTP usage grapher by</a> <a href="mailto:jon{at}anhold.com">Jon Anhold</a></li> - - <li><a href="http://www.webinject.org/mrtgplugin.html">WebInject</a> performance meter by Corey Goldberg.</li> - </ul> - diff --git a/web/404.wml b/web/404.wml deleted file mode 100644 index 4a0967c..0000000 --- a/web/404.wml +++ /dev/null @@ -1,9 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "404"> - - -<H1>Sorry this page does not exist</H1> - -<p>The MRTG website has been restructured. -Most things are still around, but probably under a new address.</p> - diff --git a/web/award-white.png b/web/award-white.png Binary files differdeleted file mode 100644 index 40d0b24..0000000 --- a/web/award-white.png +++ /dev/null diff --git a/web/bin/fix-hrefs.pl b/web/bin/fix-hrefs.pl deleted file mode 100755 index e34414e..0000000 --- a/web/bin/fix-hrefs.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/sepp/bin/perl-5.8.8 -w - -use strict; -use HTML::Parser; - -my $p = HTML::Parser->new(api_version => 3); -$p->handler(start => \&startsub, 'tagname, text'); -#$p->handler(end => \&endsub, 'tagname, text'); -$p->handler(default => sub { print shift() }, 'text'); -$p->parse_file(shift||"-") or die("parse: $!"); - -sub startsub { - my $tag = shift; - my $text = shift; - - if ($tag eq "a") { - $text =~ s,".*?/web/doc/,",; - $text =~ /^http/ || $text =~ s,\.html,.en.html,; - } - print $text; -} diff --git a/web/bin/fix-pod2html-orig.pl b/web/bin/fix-pod2html-orig.pl deleted file mode 100755 index fa51400..0000000 --- a/web/bin/fix-pod2html-orig.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use HTML::Parser; - -# fix pod2html output: -# v1.0: defer </dd> and </dt> tags until -# the next <dd>, <dt> or </dl> - -# v1.1: don't nest any <a> elements; -# end one before beginning another - -# v1.2: insert <dd> tags if <dl> occurs -# inside <dt> - -# v1.3: <a> anchors must not start with a digit; -# insert a letter "N" at the start if they do - -# v1.4: insert the "N" letter into <a href="#xxx"> too. - -my $p = HTML::Parser->new(api_version => 3); -$p->handler(start => \&startsub, 'tagname, text'); -$p->handler(end => \&endsub, 'tagname, text'); -$p->handler(default => sub { print shift() }, 'text'); -$p->parse_file(shift||"-") or die("parse: $!"); - -my @stack; -my $a=0; - -sub startsub { - my $tag = shift; - my $text = shift; - if ($tag eq "dl") { - if (@stack and $stack[0] eq "dt") { - $stack[0] = "dd"; - print "</dt><dd>"; - } - unshift @stack, 0; - } - if (($tag eq "dt" or $tag eq "dd") and $stack[0]) { - print "</$stack[0]>"; - $stack[0] = 0; - } - if ($tag eq "a") { - if ($a) { - print "</a>"; - } else { - $a++; - } - $text =~ s/(name="|href="#)(\d)/$1N$2/; - } - print $text; -} - - -sub endsub { - my $tag = shift; - my $text = shift; - if ($tag eq "dl") { - print "</$stack[0]>" if $stack[0]; - shift @stack; - } - if ($tag eq "a") { - if ($a) { - print "</a>"; - $a--; - } - } elsif ($tag eq "dd" or $tag eq "dt") { - $stack[0] = $tag; - } else { - print $text; - } -} diff --git a/web/bin/fix-pod2html.pl b/web/bin/fix-pod2html.pl deleted file mode 100755 index 3f12e69..0000000 --- a/web/bin/fix-pod2html.pl +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/sepp/bin/perl-5.8.8 -w - -use strict; -use HTML::Parser; - -# fix pod2html output: -# v1.0: defer </dd> and </dt> tags until -# the next <dd>, <dt> or </dl> - -# v1.1: don't nest any <a> elements; -# end one before beginning another - -# v1.2: insert <dd> tags if <dl> occurs -# inside <dt> - -# v1.3: <a> anchors must not start with a digit; -# insert a letter "N" at the start if they do - -# v1.4: insert the "N" letter into <a href="#xxx"> too. - -my $p = HTML::Parser->new(api_version => 3); -$p->handler(start => \&startsub, 'tagname, text'); -$p->handler(end => \&endsub, 'tagname, text'); -$p->handler(default => sub { print shift() }, 'text'); -$p->parse_file(shift||"-") or die("parse: $!"); - -my @ddstack; -my @listack; -my $a=0; - -sub startsub { - my $tag = shift; - my $text = shift; - if ($tag eq "dl") { - if (@ddstack and $ddstack[0] eq "dt") { - $ddstack[0] = "dd"; - print "</dt><dd>"; - } - unshift @ddstack, 0; - } - if ($tag =~ /^[uo]l$/) { - unshift @listack, 0; - } - if (($tag eq "dt" or $tag eq "dd") and $ddstack[0]) { - print "</$ddstack[0]>"; - $ddstack[0] = 0; - } - if (($tag eq "li") and $listack[0]) { - print "</$listack[0]>"; - $listack[0] = 0; - } - if ($tag eq "a") { - if ($a) { - print "</a>"; - } else { - $a++; - } - $text =~ s/(name="|href="#)(\d)/$1N$2/; - } - print $text; -} - - -sub endsub { - my $tag = shift; - my $text = shift; - if ($tag eq "dl") { - print "</$ddstack[0]>" if $ddstack[0]; - shift @ddstack; - } elsif ($tag =~ /^[uo]l$/) { - print "</$listack[0]>" if $listack[0]; - shift @listack; - } - - if ($tag eq "a") { - if ($a) { - print "</a>"; - $a--; - } - } elsif ($tag eq "dd" or $tag eq "dt") { - $ddstack[0] = $tag; - } elsif ($tag eq "li") { - $listack[0] = $tag; - } else { - print $text; - } -} diff --git a/web/bin/headfix.pl b/web/bin/headfix.pl deleted file mode 100755 index 7c0ef90..0000000 --- a/web/bin/headfix.pl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/sepp/bin/perl-5.8.8 -undef $/; #slurp alll -$_ = <>; -while (s/<page[\s\n\r]+(\S+)\s*=\s*(?:"([^"]+)"|([^"\s>]+))/<page/si){ - chomp($VAL{uc($1)}= $2 ? $2: $3); -} - -if ($VAL{TYPE} eq 'lone') { - $sub="_$VAL{TYPE}"; -} - -s|<page[\s\n\r]*/?>|#include <inc/template${sub}.inc> PAGE="$VAL{PAGE}" AUTHOR="$VAL{AUTHOR}" TYPE="$VAL{TYPE}"\n|si; - -print; - diff --git a/web/bin/htmlfix.sh b/web/bin/htmlfix.sh deleted file mode 100755 index 92a5559..0000000 --- a/web/bin/htmlfix.sh +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh -case $1 in -*.html) -# tidy -latin1 -wrap 0 -q -asxhtml $1 >$1.fixed 2>$1.report -# TIDY_RET=$? - exit 0 - TIDY_RET=0 - perl -i -0777 -p -e 's/^\s*//;s{="mailto:(oetiker|tobi|tobias)@(oetiker.ch|ee.ethz.ch)"}{="http://tobi.oetiker.ch/"}g;s{="mailto:(\S*?)\@(\S*?)"}{="mailto:$1@..delete..this..$2"}g' $1.fixed - # yes, beleive it or not IE chockes on propper xhtml pages ... sigh - perl -i -0777 -p -e 's/^\s*<\?xml.+?\?>\s*//;' $1.fixed - if [ $TIDY_RET != 0 ]; then - echo Parsing: $1 - egrep -v "^(HTML Tidy|$1:|To learn|Please send|HTML and CSS|Lobby your)" $1.report - rm $1.report - name=`basename $1 .html` - name=`basename $name .en` - name=`basename $name .de` - touch -m -t 198001010000 $name.*.html - exit 1 - fi - mv $1.fixed $1 - rm $1.report -;; -esac diff --git a/web/bin/lib/Pod/.exists b/web/bin/lib/Pod/.exists deleted file mode 100644 index e69de29..0000000 --- a/web/bin/lib/Pod/.exists +++ /dev/null diff --git a/web/bin/lib/Pod/Escapes.pm b/web/bin/lib/Pod/Escapes.pm deleted file mode 100644 index de4d75a..0000000 --- a/web/bin/lib/Pod/Escapes.pm +++ /dev/null @@ -1,721 +0,0 @@ - -require 5; -# The documentation is at the end. -# Time-stamp: "2004-05-07 15:31:25 ADT" -package Pod::Escapes; -require Exporter; -@ISA = ('Exporter'); -$VERSION = '1.04'; -@EXPORT_OK = qw( - %Code2USASCII - %Name2character - %Name2character_number - %Latin1Code_to_fallback - %Latin1Char_to_fallback - e2char - e2charnum -); -%EXPORT_TAGS = ('ALL' => \@EXPORT_OK); - -#========================================================================== - -use strict; -use vars qw( - %Code2USASCII - %Name2character - %Name2character_number - %Latin1Code_to_fallback - %Latin1Char_to_fallback - $FAR_CHAR - $FAR_CHAR_NUMBER - $NOT_ASCII -); - -$FAR_CHAR = "?" unless defined $FAR_CHAR; -$FAR_CHAR_NUMBER = ord($FAR_CHAR) unless defined $FAR_CHAR_NUMBER; - -$NOT_ASCII = 'A' ne chr(65) unless defined $NOT_ASCII; - -#-------------------------------------------------------------------------- -sub e2char { - my $in = $_[0]; - return undef unless defined $in and length $in; - - # Convert to decimal: - if($in =~ m/^(0[0-7]*)$/s ) { - $in = oct $in; - } elsif($in =~ m/^0?x([0-9a-fA-F]+)$/s ) { - $in = hex $1; - } # else it's decimal, or named - - if($NOT_ASCII) { - # We're in bizarro world of not-ASCII! - # Cope with US-ASCII codes, use fallbacks for Latin-1, or use FAR_CHAR. - unless($in =~ m/^\d+$/s) { - # It's a named character reference. Get its numeric Unicode value. - $in = $Name2character{$in}; - return undef unless defined $in; # (if there's no such name) - $in = ord $in; # (All ents must be one character long.) - # ...So $in holds the char's US-ASCII numeric value, which we'll - # now go get the local equivalent for. - } - - # It's numeric, whether by origin or by mutation from a known name - return $Code2USASCII{$in} # so "65" => "A" everywhere - || $Latin1Code_to_fallback{$in} # Fallback. - || $FAR_CHAR; # Fall further back - } - - # Normal handling: - if($in =~ m/^\d+$/s) { - if($] < 5.007 and $in > 255) { # can't be trusted with Unicode - return $FAR_CHAR; - } else { - return chr($in); - } - } else { - return $Name2character{$in}; # returns undef if unknown - } -} - -#-------------------------------------------------------------------------- -sub e2charnum { - my $in = $_[0]; - return undef unless defined $in and length $in; - - # Convert to decimal: - if($in =~ m/^(0[0-7]*)$/s ) { - $in = oct $in; - } elsif($in =~ m/^0?x([0-9a-fA-F]+)$/s ) { - $in = hex $1; - } # else it's decimal, or named - - if($in =~ m/^\d+$/s) { - return 0 + $in; - } else { - return $Name2character_number{$in}; # returns undef if unknown - } -} - -#-------------------------------------------------------------------------- - -%Name2character_number = ( - # General XML/XHTML: - 'lt' => 60, - 'gt' => 62, - 'quot' => 34, - 'amp' => 38, - 'apos' => 39, - - # POD-specific: - 'sol' => 47, - 'verbar' => 124, - - 'lchevron' => 171, # legacy for laquo - 'rchevron' => 187, # legacy for raquo - - # Remember, grave looks like \ (as in virtu\) - # acute looks like / (as in re/sume/) - # circumflex looks like ^ (as in papier ma^che/) - # umlaut/dieresis looks like " (as in nai"ve, Chloe") - - # From the XHTML 1 .ent files: - 'nbsp' , 160, - 'iexcl' , 161, - 'cent' , 162, - 'pound' , 163, - 'curren' , 164, - 'yen' , 165, - 'brvbar' , 166, - 'sect' , 167, - 'uml' , 168, - 'copy' , 169, - 'ordf' , 170, - 'laquo' , 171, - 'not' , 172, - 'shy' , 173, - 'reg' , 174, - 'macr' , 175, - 'deg' , 176, - 'plusmn' , 177, - 'sup2' , 178, - 'sup3' , 179, - 'acute' , 180, - 'micro' , 181, - 'para' , 182, - 'middot' , 183, - 'cedil' , 184, - 'sup1' , 185, - 'ordm' , 186, - 'raquo' , 187, - 'frac14' , 188, - 'frac12' , 189, - 'frac34' , 190, - 'iquest' , 191, - 'Agrave' , 192, - 'Aacute' , 193, - 'Acirc' , 194, - 'Atilde' , 195, - 'Auml' , 196, - 'Aring' , 197, - 'AElig' , 198, - 'Ccedil' , 199, - 'Egrave' , 200, - 'Eacute' , 201, - 'Ecirc' , 202, - 'Euml' , 203, - 'Igrave' , 204, - 'Iacute' , 205, - 'Icirc' , 206, - 'Iuml' , 207, - 'ETH' , 208, - 'Ntilde' , 209, - 'Ograve' , 210, - 'Oacute' , 211, - 'Ocirc' , 212, - 'Otilde' , 213, - 'Ouml' , 214, - 'times' , 215, - 'Oslash' , 216, - 'Ugrave' , 217, - 'Uacute' , 218, - 'Ucirc' , 219, - 'Uuml' , 220, - 'Yacute' , 221, - 'THORN' , 222, - 'szlig' , 223, - 'agrave' , 224, - 'aacute' , 225, - 'acirc' , 226, - 'atilde' , 227, - 'auml' , 228, - 'aring' , 229, - 'aelig' , 230, - 'ccedil' , 231, - 'egrave' , 232, - 'eacute' , 233, - 'ecirc' , 234, - 'euml' , 235, - 'igrave' , 236, - 'iacute' , 237, - 'icirc' , 238, - 'iuml' , 239, - 'eth' , 240, - 'ntilde' , 241, - 'ograve' , 242, - 'oacute' , 243, - 'ocirc' , 244, - 'otilde' , 245, - 'ouml' , 246, - 'divide' , 247, - 'oslash' , 248, - 'ugrave' , 249, - 'uacute' , 250, - 'ucirc' , 251, - 'uuml' , 252, - 'yacute' , 253, - 'thorn' , 254, - 'yuml' , 255, - - 'fnof' , 402, - 'Alpha' , 913, - 'Beta' , 914, - 'Gamma' , 915, - 'Delta' , 916, - 'Epsilon' , 917, - 'Zeta' , 918, - 'Eta' , 919, - 'Theta' , 920, - 'Iota' , 921, - 'Kappa' , 922, - 'Lambda' , 923, - 'Mu' , 924, - 'Nu' , 925, - 'Xi' , 926, - 'Omicron' , 927, - 'Pi' , 928, - 'Rho' , 929, - 'Sigma' , 931, - 'Tau' , 932, - 'Upsilon' , 933, - 'Phi' , 934, - 'Chi' , 935, - 'Psi' , 936, - 'Omega' , 937, - 'alpha' , 945, - 'beta' , 946, - 'gamma' , 947, - 'delta' , 948, - 'epsilon' , 949, - 'zeta' , 950, - 'eta' , 951, - 'theta' , 952, - 'iota' , 953, - 'kappa' , 954, - 'lambda' , 955, - 'mu' , 956, - 'nu' , 957, - 'xi' , 958, - 'omicron' , 959, - 'pi' , 960, - 'rho' , 961, - 'sigmaf' , 962, - 'sigma' , 963, - 'tau' , 964, - 'upsilon' , 965, - 'phi' , 966, - 'chi' , 967, - 'psi' , 968, - 'omega' , 969, - 'thetasym' , 977, - 'upsih' , 978, - 'piv' , 982, - 'bull' , 8226, - 'hellip' , 8230, - 'prime' , 8242, - 'Prime' , 8243, - 'oline' , 8254, - 'frasl' , 8260, - 'weierp' , 8472, - 'image' , 8465, - 'real' , 8476, - 'trade' , 8482, - 'alefsym' , 8501, - 'larr' , 8592, - 'uarr' , 8593, - 'rarr' , 8594, - 'darr' , 8595, - 'harr' , 8596, - 'crarr' , 8629, - 'lArr' , 8656, - 'uArr' , 8657, - 'rArr' , 8658, - 'dArr' , 8659, - 'hArr' , 8660, - 'forall' , 8704, - 'part' , 8706, - 'exist' , 8707, - 'empty' , 8709, - 'nabla' , 8711, - 'isin' , 8712, - 'notin' , 8713, - 'ni' , 8715, - 'prod' , 8719, - 'sum' , 8721, - 'minus' , 8722, - 'lowast' , 8727, - 'radic' , 8730, - 'prop' , 8733, - 'infin' , 8734, - 'ang' , 8736, - 'and' , 8743, - 'or' , 8744, - 'cap' , 8745, - 'cup' , 8746, - 'int' , 8747, - 'there4' , 8756, - 'sim' , 8764, - 'cong' , 8773, - 'asymp' , 8776, - 'ne' , 8800, - 'equiv' , 8801, - 'le' , 8804, - 'ge' , 8805, - 'sub' , 8834, - 'sup' , 8835, - 'nsub' , 8836, - 'sube' , 8838, - 'supe' , 8839, - 'oplus' , 8853, - 'otimes' , 8855, - 'perp' , 8869, - 'sdot' , 8901, - 'lceil' , 8968, - 'rceil' , 8969, - 'lfloor' , 8970, - 'rfloor' , 8971, - 'lang' , 9001, - 'rang' , 9002, - 'loz' , 9674, - 'spades' , 9824, - 'clubs' , 9827, - 'hearts' , 9829, - 'diams' , 9830, - 'OElig' , 338, - 'oelig' , 339, - 'Scaron' , 352, - 'scaron' , 353, - 'Yuml' , 376, - 'circ' , 710, - 'tilde' , 732, - 'ensp' , 8194, - 'emsp' , 8195, - 'thinsp' , 8201, - 'zwnj' , 8204, - 'zwj' , 8205, - 'lrm' , 8206, - 'rlm' , 8207, - 'ndash' , 8211, - 'mdash' , 8212, - 'lsquo' , 8216, - 'rsquo' , 8217, - 'sbquo' , 8218, - 'ldquo' , 8220, - 'rdquo' , 8221, - 'bdquo' , 8222, - 'dagger' , 8224, - 'Dagger' , 8225, - 'permil' , 8240, - 'lsaquo' , 8249, - 'rsaquo' , 8250, - 'euro' , 8364, -); - - -# Fill out %Name2character... -{ - %Name2character = (); - my($name, $number); - while( ($name, $number) = each %Name2character_number) { - if($] < 5.007 and $number > 255) { - $Name2character{$name} = $FAR_CHAR; - # substitute for Unicode characters, for perls - # that can't reliable handle them - } else { - $Name2character{$name} = chr $number; - # normal case - } - } - # So they resolve 'right' even in EBCDIC-land - $Name2character{'lt' } = '<'; - $Name2character{'gt' } = '>'; - $Name2character{'quot'} = '"'; - $Name2character{'amp' } = '&'; - $Name2character{'apos'} = "'"; - $Name2character{'sol' } = '/'; - $Name2character{'verbar'} = '|'; -} - -#-------------------------------------------------------------------------- - -%Code2USASCII = ( -# mostly generated by -# perl -e "printf qq{ \x25 3s, '\x25s',\n}, $_, chr($_) foreach (32 .. 126)" - 32, ' ', - 33, '!', - 34, '"', - 35, '#', - 36, '$', - 37, '%', - 38, '&', - 39, "'", #! - 40, '(', - 41, ')', - 42, '*', - 43, '+', - 44, ',', - 45, '-', - 46, '.', - 47, '/', - 48, '0', - 49, '1', - 50, '2', - 51, '3', - 52, '4', - 53, '5', - 54, '6', - 55, '7', - 56, '8', - 57, '9', - 58, ':', - 59, ';', - 60, '<', - 61, '=', - 62, '>', - 63, '?', - 64, '@', - 65, 'A', - 66, 'B', - 67, 'C', - 68, 'D', - 69, 'E', - 70, 'F', - 71, 'G', - 72, 'H', - 73, 'I', - 74, 'J', - 75, 'K', - 76, 'L', - 77, 'M', - 78, 'N', - 79, 'O', - 80, 'P', - 81, 'Q', - 82, 'R', - 83, 'S', - 84, 'T', - 85, 'U', - 86, 'V', - 87, 'W', - 88, 'X', - 89, 'Y', - 90, 'Z', - 91, '[', - 92, "\\", #! - 93, ']', - 94, '^', - 95, '_', - 96, '`', - 97, 'a', - 98, 'b', - 99, 'c', - 100, 'd', - 101, 'e', - 102, 'f', - 103, 'g', - 104, 'h', - 105, 'i', - 106, 'j', - 107, 'k', - 108, 'l', - 109, 'm', - 110, 'n', - 111, 'o', - 112, 'p', - 113, 'q', - 114, 'r', - 115, 's', - 116, 't', - 117, 'u', - 118, 'v', - 119, 'w', - 120, 'x', - 121, 'y', - 122, 'z', - 123, '{', - 124, '|', - 125, '}', - 126, '~', -); - -#-------------------------------------------------------------------------- - -%Latin1Code_to_fallback = (); -@Latin1Code_to_fallback{0xA0 .. 0xFF} = ( -# Copied from Text/Unidecode/x00.pm: - -' ', qq{!}, qq{C/}, 'PS', qq{\$?}, qq{Y=}, qq{|}, 'SS', qq{"}, qq{(c)}, 'a', qq{<<}, qq{!}, "", qq{(r)}, qq{-}, -'deg', qq{+-}, '2', '3', qq{'}, 'u', 'P', qq{*}, qq{,}, '1', 'o', qq{>>}, qq{1/4}, qq{1/2}, qq{3/4}, qq{?}, -'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', -'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'U', 'Th', 'ss', -'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', -'d', 'n', 'o', 'o', 'o', 'o', 'o', qq{/}, 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y', - -); - -{ - # Now stuff %Latin1Char_to_fallback: - %Latin1Char_to_fallback = (); - my($k,$v); - while( ($k,$v) = each %Latin1Code_to_fallback) { - $Latin1Char_to_fallback{chr $k} = $v; - #print chr($k), ' => ', $v, "\n"; - } -} - -#-------------------------------------------------------------------------- -1; -__END__ - -=head1 NAME - -Pod::Escapes -- for resolving Pod EE<lt>...E<gt> sequences - -=head1 SYNOPSIS - - use Pod::Escapes qw(e2char); - ...la la la, parsing POD, la la la... - $text = e2char($e_node->label); - unless(defined $text) { - print "Unknown E sequence \"", $e_node->label, "\"!"; - } - ...else print/interpolate $text... - -=head1 DESCRIPTION - -This module provides things that are useful in decoding -Pod EE<lt>...E<gt> sequences. Presumably, it should be used -only by Pod parsers and/or formatters. - -By default, Pod::Escapes exports none of its symbols. But -you can request any of them to be exported. -Either request them individually, as with -C<use Pod::Escapes qw(symbolname symbolname2...);>, -or you can do C<use Pod::Escapes qw(:ALL);> to get all -exportable symbols. - -=head1 GOODIES - -=over - -=item e2char($e_content) - -Given a name or number that could appear in a -C<EE<lt>name_or_numE<gt>> sequence, this returns the string that -it stands for. For example, C<e2char('sol')>, C<e2char('47')>, -C<e2char('0x2F')>, and C<e2char('057')> all return "/", -because C<EE<lt>solE<gt>>, C<EE<lt>47E<gt>>, C<EE<lt>0x2fE<gt>>, -and C<EE<lt>057E<gt>>, all mean "/". If -the name has no known value (as with a name of "qacute") or is -syntactally invalid (as with a name of "1/4"), this returns undef. - -=item e2charnum($e_content) - -Given a name or number that could appear in a -C<EE<lt>name_or_numE<gt>> sequence, this returns the number of -the Unicode character that this stands for. For example, -C<e2char('sol')>, C<e2char('47')>, -C<e2char('0x2F')>, and C<e2char('057')> all return 47, -because C<EE<lt>solE<gt>>, C<EE<lt>47E<gt>>, C<EE<lt>0x2fE<gt>>, -and C<EE<lt>057E<gt>>, all mean "/", whose Unicode number is 47. If -the name has no known value (as with a name of "qacute") or is -syntactally invalid (as with a name of "1/4"), this returns undef. - -=item $Name2character{I<name>} - -Maps from names (as in C<EE<lt>I<name>E<gt>>) like "eacute" or "sol" -to the string that each stands for. Note that this does not -include numerics (like "64" or "x981c"). Under old Perl versions -(before 5.7) you get a "?" in place of characters whose Unicode -value is over 255. - -=item $Name2character_number{I<name>} - -Maps from names (as in C<EE<lt>I<name>E<gt>>) like "eacute" or "sol" -to the Unicode value that each stands for. For example, -C<$Name2character_number{'eacute'}> is 201, and -C<$Name2character_number{'eacute'}> is 8364. You get the correct -Unicode value, regardless of the version of Perl you're using -- -which differs from C<%Name2character>'s behavior under pre-5.7 Perls. - -Note that this hash does not -include numerics (like "64" or "x981c"). - -=item $Latin1Code_to_fallback{I<integer>} - -For numbers in the range 160 (0x00A0) to 255 (0x00FF), this maps -from the character code for a Latin-1 character (like 233 for -lowercase e-acute) to the US-ASCII character that best aproximates -it (like "e"). You may find this useful if you are rendering -POD in a format that you think deals well only with US-ASCII -characters. - -=item $Latin1Char_to_fallback{I<character>} - -Just as above, but maps from characters (like "\xE9", -lowercase e-acute) to characters (like "e"). - -=item $Code2USASCII{I<integer>} - -This maps from US-ASCII codes (like 32) to the corresponding -character (like space, for 32). Only characters 32 to 126 are -defined. This is meant for use by C<e2char($x)> when it senses -that it's running on a non-ASCII platform (where chr(32) doesn't -get you a space -- but $Code2USASCII{32} will). It's -documented here just in case you might find it useful. - -=back - -=head1 CAVEATS - -On Perl versions before 5.7, Unicode characters with a value -over 255 (like lambda or emdash) can't be conveyed. This -module does work under such early Perl versions, but in the -place of each such character, you get a "?". Latin-1 -characters (characters 160-255) are unaffected. - -Under EBCDIC platforms, C<e2char($n)> may not always be the -same as C<chr(e2charnum($n))>, and ditto for -C<$Name2character{$name}> and -C<chr($Name2character_number{$name})>. - -=head1 SEE ALSO - -L<perlpod|perlpod> - -L<perlpodspec|perlpodspec> - -L<Text::Unidecode|Text::Unidecode> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2001-2004 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -Portions of the data tables in this module are derived from the -entity declarations in the W3C XHTML specification. - -Currently (October 2001), that's these three: - - http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent - http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent - http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# What I used for reading the XHTML .ent files: - -use strict; -my(@norms, @good, @bad); -my $dir = 'c:/sgml/docbook/'; -my %escapes; -foreach my $file (qw( - xhtml-symbol.ent - xhtml-lat1.ent - xhtml-special.ent -)) { - open(IN, "<$dir$file") or die "can't read-open $dir$file: $!"; - print "Reading $file...\n"; - while(<IN>) { - if(m/<!ENTITY\s+(\S+)\s+"&#([^;]+);">/) { - my($name, $value) = ($1,$2); - next if $name eq 'quot' or $name eq 'apos' or $name eq 'gt'; - - $value = hex $1 if $value =~ m/^x([a-fA-F0-9]+)$/s; - print "ILLEGAL VALUE $value" unless $value =~ m/^\d+$/s; - if($value > 255) { - push @good , sprintf " %-10s , chr(%s),\n", "'$name'", $value; - push @bad , sprintf " %-10s , \$bad,\n", "'$name'", $value; - } else { - push @norms, sprintf " %-10s , chr(%s),\n", "'$name'", $value; - } - } elsif(m/<!ENT/) { - print "# Skipping $_"; - } - - } - close(IN); -} - -print @norms; -print "\n ( \$] .= 5.006001 ? (\n"; -print @good; -print " ) : (\n"; -print @bad; -print " )\n);\n"; - -__END__ -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - diff --git a/web/bin/lib/Pod/Hyperlink/BounceURL.pm b/web/bin/lib/Pod/Hyperlink/BounceURL.pm deleted file mode 100644 index b29c73e..0000000 --- a/web/bin/lib/Pod/Hyperlink/BounceURL.pm +++ /dev/null @@ -1,123 +0,0 @@ -package Pod::Hyperlink::BounceURL; -use Pod::ParseUtils; -use URI::Escape; - -use vars qw($VERSION @ISA); -$VERSION = ('$Revision: 1.7 $' =~ /([\d\.]+)/)[0]; -@ISA = 'Pod::Hyperlink'; - -sub configure { - my $self = shift; - my %opts = @_; - if ($opts{'URL'}) { - $self->{'___url'} = $opts{'URL'}; - } -} - -sub type { - my $self = shift; - - # very special case - if we are called explicitly (rather than by our superclass) and with other conditions - # 1) a page type with a page value - # 2) an item type with a page value - # We don't care about any other cases - my ($callpack) = caller(); - if ($callpack ne $ISA[0]) { - DUMP(__PACKAGE__."::type", [ $self, @_ ]); - } else { - DUMP(" indirect call of ".__PACKAGE__."::type", [ $self, @_ ]); - } - - if ( - ($callpack ne $ISA[0]) - && (($self->{'-type'} eq 'page') || ($self->{'-type'} eq 'item')) - && $self->{'-page'} - ) { - my $page_esc = uri_escape( $self->{'-page'} ); - my $node_esc = uri_escape( $self->{'-node'} ); - my $url = sprintf( $self->{'___url'}, $page_esc, $node_esc ); - return "bounceurl:$url"; - } - # in all other cases, let the superclass handle the work - return $self->SUPER::type(@_); -} - -# debug hooks -sub TRACE {} -sub DUMP {} - -1; - -=head1 NAME - -Pod::Hyperlink::BounceURL - Allow off-page links in POD to point to a URL - -=head1 SYNOPSIS - - use Pod::Hyperlink::BounceURL; - my $linkparser = new Pod::Hyperlink::BounceURL; - $linkparser->configure( URL => '/cgi-perl/support/bounce.pl?page=%s' ); - my $pod2xhtml = new Pod::Xhtml( LinkParser => $linkparser ); - -=head1 DESCRIPTION - -Some links in your pod may not be resolveable by Pod::Hyperlink, e.g. C<LE<lt>Some::ModuleE<gt>> - -this module allows you to detect such links and generate a hyperlink instead of some static text. -The target URL will probably be some kind of dynamic webpage or CGI application which can then serve up -the relevant page or send a redirect to the page, hence the "bounce" in this module's name. - -This module overrides the type() method and, for relevant links, will return a string which is -"bounceurl:" followed by the URL, instead of returning "page" or "item". -Your pod-conversion module can then switch on this case and emit the correct kind of markup. -L<Pod::Xhtml> supports the use of this module. - -=head1 METHODS - -=over 4 - -=item configure( %OPTIONS ) - -Set persistent configuration for this object. See L</OPTIONS>. - -=item type() - -Behaves as L<Pod::Hyperlink>'s type() method except for the unresolveable links, where the string returned is -as described in L</DESCRIPTION>. - -=back - -=head1 OPTIONS - -=over 4 - -=item URL - -The URL to handle the link, which may be absolute or relative, of any protocol - it's just -treated as a string and is passed through sprintf(), with two string arguments that are both -already URL-escaped. - -The first argument is the page name, and will always exist. The second argument is the "node" within the page, and may be -empty. - -Insert '%s' where you wish the arguments to be interpolated. The string goes through sprintf() so -you should have '%%' where you want an actual percent sign. If you need the arguments in a different order, see -the perl-specific features of L<perlfunc/sprintf>. - -=back - -=head1 VERSION - -$Revision: 1.7 $ - -=head1 AUTHOR - -P Kent E<lt>cpan _at_ bbc _dot_ co _dot_ ukE<gt> - -=head1 COPYRIGHT - -(c) BBC 2007. This program is free software; you can redistribute it and/or modify it under the GNU GPL. - -See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt - -=cut - diff --git a/web/bin/lib/Pod/Simple.pm b/web/bin/lib/Pod/Simple.pm deleted file mode 100644 index 6beacaa..0000000 --- a/web/bin/lib/Pod/Simple.pm +++ /dev/null @@ -1,1520 +0,0 @@ - -require 5; -package Pod::Simple; -use strict; -use Carp (); -BEGIN { *DEBUG = sub () {0} unless defined &DEBUG } -use integer; -use Pod::Escapes 1.03 (); -use Pod::Simple::LinkSection (); -use Pod::Simple::BlackBox (); -#use utf8; - -use vars qw( - $VERSION @ISA - @Known_formatting_codes @Known_directives - %Known_formatting_codes %Known_directives - $NL -); - -@ISA = ('Pod::Simple::BlackBox'); -$VERSION = '3.05'; - -@Known_formatting_codes = qw(I B C L E F S X Z); -%Known_formatting_codes = map(($_=>1), @Known_formatting_codes); -@Known_directives = qw(head1 head2 head3 head4 item over back); -%Known_directives = map(($_=>'Plain'), @Known_directives); -$NL = $/ unless defined $NL; - -#----------------------------------------------------------------------------- -# Set up some constants: - -BEGIN { - if(defined &ASCII) { } - elsif(chr(65) eq 'A') { *ASCII = sub () {1} } - else { *ASCII = sub () {''} } - - unless(defined &MANY_LINES) { *MANY_LINES = sub () {20} } - DEBUG > 4 and print "MANY_LINES is ", MANY_LINES(), "\n"; - unless(MANY_LINES() >= 1) { - die "MANY_LINES is too small (", MANY_LINES(), ")!\nAborting"; - } - if(defined &UNICODE) { } - elsif($] >= 5.008) { *UNICODE = sub() {1} } - else { *UNICODE = sub() {''} } -} -if(DEBUG > 2) { - print "# We are ", ASCII ? '' : 'not ', "in ASCII-land\n"; - print "# We are under a Unicode-safe Perl.\n"; -} - -# Design note: -# This is a parser for Pod. It is not a parser for the set of Pod-like -# languages which happens to contain Pod -- it is just for Pod, plus possibly -# some extensions. - -# @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ -#@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -__PACKAGE__->_accessorize( - 'nbsp_for_S', # Whether to map S<...>'s to \xA0 characters - 'source_filename', # Filename of the source, for use in warnings - 'source_dead', # Whether to consider this parser's source dead - - 'output_fh', # The filehandle we're writing to, if applicable. - # Used only in some derived classes. - - 'hide_line_numbers', # For some dumping subclasses: whether to pointedly - # suppress the start_line attribute - - 'line_count', # the current line number - 'pod_para_count', # count of pod paragraphs seen so far - - 'no_whining', # whether to suppress whining - 'no_errata_section', # whether to suppress the errata section - 'complain_stderr', # whether to complain to stderr - - 'doc_has_started', # whether we've fired the open-Document event yet - - 'bare_output', # For some subclasses: whether to prepend - # header-code and postpend footer-code - - 'fullstop_space_harden', # Whether to turn ". " into ".[nbsp] "; - - 'nix_X_codes', # whether to ignore X<...> codes - 'merge_text', # whether to avoid breaking a single piece of - # text up into several events - - 'preserve_whitespace', # whether to try to keep whitespace as-is - - 'content_seen', # whether we've seen any real Pod content - 'errors_seen', # TODO: document. whether we've seen any errors (fatal or not) - - 'codes_in_verbatim', # for PseudoPod extensions - - 'code_handler', # coderef to call when a code (non-pod) line is seen - 'cut_handler', # coderef to call when a =cut line is seen - #Called like: - # $code_handler->($line, $self->{'line_count'}, $self) if $code_handler; - # $cut_handler->($line, $self->{'line_count'}, $self) if $cut_handler; - -); - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub any_errata_seen { # good for using as an exit() value... - return shift->{'errors_seen'} || 0; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# Pull in some functions that, for some reason, I expect to see here too: -BEGIN { - *pretty = \&Pod::Simple::BlackBox::pretty; - *stringify_lol = \&Pod::Simple::BlackBox::stringify_lol; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub version_report { - my $class = ref($_[0]) || $_[0]; - if($class eq __PACKAGE__) { - return "$class $VERSION"; - } else { - my $v = $class->VERSION; - return "$class $v (" . __PACKAGE__ . " $VERSION)"; - } -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -#sub curr_open { # read-only list accessor -# return @{ $_[0]{'curr_open'} || return() }; -#} -#sub _curr_open_listref { $_[0]{'curr_open'} ||= [] } - - -sub output_string { - # Works by faking out output_fh. Simplifies our code. - # - my $this = shift; - return $this->{'output_string'} unless @_; # GET. - - require Pod::Simple::TiedOutFH; - my $x = (defined($_[0]) and ref($_[0])) ? $_[0] : \( $_[0] ); - $$x = '' unless defined $$x; - DEBUG > 4 and print "# Output string set to $x ($$x)\n"; - $this->{'output_fh'} = Pod::Simple::TiedOutFH->handle_on($_[0]); - return - $this->{'output_string'} = $_[0]; - #${ ${ $this->{'output_fh'} } }; -} - -sub abandon_output_string { $_[0]->abandon_output_fh; delete $_[0]{'output_string'} } -sub abandon_output_fh { $_[0]->output_fh(undef) } -# These don't delete the string or close the FH -- they just delete our -# references to it/them. -# TODO: document these - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub new { - # takes no parameters - my $class = ref($_[0]) || $_[0]; - #Carp::croak(__PACKAGE__ . " is a virtual base class -- see perldoc " - # . __PACKAGE__ ); - return bless { - 'accept_codes' => { map( ($_=>$_), @Known_formatting_codes ) }, - 'accept_directives' => { %Known_directives }, - 'accept_targets' => {}, - }, $class; -} - - - -# TODO: an option for whether to interpolate E<...>'s, or just resolve to codes. - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _handle_element_start { # OVERRIDE IN DERIVED CLASS - my($self, $element_name, $attr_hash_r) = @_; - return; -} - -sub _handle_element_end { # OVERRIDE IN DERIVED CLASS - my($self, $element_name) = @_; - return; -} - -sub _handle_text { # OVERRIDE IN DERIVED CLASS - my($self, $text) = @_; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# -# And now directives (not targets) - -sub accept_directive_as_verbatim { shift->_accept_directives('Verbatim', @_) } -sub accept_directive_as_data { shift->_accept_directives('Data', @_) } -sub accept_directive_as_processed { shift->_accept_directives('Plain', @_) } - -sub _accept_directives { - my($this, $type) = splice @_,0,2; - foreach my $d (@_) { - next unless defined $d and length $d; - Carp::croak "\"$d\" isn't a valid directive name" - unless $d =~ m/^[a-zA-Z][a-zA-Z0-9]*$/s; - Carp::croak "\"$d\" is already a reserved Pod directive name" - if exists $Known_directives{$d}; - $this->{'accept_directives'}{$d} = $type; - DEBUG > 2 and print "Learning to accept \"=$d\" as directive of type $type\n"; - } - DEBUG > 6 and print "$this\'s accept_directives : ", - pretty($this->{'accept_directives'}), "\n"; - - return sort keys %{ $this->{'accept_directives'} } if wantarray; - return; -} - -#-------------------------------------------------------------------------- -# TODO: document these: - -sub unaccept_directive { shift->unaccept_directives(@_) }; - -sub unaccept_directives { - my $this = shift; - foreach my $d (@_) { - next unless defined $d and length $d; - Carp::croak "\"$d\" isn't a valid directive name" - unless $d =~ m/^[a-zA-Z][a-zA-Z0-9]*$/s; - Carp::croak "But you must accept \"$d\" directives -- it's a builtin!" - if exists $Known_directives{$d}; - delete $this->{'accept_directives'}{$d}; - DEBUG > 2 and print "OK, won't accept \"=$d\" as directive.\n"; - } - return sort keys %{ $this->{'accept_directives'} } if wantarray; - return -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# -# And now targets (not directives) - -sub accept_target { shift->accept_targets(@_) } # alias -sub accept_target_as_text { shift->accept_targets_as_text(@_) } # alias - - -sub accept_targets { shift->_accept_targets('1', @_) } - -sub accept_targets_as_text { shift->_accept_targets('force_resolve', @_) } - # forces them to be processed, even when there's no ":". - -sub _accept_targets { - my($this, $type) = splice @_,0,2; - foreach my $t (@_) { - next unless defined $t and length $t; - # TODO: enforce some limitations on what a target name can be? - $this->{'accept_targets'}{$t} = $type; - DEBUG > 2 and print "Learning to accept \"$t\" as target of type $type\n"; - } - return sort keys %{ $this->{'accept_targets'} } if wantarray; - return; -} - -#-------------------------------------------------------------------------- -sub unaccept_target { shift->unaccept_targets(@_) } - -sub unaccept_targets { - my $this = shift; - foreach my $t (@_) { - next unless defined $t and length $t; - # TODO: enforce some limitations on what a target name can be? - delete $this->{'accept_targets'}{$t}; - DEBUG > 2 and print "OK, won't accept \"$t\" as target.\n"; - } - return sort keys %{ $this->{'accept_targets'} } if wantarray; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# -# And now codes (not targets or directives) - -sub accept_code { shift->accept_codes(@_) } # alias - -sub accept_codes { # Add some codes - my $this = shift; - - foreach my $new_code (@_) { - next unless defined $new_code and length $new_code; - if(ASCII) { - # A good-enough check that it's good as an XML Name symbol: - Carp::croak "\"$new_code\" isn't a valid element name" - if $new_code =~ - m/[\x00-\x2C\x2F\x39\x3B-\x40\x5B-\x5E\x60\x7B-\x7F]/ - # Characters under 0x80 that aren't legal in an XML Name. - or $new_code =~ m/^[-\.0-9]/s - or $new_code =~ m/:[-\.0-9]/s; - # The legal under-0x80 Name characters that - # an XML Name still can't start with. - } - - $this->{'accept_codes'}{$new_code} = $new_code; - - # Yes, map to itself -- just so that when we - # see "=extend W [whatever] thatelementname", we say that W maps - # to whatever $this->{accept_codes}{thatelementname} is, - # i.e., "thatelementname". Then when we go re-mapping, - # a "W" in the treelet turns into "thatelementname". We only - # remap once. - # If we say we accept "W", then a "W" in the treelet simply turns - # into "W". - } - - return; -} - -#-------------------------------------------------------------------------- -sub unaccept_code { shift->unaccept_codes(@_) } - -sub unaccept_codes { # remove some codes - my $this = shift; - - foreach my $new_code (@_) { - next unless defined $new_code and length $new_code; - if(ASCII) { - # A good-enough check that it's good as an XML Name symbol: - Carp::croak "\"$new_code\" isn't a valid element name" - if $new_code =~ - m/[\x00-\x2C\x2F\x39\x3B-\x40\x5B-\x5E\x60\x7B-\x7F]/ - # Characters under 0x80 that aren't legal in an XML Name. - or $new_code =~ m/^[-\.0-9]/s - or $new_code =~ m/:[-\.0-9]/s; - # The legal under-0x80 Name characters that - # an XML Name still can't start with. - } - - Carp::croak "But you must accept \"$new_code\" codes -- it's a builtin!" - if grep $new_code eq $_, @Known_formatting_codes; - - delete $this->{'accept_codes'}{$new_code}; - - DEBUG > 2 and print "OK, won't accept the code $new_code<...>.\n"; - } - - return; -} - - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub parse_string_document { - my $self = shift; - my @lines; - foreach my $line_group (@_) { - next unless defined $line_group and length $line_group; - pos($line_group) = 0; - while($line_group =~ - m/([^\n\r]*)((?:\r?\n)?)/g - ) { - #print(">> $1\n"), - $self->parse_lines($1) - if length($1) or length($2) - or pos($line_group) != length($line_group); - # I.e., unless it's a zero-length "empty line" at the very - # end of "foo\nbar\n" (i.e., between the \n and the EOS). - } - } - $self->parse_lines(undef); # to signal EOF - return $self; -} - -sub _init_fh_source { - my($self, $source) = @_; - - #DEBUG > 1 and print "Declaring $source as :raw for starters\n"; - #$self->_apply_binmode($source, ':raw'); - #binmode($source, ":raw"); - - return; -} - -#:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. -# - -sub parse_file { - my($self, $source) = (@_); - - if(!defined $source) { - Carp::croak("Can't use empty-string as a source for parse_file"); - } elsif(ref(\$source) eq 'GLOB') { - $self->{'source_filename'} = '' . ($source); - } elsif(ref $source) { - $self->{'source_filename'} = '' . ($source); - } elsif(!length $source) { - Carp::croak("Can't use empty-string as a source for parse_file"); - } else { - { - local *PODSOURCE; - open(PODSOURCE, "<$source") || Carp::croak("Can't open $source: $!"); - $self->{'source_filename'} = $source; - $source = *PODSOURCE{IO}; - } - $self->_init_fh_source($source); - } - # By here, $source is a FH. - - $self->{'source_fh'} = $source; - - my($i, @lines); - until( $self->{'source_dead'} ) { - splice @lines; - for($i = MANY_LINES; $i--;) { # read those many lines at a time - local $/ = $NL; - push @lines, scalar(<$source>); # readline - last unless defined $lines[-1]; - # but pass thru the undef, which will set source_dead to true - } - $self->parse_lines(@lines); - } - delete($self->{'source_fh'}); # so it can be GC'd - return $self; -} - -#:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. - -sub parse_from_file { - # An emulation of Pod::Parser's interface, for the sake of Perldoc. - # Basically just a wrapper around parse_file. - - my($self, $source, $to) = @_; - $self = $self->new unless ref($self); # so we tolerate being a class method - - if(!defined $source) { $source = *STDIN{IO} - } elsif(ref(\$source) eq 'GLOB') { # stet - } elsif(ref($source) ) { # stet - } elsif(!length $source - or $source eq '-' or $source =~ m/^<&(STDIN|0)$/i - ) { - $source = *STDIN{IO}; - } - - if(!defined $to) { $self->output_fh( *STDOUT{IO} ); - } elsif(ref(\$to) eq 'GLOB') { $self->output_fh( $to ); - } elsif(ref($to)) { $self->output_fh( $to ); - } elsif(!length $to - or $to eq '-' or $to =~ m/^>&?(?:STDOUT|1)$/i - ) { - $self->output_fh( *STDOUT{IO} ); - } else { - require Symbol; - my $out_fh = Symbol::gensym(); - DEBUG and print "Write-opening to $to\n"; - open($out_fh, ">$to") or Carp::croak "Can't write-open $to: $!"; - binmode($out_fh) - if $self->can('write_with_binmode') and $self->write_with_binmode; - $self->output_fh($out_fh); - } - - return $self->parse_file($source); -} - -#----------------------------------------------------------------------------- - -sub whine { - #my($self,$line,$complaint) = @_; - my $self = shift(@_); - ++$self->{'errors_seen'}; - if($self->{'no_whining'}) { - DEBUG > 9 and print "Discarding complaint (at line $_[0]) $_[1]\n because no_whining is on.\n"; - return; - } - return $self->_complain_warn(@_) if $self->{'complain_stderr'}; - return $self->_complain_errata(@_); -} - -sub scream { # like whine, but not suppressable - #my($self,$line,$complaint) = @_; - my $self = shift(@_); - ++$self->{'errors_seen'}; - return $self->_complain_warn(@_) if $self->{'complain_stderr'}; - return $self->_complain_errata(@_); -} - -sub _complain_warn { - my($self,$line,$complaint) = @_; - return printf STDERR "%s around line %s: %s\n", - $self->{'source_filename'} || 'Pod input', $line, $complaint; -} - -sub _complain_errata { - my($self,$line,$complaint) = @_; - if( $self->{'no_errata_section'} ) { - DEBUG > 9 and print "Discarding erratum (at line $line) $complaint\n because no_errata_section is on.\n"; - } else { - DEBUG > 9 and print "Queuing erratum (at line $line) $complaint\n"; - push @{$self->{'errata'}{$line}}, $complaint - # for a report to be generated later! - } - return 1; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _get_initial_item_type { - # A hack-wrapper here for when you have like "=over\n\n=item 456\n\n" - my($self, $para) = @_; - return $para->[1]{'~type'} if $para->[1]{'~type'}; - - return $para->[1]{'~type'} = 'text' - if join("\n", @{$para}[2 .. $#$para]) =~ m/^\s*(\d+)\.?\s*$/s and $1 ne '1'; - # Else fall thru to the general case: - return $self->_get_item_type($para); -} - - - -sub _get_item_type { # mutates the item!! - my($self, $para) = @_; - return $para->[1]{'~type'} if $para->[1]{'~type'}; - - - # Otherwise we haven't yet been to this node. Maybe alter it... - - my $content = join "\n", @{$para}[2 .. $#$para]; - - if($content =~ m/^\s*\*\s*$/s or $content =~ m/^\s*$/s) { - # Like: "=item *", "=item * ", "=item" - splice @$para, 2; # so it ends up just being ['=item', { attrhash } ] - $para->[1]{'~orig_content'} = $content; - return $para->[1]{'~type'} = 'bullet'; - - } elsif($content =~ m/^\s*\*\s+(.+)/s) { # tolerance - - # Like: "=item * Foo bar baz"; - $para->[1]{'~orig_content'} = $content; - $para->[1]{'~_freaky_para_hack'} = $1; - DEBUG > 2 and print " Tolerating $$para[2] as =item *\\n\\n$1\n"; - splice @$para, 2; # so it ends up just being ['=item', { attrhash } ] - return $para->[1]{'~type'} = 'bullet'; - - } elsif($content =~ m/^\s*(\d+)\.?\s*$/s) { - # Like: "=item 1.", "=item 123412" - - $para->[1]{'~orig_content'} = $content; - $para->[1]{'number'} = $1; # Yes, stores the number there! - - splice @$para, 2; # so it ends up just being ['=item', { attrhash } ] - return $para->[1]{'~type'} = 'number'; - - } else { - # It's anything else. - return $para->[1]{'~type'} = 'text'; - - } -} - -#----------------------------------------------------------------------------- - -sub _make_treelet { - my $self = shift; # and ($para, $start_line) - my $treelet; - if(!@_) { - return ['']; - } if(ref $_[0] and ref $_[0][0] and $_[0][0][0] eq '~Top') { - # Hack so we can pass in fake-o pre-cooked paragraphs: - # just have the first line be a reference to a ['~Top', {}, ...] - # We use this feechure in gen_errata and stuff. - - DEBUG and print "Applying precooked treelet hack to $_[0][0]\n"; - $treelet = $_[0][0]; - splice @$treelet, 0, 2; # lop the top off - return $treelet; - } else { - $treelet = $self->_treelet_from_formatting_codes(@_); - } - - if( $self->_remap_sequences($treelet) ) { - $self->_treat_Zs($treelet); # Might as well nix these first - $self->_treat_Ls($treelet); # L has to precede E and S - $self->_treat_Es($treelet); - $self->_treat_Ss($treelet); # S has to come after E - - $self->_wrap_up($treelet); # Nix X's and merge texties - - } else { - DEBUG and print "Formatless treelet gets fast-tracked.\n"; - # Very common case! - } - - splice @$treelet, 0, 2; # lop the top off - - return $treelet; -} - -#:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. - -sub _wrap_up { - my($self, @stack) = @_; - my $nixx = $self->{'nix_X_codes'}; - my $merge = $self->{'merge_text' }; - return unless $nixx or $merge; - - DEBUG > 2 and print "\nStarting _wrap_up traversal.\n", - $merge ? (" Merge mode on\n") : (), - $nixx ? (" Nix-X mode on\n") : (), - ; - - - my($i, $treelet); - while($treelet = shift @stack) { - DEBUG > 3 and print " Considering children of this $treelet->[0] node...\n"; - for($i = 2; $i < @$treelet; ++$i) { # iterate over children - DEBUG > 3 and print " Considering child at $i ", pretty($treelet->[$i]), "\n"; - if($nixx and ref $treelet->[$i] and $treelet->[$i][0] eq 'X') { - DEBUG > 3 and print " Nixing X node at $i\n"; - splice(@$treelet, $i, 1); # just nix this node (and its descendants) - # no need to back-update the counter just yet - redo; - - } elsif($merge and $i != 2 and # non-initial - !ref $treelet->[$i] and !ref $treelet->[$i - 1] - ) { - DEBUG > 3 and print " Merging ", $i-1, - ":[$treelet->[$i-1]] and $i\:[$treelet->[$i]]\n"; - $treelet->[$i-1] .= ( splice(@$treelet, $i, 1) )[0]; - DEBUG > 4 and print " Now: ", $i-1, ":[$treelet->[$i-1]]\n"; - --$i; - next; - # since we just pulled the possibly last node out from under - # ourselves, we can't just redo() - - } elsif( ref $treelet->[$i] ) { - DEBUG > 4 and print " Enqueuing ", pretty($treelet->[$i]), " for traversal.\n"; - push @stack, $treelet->[$i]; - - if($treelet->[$i][0] eq 'L') { - my $thing; - foreach my $attrname ('section', 'to') { - if(defined($thing = $treelet->[$i][1]{$attrname}) and ref $thing) { - unshift @stack, $thing; - DEBUG > 4 and print " +Enqueuing ", - pretty( $treelet->[$i][1]{$attrname} ), - " as an attribute value to tweak.\n"; - } - } - } - } - } - } - DEBUG > 2 and print "End of _wrap_up traversal.\n\n"; - - return; -} - -#:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. - -sub _remap_sequences { - my($self,@stack) = @_; - - if(@stack == 1 and @{ $stack[0] } == 3 and !ref $stack[0][2]) { - # VERY common case: abort it. - DEBUG and print "Skipping _remap_sequences: formatless treelet.\n"; - return 0; - } - - my $map = ($self->{'accept_codes'} || die "NO accept_codes in $self?!?"); - - my $start_line = $stack[0][1]{'start_line'}; - DEBUG > 2 and printf - "\nAbout to start _remap_sequences on treelet from line %s.\n", - $start_line || '[?]' - ; - DEBUG > 3 and print " Map: ", - join('; ', map "$_=" . ( - ref($map->{$_}) ? join(",", @{$map->{$_}}) : $map->{$_} - ), - sort keys %$map ), - ("B~C~E~F~I~L~S~X~Z" eq join '~', sort keys %$map) - ? " (all normal)\n" : "\n" - ; - - # A recursive algorithm implemented iteratively! Whee! - - my($is, $was, $i, $treelet); # scratch - while($treelet = shift @stack) { - DEBUG > 3 and print " Considering children of this $treelet->[0] node...\n"; - for($i = 2; $i < @$treelet; ++$i) { # iterate over children - next unless ref $treelet->[$i]; # text nodes are uninteresting - - DEBUG > 4 and print " Noting child $i : $treelet->[$i][0]<...>\n"; - - $is = $treelet->[$i][0] = $map->{ $was = $treelet->[$i][0] }; - if( DEBUG > 3 ) { - if(!defined $is) { - print " Code $was<> is UNKNOWN!\n"; - } elsif($is eq $was) { - DEBUG > 4 and print " Code $was<> stays the same.\n"; - } else { - print " Code $was<> maps to ", - ref($is) - ? ( "tags ", map("$_<", @$is), '...', map('>', @$is), "\n" ) - : "tag $is<...>.\n"; - } - } - - if(!defined $is) { - $self->whine($start_line, "Deleting unknown formatting code $was<>"); - $is = $treelet->[$i][0] = '1'; # But saving the children! - # I could also insert a leading "$was<" and tailing ">" as - # children of this node, but something about that seems icky. - } - if(ref $is) { - my @dynasty = @$is; - DEBUG > 4 and print " Renaming $was node to $dynasty[-1]\n"; - $treelet->[$i][0] = pop @dynasty; - my $nugget; - while(@dynasty) { - DEBUG > 4 and printf - " Grafting a new %s node between %s and %s\n", - $dynasty[-1], $treelet->[0], $treelet->[$i][0], - ; - - #$nugget = ; - splice @$treelet, $i, 1, [pop(@dynasty), {}, $treelet->[$i]]; - # relace node with a new parent - } - } elsif($is eq '0') { - splice(@$treelet, $i, 1); # just nix this node (and its descendants) - --$i; # back-update the counter - } elsif($is eq '1') { - splice(@$treelet, $i, 1 # replace this node with its children! - => splice @{ $treelet->[$i] },2 - # (not catching its first two (non-child) items) - ); - --$i; # back up for new stuff - } else { - # otherwise it's unremarkable - unshift @stack, $treelet->[$i]; # just recurse - } - } - } - - DEBUG > 2 and print "End of _remap_sequences traversal.\n\n"; - - if(@_ == 2 and @{ $_[1] } == 3 and !ref $_[1][2]) { - DEBUG and print "Noting that the treelet is now formatless.\n"; - return 0; - } - return 1; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub _ponder_extend { - - # "Go to an extreme, move back to a more comfortable place" - # -- /Oblique Strategies/, Brian Eno and Peter Schmidt - - my($self, $para) = @_; - my $content = join ' ', splice @$para, 2; - $content =~ s/^\s+//s; - $content =~ s/\s+$//s; - - DEBUG > 2 and print "Ogling extensor: =extend $content\n"; - - if($content =~ - m/^ - (\S+) # 1 : new item - \s+ - (\S+) # 2 : fallback(s) - (?:\s+(\S+))? # 3 : element name(s) - \s* - $ - /xs - ) { - my $new_letter = $1; - my $fallbacks_one = $2; - my $elements_one; - $elements_one = defined($3) ? $3 : $1; - - DEBUG > 2 and print "Extensor has good syntax.\n"; - - unless($new_letter =~ m/^[A-Z]$/s or $new_letter) { - DEBUG > 2 and print " $new_letter isn't a valid thing to entend.\n"; - $self->whine( - $para->[1]{'start_line'}, - "You can extend only formatting codes A-Z, not like \"$new_letter\"" - ); - return; - } - - if(grep $new_letter eq $_, @Known_formatting_codes) { - DEBUG > 2 and print " $new_letter isn't a good thing to extend, because known.\n"; - $self->whine( - $para->[1]{'start_line'}, - "You can't extend an established code like \"$new_letter\"" - ); - - #TODO: or allow if last bit is same? - - return; - } - - unless($fallbacks_one =~ m/^[A-Z](,[A-Z])*$/s # like "B", "M,I", etc. - or $fallbacks_one eq '0' or $fallbacks_one eq '1' - ) { - $self->whine( - $para->[1]{'start_line'}, - "Format for second =extend parameter must be like" - . " M or 1 or 0 or M,N or M,N,O but you have it like " - . $fallbacks_one - ); - return; - } - - unless($elements_one =~ m/^[^ ,]+(,[^ ,]+)*$/s) { # like "B", "M,I", etc. - $self->whine( - $para->[1]{'start_line'}, - "Format for third =extend parameter: like foo or bar,Baz,qu:ux but not like " - . $elements_one - ); - return; - } - - my @fallbacks = split ',', $fallbacks_one, -1; - my @elements = split ',', $elements_one, -1; - - foreach my $f (@fallbacks) { - next if exists $Known_formatting_codes{$f} or $f eq '0' or $f eq '1'; - DEBUG > 2 and print " Can't fall back on unknown code $f\n"; - $self->whine( - $para->[1]{'start_line'}, - "Can't use unknown formatting code '$f' as a fallback for '$new_letter'" - ); - return; - } - - DEBUG > 3 and printf "Extensor: Fallbacks <%s> Elements <%s>.\n", - @fallbacks, @elements; - - my $canonical_form; - foreach my $e (@elements) { - if(exists $self->{'accept_codes'}{$e}) { - DEBUG > 1 and print " Mapping '$new_letter' to known extension '$e'\n"; - $canonical_form = $e; - last; # first acceptable elementname wins! - } else { - DEBUG > 1 and print " Can't map '$new_letter' to unknown extension '$e'\n"; - } - } - - - if( defined $canonical_form ) { - # We found a good N => elementname mapping - $self->{'accept_codes'}{$new_letter} = $canonical_form; - DEBUG > 2 and print - "Extensor maps $new_letter => known element $canonical_form.\n"; - } else { - # We have to use the fallback(s), which might be '0', or '1'. - $self->{'accept_codes'}{$new_letter} - = (@fallbacks == 1) ? $fallbacks[0] : \@fallbacks; - DEBUG > 2 and print - "Extensor maps $new_letter => fallbacks @fallbacks.\n"; - } - - } else { - DEBUG > 2 and print "Extensor has bad syntax.\n"; - $self->whine( - $para->[1]{'start_line'}, - "Unknown =extend syntax: $content" - ) - } - return; -} - - -#:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. - -sub _treat_Zs { # Nix Z<...>'s - my($self,@stack) = @_; - - my($i, $treelet); - my $start_line = $stack[0][1]{'start_line'}; - - # A recursive algorithm implemented iteratively! Whee! - - while($treelet = shift @stack) { - for($i = 2; $i < @$treelet; ++$i) { # iterate over children - next unless ref $treelet->[$i]; # text nodes are uninteresting - unless($treelet->[$i][0] eq 'Z') { - unshift @stack, $treelet->[$i]; # recurse - next; - } - - DEBUG > 1 and print "Nixing Z node @{$treelet->[$i]}\n"; - - # bitch UNLESS it's empty - unless( @{$treelet->[$i]} == 2 - or (@{$treelet->[$i]} == 3 and $treelet->[$i][2] eq '') - ) { - $self->whine( $start_line, "A non-empty Z<>" ); - } # but kill it anyway - - splice(@$treelet, $i, 1); # thereby just nix this node. - --$i; - - } - } - - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -# Quoting perlpodspec: - -# In parsing an L<...> code, Pod parsers must distinguish at least four -# attributes: - -############# Not used. Expressed via the element children plus -############# the value of the "content-implicit" flag. -# First: -# The link-text. If there is none, this must be undef. (E.g., in "L<Perl -# Functions|perlfunc>", the link-text is "Perl Functions". In -# "L<Time::HiRes>" and even "L<|Time::HiRes>", there is no link text. Note -# that link text may contain formatting.) -# - -############# The element children -# Second: -# The possibly inferred link-text -- i.e., if there was no real link text, -# then this is the text that we'll infer in its place. (E.g., for -# "L<Getopt::Std>", the inferred link text is "Getopt::Std".) -# - -############# The "to" attribute (which might be text, or a treelet) -# Third: -# The name or URL, or undef if none. (E.g., in "L<Perl -# Functions|perlfunc>", the name -- also sometimes called the page -- is -# "perlfunc". In "L</CAVEATS>", the name is undef.) -# - -############# The "section" attribute (which might be next, or a treelet) -# Fourth: -# The section (AKA "item" in older perlpods), or undef if none. E.g., in -# Getopt::Std/DESCRIPTION, "DESCRIPTION" is the section. (Note that this -# is not the same as a manpage section like the "5" in "man 5 crontab". -# "Section Foo" in the Pod sense means the part of the text that's -# introduced by the heading or item whose text is "Foo".) -# -# Pod parsers may also note additional attributes including: -# - -############# The "type" attribute. -# Fifth: -# A flag for whether item 3 (if present) is a URL (like -# "http://lists.perl.org" is), in which case there should be no section -# attribute; a Pod name (like "perldoc" and "Getopt::Std" are); or -# possibly a man page name (like "crontab(5)" is). -# - -############# Not implemented, I guess. -# Sixth: -# The raw original L<...> content, before text is split on "|", "/", etc, -# and before E<...> codes are expanded. - - -# For L<...> codes without a "name|" part, only E<...> and Z<> codes may -# occur -- no other formatting codes. That is, authors should not use -# "L<B<Foo::Bar>>". -# -# Note, however, that formatting codes and Z<>'s can occur in any and all -# parts of an L<...> (i.e., in name, section, text, and url). - -sub _treat_Ls { # Process our dear dear friends, the L<...> sequences - - # L<name> - # L<name/"sec"> or L<name/sec> - # L</"sec"> or L</sec> or L<"sec"> - # L<text|name> - # L<text|name/"sec"> or L<text|name/sec> - # L<text|/"sec"> or L<text|/sec> or L<text|"sec"> - # L<scheme:...> - - my($self,@stack) = @_; - - my($i, $treelet); - my $start_line = $stack[0][1]{'start_line'}; - - # A recursive algorithm implemented iteratively! Whee! - - while($treelet = shift @stack) { - for(my $i = 2; $i < @$treelet; ++$i) { - # iterate over children of current tree node - next unless ref $treelet->[$i]; # text nodes are uninteresting - unless($treelet->[$i][0] eq 'L') { - unshift @stack, $treelet->[$i]; # recurse - next; - } - - - # By here, $treelet->[$i] is definitely an L node - DEBUG > 1 and print "Ogling L node $treelet->[$i]\n"; - - # bitch if it's empty - if( @{$treelet->[$i]} == 2 - or (@{$treelet->[$i]} == 3 and $treelet->[$i][2] eq '') - ) { - $self->whine( $start_line, "An empty L<>" ); - $treelet->[$i] = 'L<>'; # just make it a text node - next; # and move on - } - - # Catch URLs: - # URLs can, alas, contain E<...> sequences, so we can't /assume/ - # that this is one text node. But it has to START with one text - # node... - if(! ref $treelet->[$i][2] and - $treelet->[$i][2] =~ m/^\w+:[^:\s]\S*$/s - ) { - $treelet->[$i][1]{'type'} = 'url'; - $treelet->[$i][1]{'content-implicit'} = 'yes'; - - # TODO: deal with rel: URLs here? - - if( 3 == @{ $treelet->[$i] } ) { - # But if it IS just one text node (most common case) - DEBUG > 1 and printf qq{Catching "%s as " as ho-hum L<URL> link.\n}, - $treelet->[$i][2] - ; - $treelet->[$i][1]{'to'} = Pod::Simple::LinkSection->new( - $treelet->[$i][2] - ); # its own treelet - } else { - # It's a URL but complex (like "L<foo:bazE<123>bar>"). Feh. - #$treelet->[$i][1]{'to'} = [ @{$treelet->[$i]} ]; - #splice @{ $treelet->[$i][1]{'to'} }, 0,2; - #DEBUG > 1 and printf qq{Catching "%s as " as complex L<URL> link.\n}, - # join '~', @{$treelet->[$i][1]{'to' }}; - - $treelet->[$i][1]{'to'} = Pod::Simple::LinkSection->new( - $treelet->[$i] # yes, clone the whole content as a treelet - ); - $treelet->[$i][1]{'to'}[0] = ''; # set the copy's tagname to nil - die "SANITY FAILURE" if $treelet->[0] eq ''; # should never happen! - DEBUG > 1 and print - qq{Catching "$treelet->[$i][1]{'to'}" as a complex L<URL> link.\n}; - } - - next; # and move on - } - - - # Catch some very simple and/or common cases - if(@{$treelet->[$i]} == 3 and ! ref $treelet->[$i][2]) { - my $it = $treelet->[$i][2]; - if($it =~ m/^[-a-zA-Z0-9]+\([-a-zA-Z0-9]+\)$/s) { # man sections - # Hopefully neither too broad nor too restrictive a RE - DEBUG > 1 and print "Catching \"$it\" as manpage link.\n"; - $treelet->[$i][1]{'type'} = 'man'; - # This's the only place where man links can get made. - $treelet->[$i][1]{'content-implicit'} = 'yes'; - $treelet->[$i][1]{'to' } = - Pod::Simple::LinkSection->new( $it ); # treelet! - - next; - } - if($it =~ m/^[^\/\|,\$\%\@\ \"\<\>\:\#\&\*\{\}\[\]\(\)]+(\:\:[^\/\|,\$\%\@\ \"\<\>\:\#\&\*\{\}\[\]\(\)]+)*$/s) { - # Extremely forgiving idea of what constitutes a bare - # modulename link like L<Foo::Bar> or even L<Thing::1.0::Docs::Tralala> - DEBUG > 1 and print "Catching \"$it\" as ho-hum L<Modulename> link.\n"; - $treelet->[$i][1]{'type'} = 'pod'; - $treelet->[$i][1]{'content-implicit'} = 'yes'; - $treelet->[$i][1]{'to' } = - Pod::Simple::LinkSection->new( $it ); # treelet! - next; - } - # else fall thru... - } - - - - # ...Uhoh, here's the real L<...> parsing stuff... - # "With the ill behavior, with the ill behavior, with the ill behavior..." - - DEBUG > 1 and print "Running a real parse on this non-trivial L\n"; - - - my $link_text; # set to an arrayref if found - my $ell = $treelet->[$i]; - my @ell_content = @$ell; - splice @ell_content,0,2; # Knock off the 'L' and {} bits - - DEBUG > 3 and print " Ell content to start: ", - pretty(@ell_content), "\n"; - - - # Look for the "|" -- only in CHILDREN (not all underlings!) - # Like L<I like the strictness|strict> - DEBUG > 3 and - print " Peering at L content for a '|' ...\n"; - for(my $j = 0; $j < @ell_content; ++$j) { - next if ref $ell_content[$j]; - DEBUG > 3 and - print " Peering at L-content text bit \"$ell_content[$j]\" for a '|'.\n"; - - if($ell_content[$j] =~ m/^([^\|]*)\|(.*)$/s) { - my @link_text = ($1); # might be 0-length - $ell_content[$j] = $2; # might be 0-length - - DEBUG > 3 and - print " FOUND a '|' in it. Splitting into [$1] + [$2]\n"; - - unshift @link_text, splice @ell_content, 0, $j; - # leaving only things at J and after - @ell_content = grep ref($_)||length($_), @ell_content ; - $link_text = [grep ref($_)||length($_), @link_text ]; - DEBUG > 3 and printf - " So link text is %s\n and remaining ell content is %s\n", - pretty($link_text), pretty(@ell_content); - last; - } - } - - - # Now look for the "/" -- only in CHILDREN (not all underlings!) - # And afterward, anything left in @ell_content will be the raw name - # Like L<Foo::Bar/Object Methods> - my $section_name; # set to arrayref if found - DEBUG > 3 and print " Peering at L-content for a '/' ...\n"; - for(my $j = 0; $j < @ell_content; ++$j) { - next if ref $ell_content[$j]; - DEBUG > 3 and - print " Peering at L-content text bit \"$ell_content[$j]\" for a '/'.\n"; - - if($ell_content[$j] =~ m/^([^\/]*)\/(.*)$/s) { - my @section_name = ($2); # might be 0-length - $ell_content[$j] = $1; # might be 0-length - - DEBUG > 3 and - print " FOUND a '/' in it.", - " Splitting to page [...$1] + section [$2...]\n"; - - push @section_name, splice @ell_content, 1+$j; - # leaving only things before and including J - - @ell_content = grep ref($_)||length($_), @ell_content ; - @section_name = grep ref($_)||length($_), @section_name ; - - # Turn L<.../"foo"> into L<.../foo> - if(@section_name - and !ref($section_name[0]) and !ref($section_name[-1]) - and $section_name[ 0] =~ m/^\"/s - and $section_name[-1] =~ m/\"$/s - and !( # catch weird degenerate case of L<"> ! - @section_name == 1 and $section_name[0] eq '"' - ) - ) { - $section_name[ 0] =~ s/^\"//s; - $section_name[-1] =~ s/\"$//s; - DEBUG > 3 and - print " Quotes removed: ", pretty(@section_name), "\n"; - } else { - DEBUG > 3 and - print " No need to remove quotes in ", pretty(@section_name), "\n"; - } - - $section_name = \@section_name; - last; - } - } - - # Turn L<"Foo Bar"> into L</Foo Bar> - if(!$section_name and @ell_content - and !ref($ell_content[0]) and !ref($ell_content[-1]) - and $ell_content[ 0] =~ m/^\"/s - and $ell_content[-1] =~ m/\"$/s - and !( # catch weird degenerate case of L<"> ! - @ell_content == 1 and $ell_content[0] eq '"' - ) - ) { - $section_name = [splice @ell_content]; - $section_name->[ 0] =~ s/^\"//s; - $section_name->[-1] =~ s/\"$//s; - } - - # Turn L<Foo Bar> into L</Foo Bar>. - if(!$section_name and !$link_text and @ell_content - and grep !ref($_) && m/ /s, @ell_content - ) { - $section_name = [splice @ell_content]; - # That's support for the now-deprecated syntax. - # (Maybe generate a warning eventually?) - # Note that it deliberately won't work on L<...|Foo Bar> - } - - - # Now make up the link_text - # L<Foo> -> L<Foo|Foo> - # L</Bar> -> L<"Bar"|Bar> - # L<Foo/Bar> -> L<"Bar" in Foo/Foo> - unless($link_text) { - $ell->[1]{'content-implicit'} = 'yes'; - $link_text = []; - push @$link_text, '"', @$section_name, '"' if $section_name; - - if(@ell_content) { - $link_text->[-1] .= ' in ' if $section_name; - push @$link_text, @ell_content; - } - } - - - # And the E resolver will have to deal with all our treeletty things: - - if(@ell_content == 1 and !ref($ell_content[0]) - and $ell_content[0] =~ m/^[-a-zA-Z0-9]+\([-a-zA-Z0-9]+\)$/s - ) { - $ell->[1]{'type'} = 'man'; - DEBUG > 3 and print "Considering this ($ell_content[0]) a man link.\n"; - } else { - $ell->[1]{'type'} = 'pod'; - DEBUG > 3 and print "Considering this a pod link (not man or url).\n"; - } - - if( defined $section_name ) { - $ell->[1]{'section'} = Pod::Simple::LinkSection->new( - ['', {}, @$section_name] - ); - DEBUG > 3 and print "L-section content: ", pretty($ell->[1]{'section'}), "\n"; - } - - if( @ell_content ) { - $ell->[1]{'to'} = Pod::Simple::LinkSection->new( - ['', {}, @ell_content] - ); - DEBUG > 3 and print "L-to content: ", pretty($ell->[1]{'to'}), "\n"; - } - - # And update children to be the link-text: - @$ell = (@$ell[0,1], defined($link_text) ? splice(@$link_text) : ''); - - DEBUG > 2 and print "End of L-parsing for this node $treelet->[$i]\n"; - - unshift @stack, $treelet->[$i]; # might as well recurse - } - } - - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub _treat_Es { - my($self,@stack) = @_; - - my($i, $treelet, $content, $replacer, $charnum); - my $start_line = $stack[0][1]{'start_line'}; - - # A recursive algorithm implemented iteratively! Whee! - - - # Has frightening side effects on L nodes' attributes. - - #my @ells_to_tweak; - - while($treelet = shift @stack) { - for(my $i = 2; $i < @$treelet; ++$i) { # iterate over children - next unless ref $treelet->[$i]; # text nodes are uninteresting - if($treelet->[$i][0] eq 'L') { - # SPECIAL STUFF for semi-processed L<>'s - - my $thing; - foreach my $attrname ('section', 'to') { - if(defined($thing = $treelet->[$i][1]{$attrname}) and ref $thing) { - unshift @stack, $thing; - DEBUG > 2 and print " Enqueuing ", - pretty( $treelet->[$i][1]{$attrname} ), - " as an attribute value to tweak.\n"; - } - } - - unshift @stack, $treelet->[$i]; # recurse - next; - } elsif($treelet->[$i][0] ne 'E') { - unshift @stack, $treelet->[$i]; # recurse - next; - } - - DEBUG > 1 and print "Ogling E node ", pretty($treelet->[$i]), "\n"; - - # bitch if it's empty - if( @{$treelet->[$i]} == 2 - or (@{$treelet->[$i]} == 3 and $treelet->[$i][2] eq '') - ) { - $self->whine( $start_line, "An empty E<>" ); - $treelet->[$i] = 'E<>'; # splice in a literal - next; - } - - # bitch if content is weird - unless(@{$treelet->[$i]} == 3 and !ref($content = $treelet->[$i][2])) { - $self->whine( $start_line, "An E<...> surrounding strange content" ); - $replacer = $treelet->[$i]; # scratch - splice(@$treelet, $i, 1, # fake out a literal - 'E<', - splice(@$replacer,2), # promote its content - '>' - ); - # Don't need to do --$i, as the 'E<' we just added isn't interesting. - next; - } - - DEBUG > 1 and print "Ogling E<$content>\n"; - - $charnum = Pod::Escapes::e2charnum($content); - DEBUG > 1 and print " Considering E<$content> with char ", - defined($charnum) ? $charnum : "undef", ".\n"; - - if(!defined( $charnum )) { - DEBUG > 1 and print "I don't know how to deal with E<$content>.\n"; - $self->whine( $start_line, "Unknown E content in E<$content>" ); - $replacer = "E<$content>"; # better than nothing - } elsif($charnum >= 255 and !UNICODE) { - $replacer = ASCII ? "\xA4" : "?"; - DEBUG > 1 and print "This Perl version can't handle ", - "E<$content> (chr $charnum), so replacing with $replacer\n"; - } else { - $replacer = Pod::Escapes::e2char($content); - DEBUG > 1 and print " Replacing E<$content> with $replacer\n"; - } - - splice(@$treelet, $i, 1, $replacer); # no need to back up $i, tho - } - } - - return; -} - - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub _treat_Ss { - my($self,$treelet) = @_; - - _change_S_to_nbsp($treelet,0) if $self->{'nbsp_for_S'}; - - # TODO: or a change_nbsp_to_S - # Normalizing nbsp's to S is harder: for each text node, make S content - # out of anything matching m/([^ \xA0]*(?:\xA0+[^ \xA0]*)+)/ - - - return; -} - - -sub _change_S_to_nbsp { # a recursive function - # Sanely assumes that the top node in the excursion won't be an S node. - my($treelet, $in_s) = @_; - - my $is_s = ('S' eq $treelet->[0]); - $in_s ||= $is_s; # So in_s is on either by this being an S element, - # or by an ancestor being an S element. - - for(my $i = 2; $i < @$treelet; ++$i) { - if(ref $treelet->[$i]) { - if( _change_S_to_nbsp( $treelet->[$i], $in_s ) ) { - my $to_pull_up = $treelet->[$i]; - splice @$to_pull_up,0,2; # ...leaving just its content - splice @$treelet, $i, 1, @$to_pull_up; # Pull up content - $i += @$to_pull_up - 1; # Make $i skip the pulled-up stuff - } - } else { - $treelet->[$i] =~ s/\s/\xA0/g if ASCII and $in_s; - # (If not in ASCIIland, we can't assume that \xA0 == nbsp.) - - # Note that if you apply nbsp_for_S to text, and so turn - # "foo S<bar baz> quux" into "foo bar faz quux", you - # end up with something that fails to say "and don't hyphenate - # any part of 'bar baz'". However, hyphenation is such a vexing - # problem anyway, that most Pod renderers just don't render it - # at all. But if you do want to implement hyphenation, I guess - # that you'd better have nbsp_for_S off. - } - } - - return $is_s; -} - -#----------------------------------------------------------------------------- - -sub _accessorize { # A simple-minded method-maker - no strict 'refs'; - foreach my $attrname (@_) { - next if $attrname =~ m/::/; # a hack - *{caller() . '::' . $attrname} = sub { - use strict; - $Carp::CarpLevel = 1, Carp::croak( - "Accessor usage: \$obj->$attrname() or \$obj->$attrname(\$new_value)" - ) unless (@_ == 1 or @_ == 2) and ref $_[0]; - (@_ == 1) ? $_[0]->{$attrname} - : ($_[0]->{$attrname} = $_[1]); - }; - } - # Ya know, they say accessories make the ensemble! - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -#============================================================================= - -sub filter { - my($class, $source) = @_; - my $new = $class->new; - $new->output_fh(*STDOUT{IO}); - - if(ref($source || '') eq 'SCALAR') { - $new->parse_string_document( $$source ); - } elsif(ref($source)) { # it's a file handle - $new->parse_file($source); - } else { # it's a filename - $new->parse_file($source); - } - - return $new; -} - - -#----------------------------------------------------------------------------- - -sub _out { - # For use in testing: Class->_out($source) - # returns the transformation of $source - - my $class = shift(@_); - - my $mutor = shift(@_) if @_ and ref($_[0] || '') eq 'CODE'; - - DEBUG and print "\n\n", '#' x 76, - "\nAbout to parse source: {{\n$_[0]\n}}\n\n"; - - - my $parser = $class->new; - $parser->hide_line_numbers(1); - - my $out = ''; - $parser->output_string( \$out ); - DEBUG and print " _out to ", \$out, "\n"; - - $mutor->($parser) if $mutor; - - $parser->parse_string_document( $_[0] ); - # use Data::Dumper; print Dumper($parser), "\n"; - return $out; -} - - -sub _duo { - # For use in testing: Class->_duo($source1, $source2) - # returns the parse trees of $source1 and $source2. - # Good in things like: &ok( Class->duo(... , ...) ); - - my $class = shift(@_); - - Carp::croak "But $class->_duo is useful only in list context!" - unless wantarray; - - my $mutor = shift(@_) if @_ and ref($_[0] || '') eq 'CODE'; - - Carp::croak "But $class->_duo takes two parameters, not: @_" - unless @_ == 2; - - my(@out); - - while( @_ ) { - my $parser = $class->new; - - push @out, ''; - $parser->output_string( \( $out[-1] ) ); - - DEBUG and print " _duo out to ", $parser->output_string(), - " = $parser->{'output_string'}\n"; - - $parser->hide_line_numbers(1); - $mutor->($parser) if $mutor; - $parser->parse_string_document( shift( @_ ) ); - # use Data::Dumper; print Dumper($parser), "\n"; - } - - return @out; -} - - - -#----------------------------------------------------------------------------- -1; -__END__ - -TODO: -A start_formatting_code and end_formatting_code methods, which in the -base class call start_L, end_L, start_C, end_C, etc., if they are -defined. - -have the POD FORMATTING ERRORS section note the localtime, and the -version of Pod::Simple. - -option to delete all E<shy>s? -option to scream if under-0x20 literals are found in the input, or -under-E<32> E codes are found in the tree. And ditto \x7f-\x9f - -Option to turn highbit characters into their compromised form? (applies -to E parsing too) - -TODO: BOM/encoding things. - -TODO: ascii-compat things in the XML classes? - diff --git a/web/bin/lib/Pod/Simple.pod b/web/bin/lib/Pod/Simple.pod deleted file mode 100644 index b0a8a6f..0000000 --- a/web/bin/lib/Pod/Simple.pod +++ /dev/null @@ -1,218 +0,0 @@ - -=head1 NAME - -Pod::Simple - framework for parsing Pod - -=head1 SYNOPSIS - - TODO - -=head1 DESCRIPTION - -Pod::Simple is a Perl library for parsing text in the Pod ("plain old -documentation") markup language that is typically used for writing -documentation for Perl and for Perl modules. The Pod format is explained -in the L<perlpod|perlpod> man page; the most common formatter is called -"perldoc". - -Pod formatters can use Pod::Simple to parse Pod documents into produce -renderings of them in plain ASCII, in HTML, or in any number of other -formats. Typically, such formatters will be subclasses of Pod::Simple, -and so they will inherit its methods, like C<parse_file>. - -If you're reading this document just because you have a Pod-processing -subclass that you want to use, this document (plus the documentation for -the subclass) is probably all you'll need to read. - -If you're reading this document because you want to write a formatter -subclass, continue reading this document, and then read -L<Pod::Simple::Subclassing>, and then possibly even read L<perlpodspec> -(some of which is for parser-writers, but much of which is notes to -formatter-writers). - - -=head1 MAIN METHODS - - - -=over - -=item C<< $parser = I<SomeClass>->new(); >> - -This returns a new parser object, where I<C<SomeClass>> is a subclass -of Pod::Simple. - -=item C<< $parser->output_fh( *OUT ); >> - -This sets the filehandle that C<$parser>'s output will be written to. -You can pass C<*STDOUT>, otherwise you should probably do something -like this: - - my $outfile = "output.txt"; - open TXTOUT, ">$outfile" or die "Can't write to $outfile: $!"; - $parser->output_fh(*TXTOUT); - -...before you call one of the C<< $parser->parse_I<whatever> >> methods. - -=item C<< $parser->output_string( \$somestring ); >> - -This sets the string that C<$parser>'s output will be sent to, -instead of any filehandle. - - -=item C<< $parser->parse_file( I<$some_filename> ); >> - -=item C<< $parser->parse_file( *INPUT_FH ); >> - -This reads the Pod content of the file (or filehandle) that you specify, -and processes it with that C<$parser> object, according to however -C<$parser>'s class works, and according to whatever parser options you -have set up for this C<$parser> object. - -=item C<< $parser->parse_string_document( I<$all_content> ); >> - -This works just like C<parse_file> except that it reads the Pod -content not from a file, but from a string that you have already -in memory. - -=item C<< $parser->parse_lines( I<...@lines...>, undef ); >> - -This processes the lines in C<@lines> (where each list item must be a -defined value, and must contain exactly one line of content -- so no -items like C<"foo\nbar"> are allowed). The final C<undef> is used to -indicate the end of document being parsed. - -The other C<parser_I<whatever>> methods are meant to be called only once -per C<$parser> object; but C<parse_lines> can be called as many times per -C<$parser> object as you want, as long as the last call (and only -the last call) ends with an C<undef> value. - - -=item C<< $parser->content_seen >> - -This returns true only if there has been any real content seen -for this document. - - -=item C<< I<SomeClass>->filter( I<$filename> ); >> - -=item C<< I<SomeClass>->filter( I<*INPUT_FH> ); >> - -=item C<< I<SomeClass>->filter( I<\$document_content> ); >> - -This is a shortcut method for creating a new parser object, setting the -output handle to STDOUT, and then processing the specified file (or -filehandle, or in-memory document). This is handy for one-liners like -this: - - perl -MPod::Simple::Text -e "Pod::Simple::Text->filter('thingy.pod')" - -=back - - - -=head1 SECONDARY METHODS - -Some of these methods might be of interest to general users, as -well as of interest to formatter-writers. - -Note that the general pattern here is that the accessor-methods -read the attribute's value with C<< $value = $parser->I<attribute> >> -and set the attribute's value with -C<< $parser->I<attribute>(I<newvalue>) >>. For each accessor, I typically -only mention one syntax or another, based on which I think you are actually -most likely to use. - - -=over - -=item C<< $parser->no_whining( I<SOMEVALUE> ) >> - -If you set this attribute to a true value, you will suppress the -parser's complaints about irregularities in the Pod coding. By default, -this attribute's value is false, meaning that irregularities will -be reported. - -Note that turning this attribute to true won't suppress one or two kinds -of complaints about rarely occurring unrecoverable errors. - - -=item C<< $parser->no_errata_section( I<SOMEVALUE> ) >> - -If you set this attribute to a true value, you will stop the parser from -generating a "POD ERRORS" section at the end of the document. By -default, this attribute's value is false, meaning that an errata section -will be generated, as necessary. - - -=item C<< $parser->complain_stderr( I<SOMEVALUE> ) >> - -If you set this attribute to a true value, it will send reports of -parsing errors to STDERR. By default, this attribute's value is false, -meaning that no output is sent to STDERR. - -Note that errors can be noted in an errata section, or sent to STDERR, -or both, or neither. So don't think that turning on C<complain_stderr> -will turn off C<no_errata_section> or vice versa -- these are -independent attributes. - - -=item C<< $parser->source_filename >> - -This returns the filename that this parser object was set to read from. - - -=item C<< $parser->doc_has_started >> - -This returns true if C<$parser> has read from a source, and has seen -Pod content in it. - - -=item C<< $parser->source_dead >> - -This returns true if C<$parser> has read from a source, and come to the -end of that source. - -=back - - -=head1 CAVEATS - -This is just a beta release -- there are a good number of things still -left to do. Notably, support for EBCDIC platforms is still half-done, -an untested. - - -=head1 SEE ALSO - -L<Pod::Simple::Subclassing> - -L<perlpod|perlpod> - -L<perlpodspec|perlpodspec> - -L<Pod::Escapes|Pod::Escapes> - -L<perldoc> - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Original author: Sean M. Burke C<sburke@cpan.org> - -Maintained by: Allison Randal C<allison@perl.org> - -=cut - - diff --git a/web/bin/lib/Pod/Simple/BlackBox.pm b/web/bin/lib/Pod/Simple/BlackBox.pm deleted file mode 100644 index 6d7fdba..0000000 --- a/web/bin/lib/Pod/Simple/BlackBox.pm +++ /dev/null @@ -1,1923 +0,0 @@ - -package Pod::Simple::BlackBox; -# -# "What's in the box?" "Pain." -# -########################################################################### -# -# This is where all the scary things happen: parsing lines into -# paragraphs; and then into directives, verbatims, and then also -# turning formatting sequences into treelets. -# -# Are you really sure you want to read this code? -# -#----------------------------------------------------------------------------- -# -# The basic work of this module Pod::Simple::BlackBox is doing the dirty work -# of parsing Pod into treelets (generally one per non-verbatim paragraph), and -# to call the proper callbacks on the treelets. -# -# Every node in a treelet is a ['name', {attrhash}, ...children...] - -use integer; # vroom! -use strict; -use Carp (); -BEGIN { - require Pod::Simple; - *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub parse_line { shift->parse_lines(@_) } # alias - -# - - - Turn back now! Run away! - - - - -sub parse_lines { # Usage: $parser->parse_lines(@lines) - # an undef means end-of-stream - my $self = shift; - - my $code_handler = $self->{'code_handler'}; - my $cut_handler = $self->{'cut_handler'}; - $self->{'line_count'} ||= 0; - - my $scratch; - - DEBUG > 4 and - print "# Parsing starting at line ", $self->{'line_count'}, ".\n"; - - DEBUG > 5 and - print "# About to parse lines: ", - join(' ', map defined($_) ? "[$_]" : "EOF", @_), "\n"; - - my $paras = ($self->{'paras'} ||= []); - # paragraph buffer. Because we need to defer processing of =over - # directives and verbatim paragraphs. We call _ponder_paragraph_buffer - # to process this. - - $self->{'pod_para_count'} ||= 0; - - my $line; - foreach my $source_line (@_) { - if( $self->{'source_dead'} ) { - DEBUG > 4 and print "# Source is dead.\n"; - last; - } - - unless( defined $source_line ) { - DEBUG > 4 and print "# Undef-line seen.\n"; - - push @$paras, ['~end', {'start_line' => $self->{'line_count'}}]; - push @$paras, $paras->[-1], $paras->[-1]; - # So that it definitely fills the buffer. - $self->{'source_dead'} = 1; - $self->_ponder_paragraph_buffer; - next; - } - - - if( $self->{'line_count'}++ ) { - ($line = $source_line) =~ tr/\n\r//d; - # If we don't have two vars, we'll end up with that there - # tr/// modding the (potentially read-only) original source line! - - } else { - DEBUG > 2 and print "First line: [$source_line]\n"; - - if( ($line = $source_line) =~ s/^\xEF\xBB\xBF//s ) { - DEBUG and print "UTF-8 BOM seen. Faking a '=encode utf8'.\n"; - $self->_handle_encoding_line( "=encode utf8" ); - $line =~ tr/\n\r//d; - - } elsif( $line =~ s/^\xFE\xFF//s ) { - DEBUG and print "Big-endian UTF-16 BOM seen. Aborting parsing.\n"; - $self->scream( - $self->{'line_count'}, - "UTF16-BE Byte Encoding Mark found; but Pod::Simple v$Pod::Simple::VERSION doesn't implement UTF16 yet." - ); - splice @_; - push @_, undef; - next; - - # TODO: implement somehow? - - } elsif( $line =~ s/^\xFF\xFE//s ) { - DEBUG and print "Little-endian UTF-16 BOM seen. Aborting parsing.\n"; - $self->scream( - $self->{'line_count'}, - "UTF16-LE Byte Encoding Mark found; but Pod::Simple v$Pod::Simple::VERSION doesn't implement UTF16 yet." - ); - splice @_; - push @_, undef; - next; - - # TODO: implement somehow? - - } else { - DEBUG > 2 and print "First line is BOM-less.\n"; - ($line = $source_line) =~ tr/\n\r//d; - } - } - - - DEBUG > 5 and print "# Parsing line: [$line]\n"; - - if(!$self->{'in_pod'}) { - if($line =~ m/^=([a-zA-Z]+)/s) { - if($1 eq 'cut') { - $self->scream( - $self->{'line_count'}, - "=cut found outside a pod block. Skipping to next block." - ); - - ## Before there were errata sections in the world, it was - ## least-pessimal to abort processing the file. But now we can - ## just barrel on thru (but still not start a pod block). - #splice @_; - #push @_, undef; - - next; - } else { - $self->{'in_pod'} = $self->{'start_of_pod_block'} - = $self->{'last_was_blank'} = 1; - # And fall thru to the pod-mode block further down - } - } else { - DEBUG > 5 and print "# It's a code-line.\n"; - $code_handler->(map $_, $line, $self->{'line_count'}, $self) - if $code_handler; - # Note: this may cause code to be processed out of order relative - # to pods, but in order relative to cuts. - - # Note also that we haven't yet applied the transcoding to $line - # by time we call $code_handler! - - if( $line =~ m/^#\s*line\s+(\d+)\s*(?:\s"([^"]+)")?\s*$/ ) { - # That RE is from perlsyn, section "Plain Old Comments (Not!)", - #$fname = $2 if defined $2; - #DEBUG > 1 and defined $2 and print "# Setting fname to \"$fname\"\n"; - DEBUG > 1 and print "# Setting nextline to $1\n"; - $self->{'line_count'} = $1 - 1; - } - - next; - } - } - - # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - # Else we're in pod mode: - - # Apply any necessary transcoding: - $self->{'_transcoder'} && $self->{'_transcoder'}->($line); - - # HERE WE CATCH =encoding EARLY! - if( $line =~ m/^=encoding\s+\S+\s*$/s ) { - $line = $self->_handle_encoding_line( $line ); - } - - if($line =~ m/^=cut/s) { - # here ends the pod block, and therefore the previous pod para - DEBUG > 1 and print "Noting =cut at line ${$self}{'line_count'}\n"; - $self->{'in_pod'} = 0; - # ++$self->{'pod_para_count'}; - $self->_ponder_paragraph_buffer(); - # by now it's safe to consider the previous paragraph as done. - $cut_handler->(map $_, $line, $self->{'line_count'}, $self) - if $cut_handler; - - # TODO: add to docs: Note: this may cause cuts to be processed out - # of order relative to pods, but in order relative to code. - - } elsif($line =~ m/^\s*$/s) { # it's a blank line - if(!$self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq '~Verbatim') { - DEBUG > 1 and print "Saving blank line at line ${$self}{'line_count'}\n"; - push @{$paras->[-1]}, $line; - } # otherwise it's not interesting - - if(!$self->{'start_of_pod_block'} and !$self->{'last_was_blank'}) { - DEBUG > 1 and print "Noting para ends with blank line at ${$self}{'line_count'}\n"; - } - - $self->{'last_was_blank'} = 1; - - } elsif($self->{'last_was_blank'}) { # A non-blank line starting a new para... - - if($line =~ m/^(=[a-zA-Z][a-zA-Z0-9]*)(?:\s+|$)(.*)/s) { - # THIS IS THE ONE PLACE WHERE WE CONSTRUCT NEW DIRECTIVE OBJECTS - my $new = [$1, {'start_line' => $self->{'line_count'}}, $2]; - # Note that in "=head1 foo", the WS is lost. - # Example: ['=head1', {'start_line' => 123}, ' foo'] - - ++$self->{'pod_para_count'}; - - $self->_ponder_paragraph_buffer(); - # by now it's safe to consider the previous paragraph as done. - - push @$paras, $new; # the new incipient paragraph - DEBUG > 1 and print "Starting new ${$paras}[-1][0] para at line ${$self}{'line_count'}\n"; - - } elsif($line =~ m/^\s/s) { - - if(!$self->{'start_of_pod_block'} and @$paras and $paras->[-1][0] eq '~Verbatim') { - DEBUG > 1 and print "Resuming verbatim para at line ${$self}{'line_count'}\n"; - push @{$paras->[-1]}, $line; - } else { - ++$self->{'pod_para_count'}; - $self->_ponder_paragraph_buffer(); - # by now it's safe to consider the previous paragraph as done. - DEBUG > 1 and print "Starting verbatim para at line ${$self}{'line_count'}\n"; - push @$paras, ['~Verbatim', {'start_line' => $self->{'line_count'}}, $line]; - } - } else { - ++$self->{'pod_para_count'}; - $self->_ponder_paragraph_buffer(); - # by now it's safe to consider the previous paragraph as done. - push @$paras, ['~Para', {'start_line' => $self->{'line_count'}}, $line]; - DEBUG > 1 and print "Starting plain para at line ${$self}{'line_count'}\n"; - } - $self->{'last_was_blank'} = $self->{'start_of_pod_block'} = 0; - - } else { - # It's a non-blank line /continuing/ the current para - if(@$paras) { - DEBUG > 2 and print "Line ${$self}{'line_count'} continues current paragraph\n"; - push @{$paras->[-1]}, $line; - } else { - # Unexpected case! - die "Continuing a paragraph but \@\$paras is empty?"; - } - $self->{'last_was_blank'} = $self->{'start_of_pod_block'} = 0; - } - - } # ends the big while loop - - DEBUG > 1 and print(pretty(@$paras), "\n"); - return $self; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _handle_encoding_line { - my($self, $line) = @_; - - # The point of this routine is to set $self->{'_transcoder'} as indicated. - - return $line unless $line =~ m/^=encoding\s+(\S+)\s*$/s; - DEBUG > 1 and print "Found an encoding line \"=encoding $1\"\n"; - - my $e = $1; - my $orig = $e; - push @{ $self->{'encoding_command_reqs'} }, "=encoding $orig"; - - my $enc_error; - - # Cf. perldoc Encode and perldoc Encode::Supported - - require Pod::Simple::Transcode; - - if( $self->{'encoding'} ) { - my $norm_current = $self->{'encoding'}; - my $norm_e = $e; - foreach my $that ($norm_current, $norm_e) { - $that = lc($that); - $that =~ s/[-_]//g; - } - if($norm_current eq $norm_e) { - DEBUG > 1 and print "The '=encoding $orig' line is ", - "redundant. ($norm_current eq $norm_e). Ignoring.\n"; - $enc_error = ''; - # But that doesn't necessarily mean that the earlier one went okay - } else { - $enc_error = "Encoding is already set to " . $self->{'encoding'}; - DEBUG > 1 and print $enc_error; - } - } elsif ( - # OK, let's turn on the encoding - do { - DEBUG > 1 and print " Setting encoding to $e\n"; - $self->{'encoding'} = $e; - 1; - } - and $e eq 'HACKRAW' - ) { - DEBUG and print " Putting in HACKRAW (no-op) encoding mode.\n"; - - } elsif( Pod::Simple::Transcode::->encoding_is_available($e) ) { - - die($enc_error = "WHAT? _transcoder is already set?!") - if $self->{'_transcoder'}; # should never happen - require Pod::Simple::Transcode; - $self->{'_transcoder'} = Pod::Simple::Transcode::->make_transcoder($e); - eval { - my @x = ('', "abc", "123"); - $self->{'_transcoder'}->(@x); - }; - $@ && die( $enc_error = - "Really unexpected error setting up encoding $e: $@\nAborting" - ); - - } else { - my @supported = Pod::Simple::Transcode::->all_encodings; - - # Note unsupported, and complain - DEBUG and print " Encoding [$e] is unsupported.", - "\nSupporteds: @supported\n"; - my $suggestion = ''; - - # Look for a near match: - my $norm = lc($e); - $norm =~ tr[-_][]d; - my $n; - foreach my $enc (@supported) { - $n = lc($enc); - $n =~ tr[-_][]d; - next unless $n eq $norm; - $suggestion = " (Maybe \"$e\" should be \"$enc\"?)"; - last; - } - my $encmodver = Pod::Simple::Transcode::->encmodver; - $enc_error = join '' => - "This document probably does not appear as it should, because its ", - "\"=encoding $e\" line calls for an unsupported encoding.", - $suggestion, " [$encmodver\'s supported encodings are: @supported]" - ; - - $self->scream( $self->{'line_count'}, $enc_error ); - } - push @{ $self->{'encoding_command_statuses'} }, $enc_error; - - return '=encoding ALREADYDONE'; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _handle_encoding_second_level { - # By time this is called, the encoding (if well formed) will already - # have been acted one. - my($self, $para) = @_; - my @x = @$para; - my $content = join ' ', splice @x, 2; - $content =~ s/^\s+//s; - $content =~ s/\s+$//s; - - DEBUG > 2 and print "Ogling encoding directive: =encoding $content\n"; - - if($content eq 'ALREADYDONE') { - # It's already been handled. Check for errors. - if(! $self->{'encoding_command_statuses'} ) { - DEBUG > 2 and print " CRAZY ERROR: It wasn't really handled?!\n"; - } elsif( $self->{'encoding_command_statuses'}[-1] ) { - $self->whine( $para->[1]{'start_line'}, - sprintf "Couldn't do %s: %s", - $self->{'encoding_command_reqs' }[-1], - $self->{'encoding_command_statuses'}[-1], - ); - } else { - DEBUG > 2 and print " (Yup, it was successfully handled already.)\n"; - } - - } else { - # Otherwise it's a syntax error - $self->whine( $para->[1]{'start_line'}, - "Invalid =encoding syntax: $content" - ); - } - - return; -} - -#~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~` - -{ -my $m = -321; # magic line number - -sub _gen_errata { - my $self = $_[0]; - # Return 0 or more fake-o paragraphs explaining the accumulated - # errors on this document. - - return() unless $self->{'errata'} and keys %{$self->{'errata'}}; - - my @out; - - foreach my $line (sort {$a <=> $b} keys %{$self->{'errata'}}) { - push @out, - ['=item', {'start_line' => $m}, "Around line $line:"], - map( ['~Para', {'start_line' => $m, '~cooked' => 1}, - #['~Top', {'start_line' => $m}, - $_ - #] - ], - @{$self->{'errata'}{$line}} - ) - ; - } - - # TODO: report of unknown entities? unrenderable characters? - - unshift @out, - ['=head1', {'start_line' => $m, 'errata' => 1}, 'POD ERRORS'], - ['~Para', {'start_line' => $m, '~cooked' => 1, 'errata' => 1}, - "Hey! ", - ['B', {}, - 'The above document had some coding errors, which are explained below:' - ] - ], - ['=over', {'start_line' => $m, 'errata' => 1}, ''], - ; - - push @out, - ['=back', {'start_line' => $m, 'errata' => 1}, ''], - ; - - DEBUG and print "\n<<\n", pretty(\@out), "\n>>\n\n"; - - return @out; -} - -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -############################################################################## -## -## stop reading now stop reading now stop reading now stop reading now stop -## -## HERE IT BECOMES REALLY SCARY -## -## stop reading now stop reading now stop reading now stop reading now stop -## -############################################################################## - -sub _ponder_paragraph_buffer { - - # Para-token types as found in the buffer. - # ~Verbatim, ~Para, ~end, =head1..4, =for, =begin, =end, - # =over, =back, =item - # and the null =pod (to be complained about if over one line) - # - # "~data" paragraphs are something we generate at this level, depending on - # a currently open =over region - - # Events fired: Begin and end for: - # directivename (like head1 .. head4), item, extend, - # for (from =begin...=end, =for), - # over-bullet, over-number, over-text, over-block, - # item-bullet, item-number, item-text, - # Document, - # Data, Para, Verbatim - # B, C, longdirname (TODO -- wha?), etc. for all directives - # - - my $self = $_[0]; - my $paras; - return unless @{$paras = $self->{'paras'}}; - my $curr_open = ($self->{'curr_open'} ||= []); - - my $scratch; - - DEBUG > 10 and print "# Paragraph buffer: <<", pretty($paras), ">>\n"; - - # We have something in our buffer. So apparently the document has started. - unless($self->{'doc_has_started'}) { - $self->{'doc_has_started'} = 1; - - my $starting_contentless; - $starting_contentless = - ( - !@$curr_open - and @$paras and ! grep $_->[0] ne '~end', @$paras - # i.e., if the paras is all ~ends - ) - ; - DEBUG and print "# Starting ", - $starting_contentless ? 'contentless' : 'contentful', - " document\n" - ; - - $self->_handle_element_start( - ($scratch = 'Document'), - { - 'start_line' => $paras->[0][1]{'start_line'}, - $starting_contentless ? ( 'contentless' => 1 ) : (), - }, - ); - } - - my($para, $para_type); - while(@$paras) { - last if @$paras == 1 and - ( $paras->[0][0] eq '=over' or $paras->[0][0] eq '~Verbatim' - or $paras->[0][0] eq '=item' ) - ; - # Those're the three kinds of paragraphs that require lookahead. - # Actually, an "=item Foo" inside an <over type=text> region - # and any =item inside an <over type=block> region (rare) - # don't require any lookahead, but all others (bullets - # and numbers) do. - -# TODO: winge about many kinds of directives in non-resolving =for regions? -# TODO: many? like what? =head1 etc? - - $para = shift @$paras; - $para_type = $para->[0]; - - DEBUG > 1 and print "Pondering a $para_type paragraph, given the stack: (", - $self->_dump_curr_open(), ")\n"; - - if($para_type eq '=for') { - next if $self->_ponder_for($para,$curr_open,$paras); - - } elsif($para_type eq '=begin') { - next if $self->_ponder_begin($para,$curr_open,$paras); - - } elsif($para_type eq '=end') { - next if $self->_ponder_end($para,$curr_open,$paras); - - } elsif($para_type eq '~end') { # The virtual end-document signal - next if $self->_ponder_doc_end($para,$curr_open,$paras); - } - - - # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - #~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - if(grep $_->[1]{'~ignore'}, @$curr_open) { - DEBUG > 1 and - print "Skipping $para_type paragraph because in ignore mode.\n"; - next; - } - #~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - - if($para_type eq '=pod') { - $self->_ponder_pod($para,$curr_open,$paras); - - } elsif($para_type eq '=over') { - next if $self->_ponder_over($para,$curr_open,$paras); - - } elsif($para_type eq '=back') { - next if $self->_ponder_back($para,$curr_open,$paras); - - } else { - - # All non-magical codes!!! - - # Here we start using $para_type for our own twisted purposes, to - # mean how it should get treated, not as what the element name - # should be. - - DEBUG > 1 and print "Pondering non-magical $para_type\n"; - - my $i; - - # Enforce some =headN discipline - if($para_type =~ m/^=head\d$/s - and ! $self->{'accept_heads_anywhere'} - and @$curr_open - and $curr_open->[-1][0] eq '=over' - ) { - DEBUG > 2 and print "'=$para_type' inside an '=over'!\n"; - $self->whine( - $para->[1]{'start_line'}, - "You forgot a '=back' before '$para_type'" - ); - unshift @$paras, ['=back', {}, ''], $para; # close the =over - next; - } - - - if($para_type eq '=item') { - - my $over; - unless(@$curr_open and ($over = $curr_open->[-1])->[0] eq '=over') { - $self->whine( - $para->[1]{'start_line'}, - "'=item' outside of any '=over'" - ); - unshift @$paras, - ['=over', {'start_line' => $para->[1]{'start_line'}}, ''], - $para - ; - next; - } - - - my $over_type = $over->[1]{'~type'}; - - if(!$over_type) { - # Shouldn't happen1 - die "Typeless over in stack, starting at line " - . $over->[1]{'start_line'}; - - } elsif($over_type eq 'block') { - unless($curr_open->[-1][1]{'~bitched_about'}) { - $curr_open->[-1][1]{'~bitched_about'} = 1; - $self->whine( - $curr_open->[-1][1]{'start_line'}, - "You can't have =items (as at line " - . $para->[1]{'start_line'} - . ") unless the first thing after the =over is an =item" - ); - } - # Just turn it into a paragraph and reconsider it - $para->[0] = '~Para'; - unshift @$paras, $para; - next; - - } elsif($over_type eq 'text') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - if($item_type eq 'text') { - # Nothing special needs doing for 'text' - } elsif($item_type eq 'number' or $item_type eq 'bullet') { - die "Unknown item type $item_type" - unless $item_type eq 'number' or $item_type eq 'bullet'; - # Undo our clobbering: - push @$para, $para->[1]{'~orig_content'}; - delete $para->[1]{'number'}; - # Only a PROPER item-number element is allowed - # to have a number attribute. - } else { - die "Unhandled item type $item_type"; # should never happen - } - - # =item-text thingies don't need any assimilation, it seems. - - } elsif($over_type eq 'number') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - my $expected_value = ++ $curr_open->[-1][1]{'~counter'}; - - if($item_type eq 'bullet') { - # Hm, it's not numeric. Correct for this. - $para->[1]{'number'} = $expected_value; - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item $expected_value'" - ); - push @$para, $para->[1]{'~orig_content'}; - # restore the bullet, blocking the assimilation of next para - - } elsif($item_type eq 'text') { - # Hm, it's not numeric. Correct for this. - $para->[1]{'number'} = $expected_value; - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item $expected_value'" - ); - # Text content will still be there and will block next ~Para - - } elsif($item_type ne 'number') { - die "Unknown item type $item_type"; # should never happen - - } elsif($expected_value == $para->[1]{'number'}) { - DEBUG > 1 and print " Numeric item has the expected value of $expected_value\n"; - - } else { - DEBUG > 1 and print " Numeric item has ", $para->[1]{'number'}, - " instead of the expected value of $expected_value\n"; - $self->whine( - $para->[1]{'start_line'}, - "You have '=item " . $para->[1]{'number'} . - "' instead of the expected '=item $expected_value'" - ); - $para->[1]{'number'} = $expected_value; # correcting!! - } - - if(@$para == 2) { - # For the cases where we /didn't/ push to @$para - if($paras->[0][0] eq '~Para') { - DEBUG and print "Assimilating following ~Para content into $over_type item\n"; - push @$para, splice @{shift @$paras},2; - } else { - DEBUG and print "Can't assimilate following ", $paras->[0][0], "\n"; - push @$para, ''; # Just so it's not contentless - } - } - - - } elsif($over_type eq 'bullet') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - if($item_type eq 'bullet') { - # as expected! - - if( $para->[1]{'~_freaky_para_hack'} ) { - DEBUG and print "Accomodating '=item * Foo' tolerance hack.\n"; - push @$para, delete $para->[1]{'~_freaky_para_hack'}; - } - - } elsif($item_type eq 'number') { - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item *'" - ); - push @$para, $para->[1]{'~orig_content'}; - # and block assimilation of the next paragraph - delete $para->[1]{'number'}; - # Only a PROPER item-number element is allowed - # to have a number attribute. - } elsif($item_type eq 'text') { - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item *'" - ); - # But doesn't need processing. But it'll block assimilation - # of the next para. - } else { - die "Unhandled item type $item_type"; # should never happen - } - - if(@$para == 2) { - # For the cases where we /didn't/ push to @$para - if($paras->[0][0] eq '~Para') { - DEBUG and print "Assimilating following ~Para content into $over_type item\n"; - push @$para, splice @{shift @$paras},2; - } else { - DEBUG and print "Can't assimilate following ", $paras->[0][0], "\n"; - push @$para, ''; # Just so it's not contentless - } - } - - } else { - die "Unhandled =over type \"$over_type\"?"; - # Shouldn't happen! - } - - $para_type = 'Plain'; - $para->[0] .= '-' . $over_type; - # Whew. Now fall thru and process it. - - - } elsif($para_type eq '=extend') { - # Well, might as well implement it here. - $self->_ponder_extend($para); - next; # and skip - } elsif($para_type eq '=encoding') { - # Not actually acted on here, but we catch errors here. - $self->_handle_encoding_second_level($para); - - next; # and skip - } elsif($para_type eq '~Verbatim') { - $para->[0] = 'Verbatim'; - $para_type = '?Verbatim'; - } elsif($para_type eq '~Para') { - $para->[0] = 'Para'; - $para_type = '?Plain'; - } elsif($para_type eq 'Data') { - $para->[0] = 'Data'; - $para_type = '?Data'; - } elsif( $para_type =~ s/^=//s - and defined( $para_type = $self->{'accept_directives'}{$para_type} ) - ) { - DEBUG > 1 and print " Pondering known directive ${$para}[0] as $para_type\n"; - } else { - # An unknown directive! - DEBUG > 1 and printf "Unhandled directive %s (Handled: %s)\n", - $para->[0], join(' ', sort keys %{$self->{'accept_directives'}} ) - ; - $self->whine( - $para->[1]{'start_line'}, - "Unknown directive: $para->[0]" - ); - - # And maybe treat it as text instead of just letting it go? - next; - } - - if($para_type =~ s/^\?//s) { - if(! @$curr_open) { # usual case - DEBUG and print "Treating $para_type paragraph as such because stack is empty.\n"; - } else { - my @fors = grep $_->[0] eq '=for', @$curr_open; - DEBUG > 1 and print "Containing fors: ", - join(',', map $_->[1]{'target'}, @fors), "\n"; - - if(! @fors) { - DEBUG and print "Treating $para_type paragraph as such because stack has no =for's\n"; - - #} elsif(grep $_->[1]{'~resolve'}, @fors) { - #} elsif(not grep !$_->[1]{'~resolve'}, @fors) { - } elsif( $fors[-1][1]{'~resolve'} ) { - # Look to the immediately containing for - - if($para_type eq 'Data') { - DEBUG and print "Treating Data paragraph as Plain/Verbatim because the containing =for ($fors[-1][1]{'target'}) is a resolver\n"; - $para->[0] = 'Para'; - $para_type = 'Plain'; - } else { - DEBUG and print "Treating $para_type paragraph as such because the containing =for ($fors[-1][1]{'target'}) is a resolver\n"; - } - } else { - DEBUG and print "Treating $para_type paragraph as Data because the containing =for ($fors[-1][1]{'target'}) is a non-resolver\n"; - $para->[0] = $para_type = 'Data'; - } - } - } - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if($para_type eq 'Plain') { - $self->_ponder_Plain($para); - } elsif($para_type eq 'Verbatim') { - $self->_ponder_Verbatim($para); - } elsif($para_type eq 'Data') { - $self->_ponder_Data($para); - } else { - die "\$para type is $para_type -- how did that happen?"; - # Shouldn't happen. - } - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - $para->[0] =~ s/^[~=]//s; - - DEBUG and print "\n", pretty($para), "\n"; - - # traverse the treelet (which might well be just one string scalar) - $self->{'content_seen'} ||= 1; - $self->_traverse_treelet_bit(@$para); - } - } - - return; -} - -########################################################################### -# The sub-ponderers... - - - -sub _ponder_for { - my ($self,$para,$curr_open,$paras) = @_; - - # Fake it out as a begin/end - my $target; - - if(grep $_->[1]{'~ignore'}, @$curr_open) { - DEBUG > 1 and print "Ignoring ignorable =for\n"; - return 1; - } - - for(my $i = 2; $i < @$para; ++$i) { - if($para->[$i] =~ s/^\s*(\S+)\s*//s) { - $target = $1; - last; - } - } - unless(defined $target) { - $self->whine( - $para->[1]{'start_line'}, - "=for without a target?" - ); - return 1; - } - DEBUG > 1 and - print "Faking out a =for $target as a =begin $target / =end $target\n"; - - $para->[0] = 'Data'; - - unshift @$paras, - ['=begin', - {'start_line' => $para->[1]{'start_line'}, '~really' => '=for'}, - $target, - ], - $para, - ['=end', - {'start_line' => $para->[1]{'start_line'}, '~really' => '=for'}, - $target, - ], - ; - - return 1; -} - -sub _ponder_begin { - my ($self,$para,$curr_open,$paras) = @_; - my $content = join ' ', splice @$para, 2; - $content =~ s/^\s+//s; - $content =~ s/\s+$//s; - unless(length($content)) { - $self->whine( - $para->[1]{'start_line'}, - "=begin without a target?" - ); - DEBUG and print "Ignoring targetless =begin\n"; - return 1; - } - - unless($content =~ m/^\S+$/s) { # i.e., unless it's one word - $self->whine( - $para->[1]{'start_line'}, - "'=begin' only takes one parameter, not several as in '=begin $content'" - ); - DEBUG and print "Ignoring unintelligible =begin $content\n"; - return 1; - } - - - $para->[1]{'target'} = $content; # without any ':' - - $content =~ s/^:!/!:/s; - my $neg; # whether this is a negation-match - $neg = 1 if $content =~ s/^!//s; - my $to_resolve; # whether to process formatting codes - $to_resolve = 1 if $content =~ s/^://s; - - my $dont_ignore; # whether this target matches us - - foreach my $target_name ( - split(',', $content, -1), - $neg ? () : '*' - ) { - DEBUG > 2 and - print " Considering whether =begin $content matches $target_name\n"; - next unless $self->{'accept_targets'}{$target_name}; - - DEBUG > 2 and - print " It DOES match the acceptable target $target_name!\n"; - $to_resolve = 1 - if $self->{'accept_targets'}{$target_name} eq 'force_resolve'; - $dont_ignore = 1; - $para->[1]{'target_matching'} = $target_name; - last; # stop looking at other target names - } - - if($neg) { - if( $dont_ignore ) { - $dont_ignore = ''; - delete $para->[1]{'target_matching'}; - DEBUG > 2 and print " But the leading ! means that this is a NON-match!\n"; - } else { - $dont_ignore = 1; - $para->[1]{'target_matching'} = '!'; - DEBUG > 2 and print " But the leading ! means that this IS a match!\n"; - } - } - - $para->[0] = '=for'; # Just what we happen to call these, internally - $para->[1]{'~really'} ||= '=begin'; - $para->[1]{'~ignore'} = (! $dont_ignore) || 0; - $para->[1]{'~resolve'} = $to_resolve || 0; - - DEBUG > 1 and print " Making note to ", $dont_ignore ? 'not ' : '', - "ignore contents of this region\n"; - DEBUG > 1 and $dont_ignore and print " Making note to treat contents as ", - ($to_resolve ? 'verbatim/plain' : 'data'), " paragraphs\n"; - DEBUG > 1 and print " (Stack now: ", $self->_dump_curr_open(), ")\n"; - - push @$curr_open, $para; - if(!$dont_ignore or scalar grep $_->[1]{'~ignore'}, @$curr_open) { - DEBUG > 1 and print "Ignoring ignorable =begin\n"; - } else { - $self->{'content_seen'} ||= 1; - $self->_handle_element_start((my $scratch='for'), $para->[1]); - } - - return 1; -} - -sub _ponder_end { - my ($self,$para,$curr_open,$paras) = @_; - my $content = join ' ', splice @$para, 2; - $content =~ s/^\s+//s; - $content =~ s/\s+$//s; - DEBUG and print "Ogling '=end $content' directive\n"; - - unless(length($content)) { - $self->whine( - $para->[1]{'start_line'}, - "'=end' without a target?" . ( - ( @$curr_open and $curr_open->[-1][0] eq '=for' ) - ? ( " (Should be \"=end " . $curr_open->[-1][1]{'target'} . '")' ) - : '' - ) - ); - DEBUG and print "Ignoring targetless =end\n"; - return 1; - } - - unless($content =~ m/^\S+$/) { # i.e., unless it's one word - $self->whine( - $para->[1]{'start_line'}, - "'=end $content' is invalid. (Stack: " - . $self->_dump_curr_open() . ')' - ); - DEBUG and print "Ignoring mistargetted =end $content\n"; - return 1; - } - - unless(@$curr_open and $curr_open->[-1][0] eq '=for') { - $self->whine( - $para->[1]{'start_line'}, - "=end $content without matching =begin. (Stack: " - . $self->_dump_curr_open() . ')' - ); - DEBUG and print "Ignoring mistargetted =end $content\n"; - return 1; - } - - unless($content eq $curr_open->[-1][1]{'target'}) { - $self->whine( - $para->[1]{'start_line'}, - "=end $content doesn't match =begin " - . $curr_open->[-1][1]{'target'} - . ". (Stack: " - . $self->_dump_curr_open() . ')' - ); - DEBUG and print "Ignoring mistargetted =end $content at line $para->[1]{'start_line'}\n"; - return 1; - } - - # Else it's okay to close... - if(grep $_->[1]{'~ignore'}, @$curr_open) { - DEBUG > 1 and print "Not firing any event for this =end $content because in an ignored region\n"; - # And that may be because of this to-be-closed =for region, or some - # other one, but it doesn't matter. - } else { - $curr_open->[-1][1]{'start_line'} = $para->[1]{'start_line'}; - # what's that for? - - $self->{'content_seen'} ||= 1; - $self->_handle_element_end( my $scratch = 'for' ); - } - DEBUG > 1 and print "Popping $curr_open->[-1][0] $curr_open->[-1][1]{'target'} because of =end $content\n"; - pop @$curr_open; - - return 1; -} - -sub _ponder_doc_end { - my ($self,$para,$curr_open,$paras) = @_; - if(@$curr_open) { # Deal with things left open - DEBUG and print "Stack is nonempty at end-document: (", - $self->_dump_curr_open(), ")\n"; - - DEBUG > 9 and print "Stack: ", pretty($curr_open), "\n"; - unshift @$paras, $self->_closers_for_all_curr_open; - # Make sure there is exactly one ~end in the parastack, at the end: - @$paras = grep $_->[0] ne '~end', @$paras; - push @$paras, $para, $para; - # We need two -- once for the next cycle where we - # generate errata, and then another to be at the end - # when that loop back around to process the errata. - return 1; - - } else { - DEBUG and print "Okay, stack is empty now.\n"; - } - - # Try generating errata section, if applicable - unless($self->{'~tried_gen_errata'}) { - $self->{'~tried_gen_errata'} = 1; - my @extras = $self->_gen_errata(); - if(@extras) { - unshift @$paras, @extras; - DEBUG and print "Generated errata... relooping...\n"; - return 1; # I.e., loop around again to process these fake-o paragraphs - } - } - - splice @$paras; # Well, that's that for this paragraph buffer. - DEBUG and print "Throwing end-document event.\n"; - - $self->_handle_element_end( my $scratch = 'Document' ); - return 1; # Hasta la byebye -} - -sub _ponder_pod { - my ($self,$para,$curr_open,$paras) = @_; - $self->whine( - $para->[1]{'start_line'}, - "=pod directives shouldn't be over one line long! Ignoring all " - . (@$para - 2) . " lines of content" - ) if @$para > 3; - # Content is always ignored. - return; -} - -sub _ponder_over { - my ($self,$para,$curr_open,$paras) = @_; - return 1 unless @$paras; - my $list_type; - - if($paras->[0][0] eq '=item') { # most common case - $list_type = $self->_get_initial_item_type($paras->[0]); - - } elsif($paras->[0][0] eq '=back') { - # Ignore empty lists. TODO: make this an option? - shift @$paras; - return 1; - - } elsif($paras->[0][0] eq '~end') { - $self->whine( - $para->[1]{'start_line'}, - "=over is the last thing in the document?!" - ); - return 1; # But feh, ignore it. - } else { - $list_type = 'block'; - } - $para->[1]{'~type'} = $list_type; - push @$curr_open, $para; - # yes, we reuse the paragraph as a stack item - - my $content = join ' ', splice @$para, 2; - my $overness; - if($content =~ m/^\s*$/s) { - $para->[1]{'indent'} = 4; - } elsif($content =~ m/^\s*((?:\d*\.)?\d+)\s*$/s) { - no integer; - $para->[1]{'indent'} = $1; - if($1 == 0) { - $self->whine( - $para->[1]{'start_line'}, - "Can't have a 0 in =over $content" - ); - $para->[1]{'indent'} = 4; - } - } else { - $self->whine( - $para->[1]{'start_line'}, - "=over should be: '=over' or '=over positive_number'" - ); - $para->[1]{'indent'} = 4; - } - DEBUG > 1 and print "=over found of type $list_type\n"; - - $self->{'content_seen'} ||= 1; - $self->_handle_element_start((my $scratch = 'over-' . $list_type), $para->[1]); - - return; -} - -sub _ponder_back { - my ($self,$para,$curr_open,$paras) = @_; - # TODO: fire off </item-number> or </item-bullet> or </item-text> ?? - - my $content = join ' ', splice @$para, 2; - if($content =~ m/\S/) { - $self->whine( - $para->[1]{'start_line'}, - "=back doesn't take any parameters, but you said =back $content" - ); - } - - if(@$curr_open and $curr_open->[-1][0] eq '=over') { - DEBUG > 1 and print "=back happily closes matching =over\n"; - # Expected case: we're closing the most recently opened thing - #my $over = pop @$curr_open; - $self->{'content_seen'} ||= 1; - $self->_handle_element_end( my $scratch = - 'over-' . ( (pop @$curr_open)->[1]{'~type'} ) - ); - } else { - DEBUG > 1 and print "=back found without a matching =over. Stack: (", - join(', ', map $_->[0], @$curr_open), ").\n"; - $self->whine( - $para->[1]{'start_line'}, - '=back without =over' - ); - return 1; # and ignore it - } -} - -sub _ponder_item { - my ($self,$para,$curr_open,$paras) = @_; - my $over; - unless(@$curr_open and ($over = $curr_open->[-1])->[0] eq '=over') { - $self->whine( - $para->[1]{'start_line'}, - "'=item' outside of any '=over'" - ); - unshift @$paras, - ['=over', {'start_line' => $para->[1]{'start_line'}}, ''], - $para - ; - return 1; - } - - - my $over_type = $over->[1]{'~type'}; - - if(!$over_type) { - # Shouldn't happen1 - die "Typeless over in stack, starting at line " - . $over->[1]{'start_line'}; - - } elsif($over_type eq 'block') { - unless($curr_open->[-1][1]{'~bitched_about'}) { - $curr_open->[-1][1]{'~bitched_about'} = 1; - $self->whine( - $curr_open->[-1][1]{'start_line'}, - "You can't have =items (as at line " - . $para->[1]{'start_line'} - . ") unless the first thing after the =over is an =item" - ); - } - # Just turn it into a paragraph and reconsider it - $para->[0] = '~Para'; - unshift @$paras, $para; - return 1; - - } elsif($over_type eq 'text') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - if($item_type eq 'text') { - # Nothing special needs doing for 'text' - } elsif($item_type eq 'number' or $item_type eq 'bullet') { - die "Unknown item type $item_type" - unless $item_type eq 'number' or $item_type eq 'bullet'; - # Undo our clobbering: - push @$para, $para->[1]{'~orig_content'}; - delete $para->[1]{'number'}; - # Only a PROPER item-number element is allowed - # to have a number attribute. - } else { - die "Unhandled item type $item_type"; # should never happen - } - - # =item-text thingies don't need any assimilation, it seems. - - } elsif($over_type eq 'number') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - my $expected_value = ++ $curr_open->[-1][1]{'~counter'}; - - if($item_type eq 'bullet') { - # Hm, it's not numeric. Correct for this. - $para->[1]{'number'} = $expected_value; - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item $expected_value'" - ); - push @$para, $para->[1]{'~orig_content'}; - # restore the bullet, blocking the assimilation of next para - - } elsif($item_type eq 'text') { - # Hm, it's not numeric. Correct for this. - $para->[1]{'number'} = $expected_value; - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item $expected_value'" - ); - # Text content will still be there and will block next ~Para - - } elsif($item_type ne 'number') { - die "Unknown item type $item_type"; # should never happen - - } elsif($expected_value == $para->[1]{'number'}) { - DEBUG > 1 and print " Numeric item has the expected value of $expected_value\n"; - - } else { - DEBUG > 1 and print " Numeric item has ", $para->[1]{'number'}, - " instead of the expected value of $expected_value\n"; - $self->whine( - $para->[1]{'start_line'}, - "You have '=item " . $para->[1]{'number'} . - "' instead of the expected '=item $expected_value'" - ); - $para->[1]{'number'} = $expected_value; # correcting!! - } - - if(@$para == 2) { - # For the cases where we /didn't/ push to @$para - if($paras->[0][0] eq '~Para') { - DEBUG and print "Assimilating following ~Para content into $over_type item\n"; - push @$para, splice @{shift @$paras},2; - } else { - DEBUG and print "Can't assimilate following ", $paras->[0][0], "\n"; - push @$para, ''; # Just so it's not contentless - } - } - - - } elsif($over_type eq 'bullet') { - my $item_type = $self->_get_item_type($para); - # That kills the content of the item if it's a number or bullet. - DEBUG and print " Item is of type ", $para->[0], " under $over_type\n"; - - if($item_type eq 'bullet') { - # as expected! - - if( $para->[1]{'~_freaky_para_hack'} ) { - DEBUG and print "Accomodating '=item * Foo' tolerance hack.\n"; - push @$para, delete $para->[1]{'~_freaky_para_hack'}; - } - - } elsif($item_type eq 'number') { - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item *'" - ); - push @$para, $para->[1]{'~orig_content'}; - # and block assimilation of the next paragraph - delete $para->[1]{'number'}; - # Only a PROPER item-number element is allowed - # to have a number attribute. - } elsif($item_type eq 'text') { - $self->whine( - $para->[1]{'start_line'}, - "Expected '=item *'" - ); - # But doesn't need processing. But it'll block assimilation - # of the next para. - } else { - die "Unhandled item type $item_type"; # should never happen - } - - if(@$para == 2) { - # For the cases where we /didn't/ push to @$para - if($paras->[0][0] eq '~Para') { - DEBUG and print "Assimilating following ~Para content into $over_type item\n"; - push @$para, splice @{shift @$paras},2; - } else { - DEBUG and print "Can't assimilate following ", $paras->[0][0], "\n"; - push @$para, ''; # Just so it's not contentless - } - } - - } else { - die "Unhandled =over type \"$over_type\"?"; - # Shouldn't happen! - } - $para->[0] .= '-' . $over_type; - - return; -} - -sub _ponder_Plain { - my ($self,$para) = @_; - DEBUG and print " giving plain treatment...\n"; - unless( @$para == 2 or ( @$para == 3 and $para->[2] eq '' ) - or $para->[1]{'~cooked'} - ) { - push @$para, - @{$self->_make_treelet( - join("\n", splice(@$para, 2)), - $para->[1]{'start_line'} - )}; - } - # Empty paragraphs don't need a treelet for any reason I can see. - # And precooked paragraphs already have a treelet. - return; -} - -sub _ponder_Verbatim { - my ($self,$para) = @_; - DEBUG and print " giving verbatim treatment...\n"; - - $para->[1]{'xml:space'} = 'preserve'; - for(my $i = 2; $i < @$para; $i++) { - foreach my $line ($para->[$i]) { # just for aliasing - while( $line =~ - # Sort of adapted from Text::Tabs -- yes, it's hardwired in that - # tabs are at every EIGHTH column. For portability, it has to be - # one setting everywhere, and 8th wins. - s/^([^\t]*)(\t+)/$1.(" " x ((length($2)<<3)-(length($1)&7)))/e - ) {} - - # TODO: whinge about (or otherwise treat) unindented or overlong lines - - } - } - - # Now the VerbatimFormatted hoodoo... - if( $self->{'accept_codes'} and - $self->{'accept_codes'}{'VerbatimFormatted'} - ) { - while(@$para > 3 and $para->[-1] !~ m/\S/) { pop @$para } - # Kill any number of terminal newlines - $self->_verbatim_format($para); - } elsif ($self->{'codes_in_verbatim'}) { - push @$para, - @{$self->_make_treelet( - join("\n", splice(@$para, 2)), - $para->[1]{'start_line'}, $para->[1]{'xml:space'} - )}; - $para->[-1] =~ s/\n+$//s; # Kill any number of terminal newlines - } else { - push @$para, join "\n", splice(@$para, 2) if @$para > 3; - $para->[-1] =~ s/\n+$//s; # Kill any number of terminal newlines - } - return; -} - -sub _ponder_Data { - my ($self,$para) = @_; - DEBUG and print " giving data treatment...\n"; - $para->[1]{'xml:space'} = 'preserve'; - push @$para, join "\n", splice(@$para, 2) if @$para > 3; - return; -} - - - - -########################################################################### - -sub _traverse_treelet_bit { # for use only by the routine above - my($self, $name) = splice @_,0,2; - - my $scratch; - $self->_handle_element_start(($scratch=$name), shift @_); - - foreach my $x (@_) { - if(ref($x)) { - &_traverse_treelet_bit($self, @$x); - } else { - $self->_handle_text($x); - } - } - - $self->_handle_element_end($scratch=$name); - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _closers_for_all_curr_open { - my $self = $_[0]; - my @closers; - foreach my $still_open (@{ $self->{'curr_open'} || return }) { - my @copy = @$still_open; - $copy[1] = {%{ $copy[1] }}; - #$copy[1]{'start_line'} = -1; - if($copy[0] eq '=for') { - $copy[0] = '=end'; - } elsif($copy[0] eq '=over') { - $copy[0] = '=back'; - } else { - die "I don't know how to auto-close an open $copy[0] region"; - } - - unless( @copy > 2 ) { - push @copy, $copy[1]{'target'}; - $copy[-1] = '' unless defined $copy[-1]; - # since =over's don't have targets - } - - DEBUG and print "Queuing up fake-o event: ", pretty(\@copy), "\n"; - unshift @closers, \@copy; - } - return @closers; -} - -#-------------------------------------------------------------------------- - -sub _verbatim_format { - my($it, $p) = @_; - - my $formatting; - - for(my $i = 2; $i < @$p; $i++) { # work backwards over the lines - DEBUG and print "_verbatim_format appends a newline to $i: $p->[$i]\n"; - $p->[$i] .= "\n"; - # Unlike with simple Verbatim blocks, we don't end up just doing - # a join("\n", ...) on the contents, so we have to append a - # newline to ever line, and then nix the last one later. - } - - if( DEBUG > 4 ) { - print "<<\n"; - for(my $i = $#$p; $i >= 2; $i--) { # work backwards over the lines - print "_verbatim_format $i: $p->[$i]"; - } - print ">>\n"; - } - - for(my $i = $#$p; $i > 2; $i--) { - # work backwards over the lines, except the first (#2) - - #next unless $p->[$i] =~ m{^#:([ \^\/\%]*)\n?$}s - # and $p->[$i-1] !~ m{^#:[ \^\/\%]*\n?$}s; - # look at a formatty line preceding a nonformatty one - DEBUG > 5 and print "Scrutinizing line $i: $$p[$i]\n"; - if($p->[$i] =~ m{^#:([ \^\/\%]*)\n?$}s) { - DEBUG > 5 and print " It's a formatty line. ", - "Peeking at previous line ", $i-1, ": $$p[$i-1]: \n"; - - if( $p->[$i-1] =~ m{^#:[ \^\/\%]*\n?$}s ) { - DEBUG > 5 and print " Previous line is formatty! Skipping this one.\n"; - next; - } else { - DEBUG > 5 and print " Previous line is non-formatty! Yay!\n"; - } - } else { - DEBUG > 5 and print " It's not a formatty line. Ignoring\n"; - next; - } - - # A formatty line has to have #: in the first two columns, and uses - # "^" to mean bold, "/" to mean underline, and "%" to mean bold italic. - # Example: - # What do you want? i like pie. [or whatever] - # #:^^^^^^^^^^^^^^^^^ ///////////// - - - DEBUG > 4 and print "_verbatim_format considers:\n<$p->[$i-1]>\n<$p->[$i]>\n"; - - $formatting = ' ' . $1; - $formatting =~ s/\s+$//s; # nix trailing whitespace - unless(length $formatting and $p->[$i-1] =~ m/\S/) { # no-op - splice @$p,$i,1; # remove this line - $i--; # don't consider next line - next; - } - - if( length($formatting) >= length($p->[$i-1]) ) { - $formatting = substr($formatting, 0, length($p->[$i-1]) - 1) . ' '; - } else { - $formatting .= ' ' x (length($p->[$i-1]) - length($formatting)); - } - # Make $formatting and the previous line be exactly the same length, - # with $formatting having a " " as the last character. - - DEBUG > 4 and print "Formatting <$formatting> on <", $p->[$i-1], ">\n"; - - - my @new_line; - while( $formatting =~ m{\G(( +)|(\^+)|(\/+)|(\%+))}g ) { - #print "Format matches $1\n"; - - if($2) { - #print "SKIPPING <$2>\n"; - push @new_line, - substr($p->[$i-1], pos($formatting)-length($1), length($1)); - } else { - #print "SNARING $+\n"; - push @new_line, [ - ( - $3 ? 'VerbatimB' : - $4 ? 'VerbatimI' : - $5 ? 'VerbatimBI' : die("Should never get called") - ), {}, - substr($p->[$i-1], pos($formatting)-length($1), length($1)) - ]; - #print "Formatting <$new_line[-1][-1]> as $new_line[-1][0]\n"; - } - } - my @nixed = - splice @$p, $i-1, 2, @new_line; # replace myself and the next line - DEBUG > 10 and print "Nixed count: ", scalar(@nixed), "\n"; - - DEBUG > 6 and print "New version of the above line is these tokens (", - scalar(@new_line), "):", - map( ref($_)?"<@$_> ":"<$_>", @new_line ), "\n"; - $i--; # So the next line we scrutinize is the line before the one - # that we just went and formatted - } - - $p->[0] = 'VerbatimFormatted'; - - # Collapse adjacent text nodes, just for kicks. - for( my $i = 2; $i > $#$p; $i++ ) { # work forwards over the tokens except for the last - if( !ref($p->[$i]) and !ref($p->[$i + 1]) ) { - DEBUG > 5 and print "_verbatim_format merges {$p->[$i]} and {$p->[$i+1]}\n"; - $p->[$i] .= splice @$p, $i+1, 1; # merge - --$i; # and back up - } - } - - # Now look for the last text token, and remove the terminal newline - for( my $i = $#$p; $i >= 2; $i-- ) { - # work backwards over the tokens, even the first - if( !ref($p->[$i]) ) { - if($p->[$i] =~ s/\n$//s) { - DEBUG > 5 and print "_verbatim_format killed the terminal newline on #$i: {$p->[$i]}, after {$p->[$i-1]}\n"; - } else { - DEBUG > 5 and print - "No terminal newline on #$i: {$p->[$i]}, after {$p->[$i-1]} !?\n"; - } - last; # we only want the next one - } - } - - return; -} - - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - - -sub _treelet_from_formatting_codes { - # Given a paragraph, returns a treelet. Full of scary tokenizing code. - # Like [ '~Top', {'start_line' => $start_line}, - # "I like ", - # [ 'B', {}, "pie" ], - # "!" - # ] - - my($self, $para, $start_line, $preserve_space) = @_; - - my $treelet = ['~Top', {'start_line' => $start_line},]; - - unless ($preserve_space || $self->{'preserve_whitespace'}) { - $para =~ s/\. /\.\xA0 /g if $self->{'fullstop_space_harden'}; - - $para =~ s/\s+/ /g; # collapse and trim all whitespace first. - $para =~ s/ $//; - $para =~ s/^ //; - } - - # Only apparent problem the above code is that N<< >> turns into - # N<< >>. But then, word wrapping does that too! So don't do that! - - my @stack; - my @lineage = ($treelet); - - DEBUG > 4 and print "Paragraph:\n$para\n\n"; - - # Here begins our frightening tokenizer RE. The following regex matches - # text in four main parts: - # - # * Start-codes. The first alternative matches C< or C<<, the latter - # followed by some whitespace. $1 will hold the entire start code - # (including any space following a multiple-angle-bracket delimiter), - # and $2 will hold only the additional brackets past the first in a - # multiple-bracket delimiter. length($2) + 1 will be the number of - # closing brackets we have to find. - # - # * Closing brackets. Match some amount of whitespace followed by - # multiple close brackets. The logic to see if this closes anything - # is down below. Note that in order to parse C<< >> correctly, we - # have to use look-behind (?<=\s\s), since the match of the starting - # code will have consumed the whitespace. - # - # * A single closing bracket, to close a simple code like C<>. - # - # * Something that isn't a start or end code. We have to be careful - # about accepting whitespace, since perlpodspec says that any whitespace - # before a multiple-bracket closing delimiter should be ignored. - # - while($para =~ - m/\G - (?: - # Match starting codes, including the whitespace following a - # multiple-delimiter start code. $1 gets the whole start code and - # $2 gets all but one of the <s in the multiple-bracket case. - ([A-Z]<(?:(<+)\s+)?) - | - # Match multiple-bracket end codes. $3 gets the whitespace that - # should be discarded before an end bracket but kept in other cases - # and $4 gets the end brackets themselves. - (\s+|(?<=\s\s))(>{2,}) - | - (\s?>) # $5: simple end-codes - | - ( # $6: stuff containing no start-codes or end-codes - (?: - [^A-Z\s>] - | - (?: - [A-Z](?!<) - ) - | - (?: - \s(?!\s*>) - ) - )+ - ) - ) - /xgo - ) { - DEBUG > 4 and print "\nParagraphic tokenstack = (@stack)\n"; - if(defined $1) { - if(defined $2) { - DEBUG > 3 and print "Found complex start-text code \"$1\"\n"; - push @stack, length($2) + 1; - # length of the necessary complex end-code string - } else { - DEBUG > 3 and print "Found simple start-text code \"$1\"\n"; - push @stack, 0; # signal that we're looking for simple - } - push @lineage, [ substr($1,0,1), {}, ]; # new node object - push @{ $lineage[-2] }, $lineage[-1]; - - } elsif(defined $4) { - DEBUG > 3 and print "Found apparent complex end-text code \"$3$4\"\n"; - # This is where it gets messy... - if(! @stack) { - # We saw " >>>>" but needed nothing. This is ALL just stuff then. - DEBUG > 4 and print " But it's really just stuff.\n"; - push @{ $lineage[-1] }, $3, $4; - next; - } elsif(!$stack[-1]) { - # We saw " >>>>" but needed only ">". Back pos up. - DEBUG > 4 and print " And that's more than we needed to close simple.\n"; - push @{ $lineage[-1] }, $3; # That was a for-real space, too. - pos($para) = pos($para) - length($4) + 1; - } elsif($stack[-1] == length($4)) { - # We found " >>>>", and it was exactly what we needed. Commonest case. - DEBUG > 4 and print " And that's exactly what we needed to close complex.\n"; - } elsif($stack[-1] < length($4)) { - # We saw " >>>>" but needed only " >>". Back pos up. - DEBUG > 4 and print " And that's more than we needed to close complex.\n"; - pos($para) = pos($para) - length($4) + $stack[-1]; - } else { - # We saw " >>>>" but needed " >>>>>>". So this is all just stuff! - DEBUG > 4 and print " But it's really just stuff, because we needed more.\n"; - push @{ $lineage[-1] }, $3, $4; - next; - } - #print "\nHOOBOY ", scalar(@{$lineage[-1]}), "!!!\n"; - - push @{ $lineage[-1] }, '' if 2 == @{ $lineage[-1] }; - # Keep the element from being childless - - pop @stack; - pop @lineage; - - } elsif(defined $5) { - DEBUG > 3 and print "Found apparent simple end-text code \"$4\"\n"; - - if(@stack and ! $stack[-1]) { - # We're indeed expecting a simple end-code - DEBUG > 4 and print " It's indeed an end-code.\n"; - - if(length($5) == 2) { # There was a space there: " >" - push @{ $lineage[-1] }, ' '; - } elsif( 2 == @{ $lineage[-1] } ) { # Closing a childless element - push @{ $lineage[-1] }, ''; # keep it from being really childless - } - - pop @stack; - pop @lineage; - } else { - DEBUG > 4 and print " It's just stuff.\n"; - push @{ $lineage[-1] }, $5; - } - - } elsif(defined $6) { - DEBUG > 3 and print "Found stuff \"$6\"\n"; - push @{ $lineage[-1] }, $6; - - } else { - # should never ever ever ever happen - DEBUG and print "AYYAYAAAAA at line ", __LINE__, "\n"; - die "SPORK 512512!"; - } - } - - if(@stack) { # Uhoh, some sequences weren't closed. - my $x= "..."; - while(@stack) { - push @{ $lineage[-1] }, '' if 2 == @{ $lineage[-1] }; - # Hmmmmm! - - my $code = (pop @lineage)->[0]; - my $ender_length = pop @stack; - if($ender_length) { - --$ender_length; - $x = $code . ("<" x $ender_length) . " $x " . (">" x $ender_length); - } else { - $x = $code . "<$x>"; - } - } - DEBUG > 1 and print "Unterminated $x sequence\n"; - $self->whine($start_line, - "Unterminated $x sequence", - ); - } - - return $treelet; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub text_content_of_treelet { # method: $parser->text_content_of_treelet($lol) - return stringify_lol($_[1]); -} - -sub stringify_lol { # function: stringify_lol($lol) - my $string_form = ''; - _stringify_lol( $_[0] => \$string_form ); - return $string_form; -} - -sub _stringify_lol { # the real recursor - my($lol, $to) = @_; - use UNIVERSAL (); - for(my $i = 2; $i < @$lol; ++$i) { - if( ref($lol->[$i] || '') and UNIVERSAL::isa($lol->[$i], 'ARRAY') ) { - _stringify_lol( $lol->[$i], $to); # recurse! - } else { - $$to .= $lol->[$i]; - } - } - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _dump_curr_open { # return a string representation of the stack - my $curr_open = $_[0]{'curr_open'}; - - return '[empty]' unless @$curr_open; - return join '; ', - map {; - ($_->[0] eq '=for') - ? ( ($_->[1]{'~really'} || '=over') - . ' ' . $_->[1]{'target'}) - : $_->[0] - } - @$curr_open - ; -} - -########################################################################### -my %pretty_form = ( - "\a" => '\a', # ding! - "\b" => '\b', # BS - "\e" => '\e', # ESC - "\f" => '\f', # FF - "\t" => '\t', # tab - "\cm" => '\cm', - "\cj" => '\cj', - "\n" => '\n', # probably overrides one of either \cm or \cj - '"' => '\"', - '\\' => '\\\\', - '$' => '\\$', - '@' => '\\@', - '%' => '\\%', - '#' => '\\#', -); - -sub pretty { # adopted from Class::Classless - # Not the most brilliant routine, but passable. - # Don't give it a cyclic data structure! - my @stuff = @_; # copy - my $x; - my $out = - # join ",\n" . - join ", ", - map {; - if(!defined($_)) { - "undef"; - } elsif(ref($_) eq 'ARRAY' or ref($_) eq 'Pod::Simple::LinkSection') { - $x = "[ " . pretty(@$_) . " ]" ; - $x; - } elsif(ref($_) eq 'SCALAR') { - $x = "\\" . pretty($$_) ; - $x; - } elsif(ref($_) eq 'HASH') { - my $hr = $_; - $x = "{" . join(", ", - map(pretty($_) . '=>' . pretty($hr->{$_}), - sort keys %$hr ) ) . "}" ; - $x; - } elsif(!length($_)) { q{''} # empty string - } elsif( - $_ eq '0' # very common case - or( - m/^-?(?:[123456789]\d*|0)(?:\.\d+)?$/s - and $_ ne '-0' # the strange case that that RE lets thru - ) - ) { $_; - } else { - if( chr(65) eq 'A' ) { - s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])> - #<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg; - <$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg; - } else { - # We're in some crazy non-ASCII world! - s<([^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])> - #<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg; - <$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg; - } - qq{"$_"}; - } - } @stuff; - # $out =~ s/\n */ /g if length($out) < 75; - return $out; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -# A rather unsubtle method of blowing away all the state information -# from a parser object so it can be reused. Provided as a utility for -# backward compatibilty in Pod::Man, etc. but not recommended for -# general use. - -sub reinit { - my $self = shift; - foreach (qw(source_dead source_filename doc_has_started -start_of_pod_block content_seen last_was_blank paras curr_open -line_count pod_para_count in_pod ~tried_gen_errata errata errors_seen -Title)) { - - delete $self->{$_}; - } -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - diff --git a/web/bin/lib/Pod/Simple/Checker.pm b/web/bin/lib/Pod/Simple/Checker.pm deleted file mode 100644 index 0d01f50..0000000 --- a/web/bin/lib/Pod/Simple/Checker.pm +++ /dev/null @@ -1,171 +0,0 @@ - -# A quite dimwitted pod2plaintext that need only know how to format whatever -# text comes out of Pod::BlackBox's _gen_errata - -require 5; -package Pod::Simple::Checker; -use strict; -use Carp (); -use Pod::Simple::Methody (); -use Pod::Simple (); -use vars qw( @ISA $VERSION ); -$VERSION = '2.02'; -@ISA = ('Pod::Simple::Methody'); -BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) - ? \&Pod::Simple::DEBUG - : sub() {0} - } - -use Text::Wrap 98.112902 (); # was 2001.0131, but I don't think we need that -$Text::Wrap::wrap = 'overflow'; -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub any_errata_seen { # read-only accessor - return $_[1]->{'Errata_seen'}; -} - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - $new->nix_X_codes(1); - $new->nbsp_for_S(1); - $new->{'Thispara'} = ''; - $new->{'Indent'} = 0; - $new->{'Indentstring'} = ' '; - $new->{'Errata_seen'} = 0; - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub handle_text { $_[0]{'Errata_seen'} and $_[0]{'Thispara'} .= $_[1] } - -sub start_Para { $_[0]{'Thispara'} = '' } - -sub start_head1 { - if($_[0]{'Errata_seen'}) { - $_[0]{'Thispara'} = ''; - } else { - if($_[1]{'errata'}) { # start of errata! - $_[0]{'Errata_seen'} = 1; - $_[0]{'Thispara'} = $_[0]{'source_filename'} ? - "$_[0]{'source_filename'} -- " : '' - } - } -} -sub start_head2 { $_[0]{'Thispara'} = '' } -sub start_head3 { $_[0]{'Thispara'} = '' } -sub start_head4 { $_[0]{'Thispara'} = '' } - -sub start_Verbatim { $_[0]{'Thispara'} = '' } -sub start_item_bullet { $_[0]{'Thispara'} = '* ' } -sub start_item_number { $_[0]{'Thispara'} = "$_[1]{'number'}. " } -sub start_item_text { $_[0]{'Thispara'} = '' } - -sub start_over_bullet { ++$_[0]{'Indent'} } -sub start_over_number { ++$_[0]{'Indent'} } -sub start_over_text { ++$_[0]{'Indent'} } -sub start_over_block { ++$_[0]{'Indent'} } - -sub end_over_bullet { --$_[0]{'Indent'} } -sub end_over_number { --$_[0]{'Indent'} } -sub end_over_text { --$_[0]{'Indent'} } -sub end_over_block { --$_[0]{'Indent'} } - - -# . . . . . Now the actual formatters: - -sub end_head1 { $_[0]->emit_par(-4) } -sub end_head2 { $_[0]->emit_par(-3) } -sub end_head3 { $_[0]->emit_par(-2) } -sub end_head4 { $_[0]->emit_par(-1) } -sub end_Para { $_[0]->emit_par( 0) } -sub end_item_bullet { $_[0]->emit_par( 0) } -sub end_item_number { $_[0]->emit_par( 0) } -sub end_item_text { $_[0]->emit_par(-2) } - -sub emit_par { - return unless $_[0]{'Errata_seen'}; - my($self, $tweak_indent) = splice(@_,0,2); - my $indent = ' ' x ( 2 * $self->{'Indent'} + ($tweak_indent||0) ); - # Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0 - - $self->{'Thispara'} =~ tr{\xAD}{}d if Pod::Simple::ASCII; - my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n"); - $out =~ tr{\xA0}{ } if Pod::Simple::ASCII; - print {$self->{'output_fh'}} $out, - #"\n" - ; - $self->{'Thispara'} = ''; - - return; -} - -# . . . . . . . . . . And then off by its lonesome: - -sub end_Verbatim { - return unless $_[0]{'Errata_seen'}; - my $self = shift; - if(Pod::Simple::ASCII) { - $self->{'Thispara'} =~ tr{\xA0}{ }; - $self->{'Thispara'} =~ tr{\xAD}{}d; - } - - my $i = ' ' x ( 2 * $self->{'Indent'} + 4); - - $self->{'Thispara'} =~ s/^/$i/mg; - - print { $self->{'output_fh'} } '', - $self->{'Thispara'}, - "\n\n" - ; - $self->{'Thispara'} = ''; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - -__END__ - -=head1 NAME - -Pod::Simple::Checker -- check the Pod syntax of a document - -=head1 SYNOPSIS - - perl -MPod::Simple::Checker -e \ - "exit Pod::Simple::Checker->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -This class is for checking the syntactic validity of Pod. -It works by basically acting like a simple-minded version of -L<Pod::Simple::Text> that formats only the "Pod Errors" section -(if Pod::Simple even generates one for the given document). - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Checker> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/Debug.pm b/web/bin/lib/Pod/Simple/Debug.pm deleted file mode 100644 index b00e58d..0000000 --- a/web/bin/lib/Pod/Simple/Debug.pm +++ /dev/null @@ -1,151 +0,0 @@ - -require 5; -package Pod::Simple::Debug; -use strict; - -sub import { - my($value,$variable); - - if(@_ == 2) { - $value = $_[1]; - } elsif(@_ == 3) { - ($variable, $value) = @_[1,2]; - - ($variable, $value) = ($value, $variable) - if defined $value and ref($value) eq 'SCALAR' - and not(defined $variable and ref($variable) eq 'SCALAR') - ; # tolerate getting it backwards - - unless( defined $variable and ref($variable) eq 'SCALAR') { - require Carp; - Carp::croak("Usage:\n use Pod::Simple::Debug (NUMVAL)\nor" - . "\n use Pod::Simple::Debug (\\\$var, STARTNUMVAL)\nAborting"); - } - } else { - require Carp; - Carp::croak("Usage:\n use Pod::Simple::Debug (NUMVAL)\nor" - . "\n use Pod::Simple::Debug (\\\$var, STARTNUMVAL)\nAborting"); - } - - if( defined &Pod::Simple::DEBUG ) { - require Carp; - Carp::croak("It's too late to call Pod::Simple::Debug -- " - . "Pod::Simple has already loaded\nAborting"); - } - - $value = 0 unless defined $value; - - unless($value =~ m/^-?\d+$/) { - require Carp; - Carp::croak( "$value isn't a numeric value." - . "\nUsage:\n use Pod::Simple::Debug (NUMVAL)\nor" - . "\n use Pod::Simple::Debug (\\\$var, STARTNUMVAL)\nAborting"); - } - - if( defined $variable ) { - # make a not-really-constant - *Pod::Simple::DEBUG = sub () { $$variable } ; - $$variable = $value; - print "# Starting Pod::Simple::DEBUG = non-constant $variable with val $value\n"; - } else { - *Pod::Simple::DEBUG = eval " sub () { $value } "; - print "# Starting Pod::Simple::DEBUG = $value\n"; - } - - require Pod::Simple; - return; -} - -1; - - -__END__ - -=head1 NAME - -Pod::Simple::Debug -- put Pod::Simple into trace/debug mode - -=head1 SYNOPSIS - - use Pod::Simple::Debug (5); # or some integer - -Or: - - my $debuglevel; - use Pod::Simple::Debug (\$debuglevel, 0); - ...some stuff that uses Pod::Simple to do stuff, but which - you don't want debug output from... - - $debug_level = 4; - ...some stuff that uses Pod::Simple to do stuff, but which - you DO want debug output from... - - $debug_level = 0; - -=head1 DESCRIPTION - -This is an internal module for controlling the debug level (a.k.a. trace -level) of Pod::Simple. This is of interest only to Pod::Simple -developers. - - -=head1 CAVEATS - -Note that you should load this module I<before> loading Pod::Simple (or -any Pod::Simple-based class). If you try loading Pod::Simple::Debug -after &Pod::Simple::DEBUG is already defined, Pod::Simple::Debug will -throw a fatal error to the effect that -"it's s too late to call Pod::Simple::Debug". - -Note that the C<use Pod::Simple::Debug (\$x, I<somenum>)> mode will make -Pod::Simple (et al) run rather slower, since &Pod::Simple::DEBUG won't -be a constant sub anymore, and so Pod::Simple (et al) won't compile with -constant-folding. - - -=head1 GUTS - -Doing this: - - use Pod::Simple::Debug (5); # or some integer - -is basically equivalent to: - - BEGIN { sub Pod::Simple::DEBUG () {5} } # or some integer - use Pod::Simple (); - -And this: - - use Pod::Simple::Debug (\$debug_level,0); # or some integer - -is basically equivalent to this: - - my $debug_level; - BEGIN { $debug_level = 0 } - BEGIN { sub Pod::Simple::DEBUG () { $debug_level } - use Pod::Simple (); - -=head1 SEE ALSO - -L<Pod::Simple> - -The article "Constants in Perl", in I<The Perl Journal> issue -21. See L<http://www.sysadminmag.com/tpj/issues/vol5_5/> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/DumpAsText.pm b/web/bin/lib/Pod/Simple/DumpAsText.pm deleted file mode 100644 index e678e42..0000000 --- a/web/bin/lib/Pod/Simple/DumpAsText.pm +++ /dev/null @@ -1,130 +0,0 @@ - -require 5; -package Pod::Simple::DumpAsText; -$VERSION = '2.02'; -use Pod::Simple (); -BEGIN {@ISA = ('Pod::Simple')} - -use strict; - -use Carp (); - -BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - $new->accept_codes('VerbatimFormatted'); - return $new; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _handle_element_start { - # ($self, $element_name, $attr_hash_r) - my $fh = $_[0]{'output_fh'}; - my($key, $value); - DEBUG and print "++ $_[1]\n"; - - print $fh ' ' x ($_[0]{'indent'} || 0), "++", $_[1], "\n"; - $_[0]{'indent'}++; - while(($key,$value) = each %{$_[2]}) { - unless($key =~ m/^~/s) { - next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; - _perly_escape($key); - _perly_escape($value); - printf $fh qq{%s \\ "%s" => "%s"\n}, - ' ' x ($_[0]{'indent'} || 0), $key, $value; - } - } - return; -} - -sub _handle_text { - DEBUG and print "== \"$_[1]\"\n"; - - if(length $_[1]) { - my $indent = ' ' x $_[0]{'indent'}; - my $text = $_[1]; - _perly_escape($text); - $text =~ # A not-totally-brilliant wrapping algorithm: - s/( - [^\n]{55} # Snare some characters from a line - [^\n\ ]{0,50} # and finish any current word - ) - \x20{1,10}(?!\n) # capture some spaces not at line-end - /$1"\n$indent . "/gx # => line-break here - ; - - print {$_[0]{'output_fh'}} $indent, '* "', $text, "\"\n"; - } - return; -} - -sub _handle_element_end { - DEBUG and print "-- $_[1]\n"; - print {$_[0]{'output_fh'}} - ' ' x --$_[0]{'indent'}, "--", $_[1], "\n"; - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub _perly_escape { - foreach my $x (@_) { - $x =~ s/([^\x00-\xFF])/sprintf'\x{%X}',ord($1)/eg; - # Escape things very cautiously: - $x =~ s/([^-\n\t \&\<\>\'!\#\%\(\)\*\+,\.\/\:\;=\?\~\[\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf'\x%02X',ord($1)/eg; - } - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - - -__END__ - -=head1 NAME - -Pod::Simple::DumpAsText -- dump Pod-parsing events as text - -=head1 SYNOPSIS - - perl -MPod::Simple::DumpAsText -e \ - "exit Pod::Simple::DumpAsText->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -This class is for dumping, as text, the events gotten from parsing a Pod -document. This class is of interest to people writing Pod formatters -based on Pod::Simple. It is useful for seeing exactly what events you -get out of some Pod that you feed in. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -=head1 SEE ALSO - -L<Pod::Simple::DumpAsXML> - -L<Pod::Simple> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/DumpAsXML.pm b/web/bin/lib/Pod/Simple/DumpAsXML.pm deleted file mode 100644 index fe0c166..0000000 --- a/web/bin/lib/Pod/Simple/DumpAsXML.pm +++ /dev/null @@ -1,146 +0,0 @@ - -require 5; -package Pod::Simple::DumpAsXML; -$VERSION = '2.02'; -use Pod::Simple (); -BEGIN {@ISA = ('Pod::Simple')} - -use strict; - -use Carp (); - -BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - $new->accept_codes('VerbatimFormatted'); - return $new; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _handle_element_start { - # ($self, $element_name, $attr_hash_r) - my $fh = $_[0]{'output_fh'}; - my($key, $value); - DEBUG and print "++ $_[1]\n"; - - print $fh ' ' x ($_[0]{'indent'} || 0), "<", $_[1]; - - foreach my $key (sort keys %{$_[2]}) { - unless($key =~ m/^~/s) { - next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; - _xml_escape($value = $_[2]{$key}); - print $fh ' ', $key, '="', $value, '"'; - } - } - - - print $fh ">\n"; - $_[0]{'indent'}++; - return; -} - -sub _handle_text { - DEBUG and print "== \"$_[1]\"\n"; - if(length $_[1]) { - my $indent = ' ' x $_[0]{'indent'}; - my $text = $_[1]; - _xml_escape($text); - $text =~ # A not-totally-brilliant wrapping algorithm: - s/( - [^\n]{55} # Snare some characters from a line - [^\n\ ]{0,50} # and finish any current word - ) - \x20{1,10}(?!\n) # capture some spaces not at line-end - /$1\n$indent/gx # => line-break here - ; - - print {$_[0]{'output_fh'}} $indent, $text, "\n"; - } - return; -} - -sub _handle_element_end { - DEBUG and print "-- $_[1]\n"; - print {$_[0]{'output_fh'}} - ' ' x --$_[0]{'indent'}, "</", $_[1], ">\n"; - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub _xml_escape { - foreach my $x (@_) { - # Escape things very cautiously: - $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg; - # Yes, stipulate the list without a range, so that this can work right on - # all charsets that this module happens to run under. - # Altho, hmm, what about that ord? Presumably that won't work right - # under non-ASCII charsets. Something should be done about that. - } - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - -__END__ - -=head1 NAME - -Pod::Simple::DumpAsXML -- turn Pod into XML - -=head1 SYNOPSIS - - perl -MPod::Simple::DumpAsXML -e \ - "exit Pod::Simple::DumpAsXML->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -Pod::Simple::DumpAsXML is a subclass of L<Pod::Simple> that parses Pod -and turns it into indented and wrapped XML. This class is of -interest to people writing Pod formatters based on Pod::Simple. - -Pod::Simple::DumpAsXML inherits methods from -L<Pod::Simple>. - - -=head1 SEE ALSO - -L<Pod::Simple::XMLOutStream> is rather like this class. -Pod::Simple::XMLOutStream's output is space-padded in a way -that's better for sending to an XML processor (that is, it has -no ignoreable whitespace). But -Pod::Simple::DumpAsXML's output is much more human-readable, being -(more-or-less) one token per line, with line-wrapping. - -L<Pod::Simple::DumpAsText> is rather like this class, -except that it doesn't dump with XML syntax. Try them and see -which one you like best! - -L<Pod::Simple>, L<Pod::Simple::DumpAsXML> - -The older libraries L<Pod::PXML>, L<Pod::XML>, L<Pod::SAX> - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/HTML.pm b/web/bin/lib/Pod/Simple/HTML.pm deleted file mode 100644 index 11a569f..0000000 --- a/web/bin/lib/Pod/Simple/HTML.pm +++ /dev/null @@ -1,893 +0,0 @@ - -require 5; -package Pod::Simple::HTML; -use strict; -use Pod::Simple::PullParser (); -use vars qw( - @ISA %Tagmap $Computerese $LamePad $Linearization_Limit $VERSION - $Perldoc_URL_Prefix $Perldoc_URL_Postfix - $Title_Prefix $Title_Postfix $HTML_EXTENSION %ToIndex - $Doctype_decl $Content_decl -); -@ISA = ('Pod::Simple::PullParser'); -$VERSION = '3.03'; - -use UNIVERSAL (); -BEGIN { - if(defined &DEBUG) { } # no-op - elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } - else { *DEBUG = sub () {0}; } -} - -$Doctype_decl ||= ''; # No. Just No. Don't even ask me for it. - # qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - # "http://www.w3.org/TR/html4/loose.dtd">\n}; - -$Content_decl ||= - q{<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >}; - -$HTML_EXTENSION = '.html' unless defined $HTML_EXTENSION; -$Computerese = "" unless defined $Computerese; -$LamePad = '' unless defined $LamePad; - -$Linearization_Limit = 120 unless defined $Linearization_Limit; - # headings/items longer than that won't get an <a id="..."> -$Perldoc_URL_Prefix = 'http://search.cpan.org/perldoc?' - unless defined $Perldoc_URL_Prefix; -$Perldoc_URL_Postfix = '' - unless defined $Perldoc_URL_Postfix; - -$Title_Prefix = '' unless defined $Title_Prefix; -$Title_Postfix = '' unless defined $Title_Postfix; -%ToIndex = map {; $_ => 1 } qw(head1 head2 head3 head4 ); # item-text - # 'item-text' stuff in the index doesn't quite work, and may - # not be a good idea anyhow. - - -__PACKAGE__->_accessorize( - 'perldoc_url_prefix', - # In turning L<Foo::Bar> into http://whatever/Foo%3a%3aBar, what - # to put before the "Foo%3a%3aBar". - # (for singleton mode only?) - 'perldoc_url_postfix', - # what to put after "Foo%3a%3aBar" in the URL. Normally "". - - 'batch_mode', # whether we're in batch mode - 'batch_mode_current_level', - # When in batch mode, how deep the current module is: 1 for "LWP", - # 2 for "LWP::Procotol", 3 for "LWP::Protocol::GHTTP", etc - - 'title_prefix', 'title_postfix', - # What to put before and after the title in the head. - # Should already be &-escaped - - 'html_header_before_title', - 'html_header_after_title', - 'html_footer', - - 'index', # whether to add an index at the top of each page - # (actually it's a table-of-contents, but we'll call it an index, - # out of apparently longstanding habit) - - 'html_css', # URL of CSS file to point to - 'html_javascript', # URL of CSS file to point to - - 'force_title', # should already be &-escaped - 'default_title', # should already be &-escaped -); - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -my @_to_accept; - -%Tagmap = ( - 'Verbatim' => "\n<pre$Computerese>", - '/Verbatim' => "</pre>\n", - 'VerbatimFormatted' => "\n<pre$Computerese>", - '/VerbatimFormatted' => "</pre>\n", - 'VerbatimB' => "<b>", - '/VerbatimB' => "</b>", - 'VerbatimI' => "<i>", - '/VerbatimI' => "</i>", - 'VerbatimBI' => "<b><i>", - '/VerbatimBI' => "</i></b>", - - - 'Data' => "\n", - '/Data' => "\n", - - 'head1' => "\n<h1>", # And also stick in an <a id="..."> - 'head2' => "\n<h2>", # '' - 'head3' => "\n<h3>", # '' - 'head4' => "\n<h4>", # '' - '/head1' => "</a></h1>\n", - '/head2' => "</a></h2>\n", - '/head3' => "</a></h3>\n", - '/head4' => "</a></h4>\n", - - 'X' => "<!--\n\tINDEX: ", - '/X' => "\n-->", - - changes(qw( - Para=p - B=b I=i - over-bullet=ul - over-number=ol - over-text=dl - over-block=blockquote - item-bullet=li - item-number=li - item-text=dt - )), - changes2( - map {; m/^([-a-z]+)/s && push @_to_accept, $1; $_ } - qw[ - sample=samp - definition=dfn - kbd=keyboard - variable=var - citation=cite - abbreviation=abbr - acronym=acronym - subscript=sub - superscript=sup - big=big - small=small - underline=u - strikethrough=s - ] # no point in providing a way to get <q>...</q>, I think - ), - - '/item-bullet' => "</li>$LamePad\n", - '/item-number' => "</li>$LamePad\n", - '/item-text' => "</a></dt>$LamePad\n", - 'item-body' => "\n<dd>", - '/item-body' => "</dd>\n", - - - 'B' => "<b>", '/B' => "</b>", - 'I' => "<i>", '/I' => "</i>", - 'F' => "<em$Computerese>", '/F' => "</em>", - 'C' => "<code$Computerese>", '/C' => "</code>", - 'L' => "<a href='YOU_SHOULD_NEVER_SEE_THIS'>", # ideally never used! - '/L' => "</a>", -); - -sub changes { - return map {; m/^([-_:0-9a-zA-Z]+)=([-_:0-9a-zA-Z]+)$/s - ? ( $1, => "\n<$2>", "/$1", => "</$2>\n" ) : die "Funky $_" - } @_; -} -sub changes2 { - return map {; m/^([-_:0-9a-zA-Z]+)=([-_:0-9a-zA-Z]+)$/s - ? ( $1, => "<$2>", "/$1", => "</$2>" ) : die "Funky $_" - } @_; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sub go { exit Pod::Simple::HTML->parse_from_file(@ARGV) } - # Just so we can run from the command line. No options. - # For that, use perldoc! -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub new { - my $new = shift->SUPER::new(@_); - #$new->nix_X_codes(1); - $new->nbsp_for_S(1); - $new->accept_targets( 'html', 'HTML' ); - $new->accept_codes('VerbatimFormatted'); - $new->accept_codes(@_to_accept); - DEBUG > 2 and print "To accept: ", join(' ',@_to_accept), "\n"; - - $new->perldoc_url_prefix( $Perldoc_URL_Prefix ); - $new->perldoc_url_postfix( $Perldoc_URL_Postfix ); - $new->title_prefix( $Title_Prefix ); - $new->title_postfix( $Title_Postfix ); - - $new->html_header_before_title( - qq[$Doctype_decl<html><head><title>] - ); - $new->html_header_after_title( join "\n" => - "</title>", - $Content_decl, - "</head>\n<body class='pod'>", - $new->version_tag_comment, - "<!-- start doc -->\n", - ); - $new->html_footer( qq[\n<!-- end doc -->\n\n</body></html>\n] ); - - $new->{'Tagmap'} = {%Tagmap}; - return $new; -} - -sub batch_mode_page_object_init { - my($self, $batchconvobj, $module, $infile, $outfile, $depth) = @_; - DEBUG and print "Initting $self\n for $module\n", - " in $infile\n out $outfile\n depth $depth\n"; - $self->batch_mode(1); - $self->batch_mode_current_level($depth); - return $self; -} - -sub run { - my $self = $_[0]; - return $self->do_middle if $self->bare_output; - return - $self->do_beginning && $self->do_middle && $self->do_end; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub do_beginning { - my $self = $_[0]; - - my $title; - - if(defined $self->force_title) { - $title = $self->force_title; - DEBUG and print "Forcing title to be $title\n"; - } else { - # Actually try looking for the title in the document: - $title = $self->get_short_title(); - unless($self->content_seen) { - DEBUG and print "No content seen in search for title.\n"; - return; - } - $self->{'Title'} = $title; - - if(defined $title and $title =~ m/\S/) { - $title = $self->title_prefix . esc($title) . $self->title_postfix; - } else { - $title = $self->default_title; - $title = '' unless defined $title; - DEBUG and print "Title defaults to $title\n"; - } - } - - - my $after = $self->html_header_after_title || ''; - if($self->html_css) { - my $link = - $self->html_css =~ m/</ - ? $self->html_css # It's a big blob of markup, let's drop it in - : sprintf( # It's just a URL, so let's wrap it up - qq[<link rel="stylesheet" type="text/css" title="pod_stylesheet" href="%s">\n], - $self->html_css, - ); - $after =~ s{(</head>)}{$link\n$1}i; # otherwise nevermind - } - $self->_add_top_anchor(\$after); - - if($self->html_javascript) { - my $link = - $self->html_javascript =~ m/</ - ? $self->html_javascript # It's a big blob of markup, let's drop it in - : sprintf( # It's just a URL, so let's wrap it up - qq[<script type="text/javascript" src="%s"></script>\n], - $self->html_javascript, - ); - $after =~ s{(</head>)}{$link\n$1}i; # otherwise nevermind - } - - print {$self->{'output_fh'}} - $self->html_header_before_title || '', - $title, # already escaped - $after, - ; - - DEBUG and print "Returning from do_beginning...\n"; - return 1; -} - -sub _add_top_anchor { - my($self, $text_r) = @_; - unless($$text_r and $$text_r =~ m/id=['"]___top['"]/) { # a hack - $$text_r .= "<a id='___top' class='dummyTopAnchor' ></a>\n"; - } - return; -} - -sub version_tag_comment { - my $self = shift; - return sprintf - "<!--\n generated by %s v%s,\n using %s v%s,\n under Perl v%s at %s GMT.\n\n %s\n\n-->\n", - esc( - ref($self), $self->VERSION(), $ISA[0], $ISA[0]->VERSION(), - $], scalar(gmtime), - ), $self->_modnote(), - ; -} - -sub _modnote { - my $class = ref($_[0]) || $_[0]; - return join "\n " => grep m/\S/, split "\n", - -qq{ -If you want to change this HTML document, you probably shouldn't do that -by changing it directly. Instead, see about changing the calling options -to $class, and/or subclassing $class, -then reconverting this document from the Pod source. -When in doubt, email the author of $class for advice. -See 'perldoc $class' for more info. -}; - -} - -sub do_end { - my $self = $_[0]; - print {$self->{'output_fh'}} $self->html_footer || ''; - return 1; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Normally this would just be a call to _do_middle_main_loop -- but we -# have to do some elaborate things to emit all the content and then -# summarize it and output it /before/ the content that it's a summary of. - -sub do_middle { - my $self = $_[0]; - return $self->_do_middle_main_loop unless $self->index; - - if( $self->output_string ) { - # An efficiency hack - my $out = $self->output_string; #it's a reference to it - my $sneakytag = "\f\f\e\e\b\bIndex Here\e\e\b\b\f\f\n"; - $$out .= $sneakytag; - $self->_do_middle_main_loop; - $sneakytag = quotemeta($sneakytag); - my $index = $self->index_as_html(); - if( $$out =~ s/$sneakytag/$index/s ) { - # Expected case - DEBUG and print "Inserted ", length($index), " bytes of index HTML into $out.\n"; - } else { - DEBUG and print "Odd, couldn't find where to insert the index in the output!\n"; - # I don't think this should ever happen. - } - return 1; - } - - unless( $self->output_fh ) { - require Carp; - Carp::confess("Parser object \$p doesn't seem to have any output object! I don't know how to deal with that."); - } - - # If we get here, we're outputting to a FH. So we need to do some magic. - # Namely, divert all content to a string, which we output after the index. - my $fh = $self->output_fh; - my $content = ''; - { - # Our horrible bait and switch: - $self->output_string( \$content ); - $self->_do_middle_main_loop; - $self->abandon_output_string(); - $self->output_fh($fh); - } - print $fh $self->index_as_html(); - print $fh $content; - - return 1; -} - -########################################################################### - -sub index_as_html { - my $self = $_[0]; - # This is meant to be called AFTER the input document has been parsed! - - my $points = $self->{'PSHTML_index_points'} || []; - - @$points > 1 or return qq[<div class='indexgroupEmpty'></div>\n]; - # There's no point in having a 0-item or 1-item index, I dare say. - - my(@out) = qq{\n<div class='indexgroup'>}; - my $level = 0; - - my( $target_level, $previous_tagname, $tagname, $text, $anchorname, $indent); - foreach my $p (@$points, ['head0', '(end)']) { - ($tagname, $text) = @$p; - $anchorname = $self->section_escape($text); - if( $tagname =~ m{^head(\d+)$} ) { - $target_level = 0 + $1; - } else { # must be some kinda list item - if($previous_tagname =~ m{^head\d+$} ) { - $target_level = $level + 1; - } else { - $target_level = $level; # no change needed - } - } - - # Get to target_level by opening or closing ULs - while($level > $target_level) - { --$level; push @out, (" " x $level) . "</ul>"; } - while($level < $target_level) - { ++$level; push @out, (" " x ($level-1)) - . "<ul class='indexList indexList$level'>"; } - - $previous_tagname = $tagname; - next unless $level; - - $indent = ' ' x $level; - push @out, sprintf - "%s<li class='indexItem indexItem%s'><a href='#%s'>%s</a>", - $indent, $level, $anchorname, esc($text) - ; - } - push @out, "</div>\n"; - return join "\n", @out; -} - -########################################################################### - -sub _do_middle_main_loop { - my $self = $_[0]; - my $fh = $self->{'output_fh'}; - my $tagmap = $self->{'Tagmap'}; - - my($token, $type, $tagname, $linkto, $linktype); - my @stack; - my $dont_wrap = 0; - my %id_dup; - while($token = $self->get_token) { - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if( ($type = $token->type) eq 'start' ) { - if(($tagname = $token->tagname) eq 'L') { - $linktype = $token->attr('type') || 'insane'; - - $linkto = $self->do_link($token); - - if(defined $linkto and length $linkto) { - esc($linkto); - # (Yes, SGML-escaping applies on top of %-escaping! - # But it's rarely noticeable in practice.) - print $fh qq{<a href="$linkto" class="podlink$linktype"\n>}; - } else { - print $fh "<a>"; # Yes, an 'a' element with no attributes! - } - - } elsif ($tagname eq 'item-text' or $tagname =~ m/^head\d$/s) { - print $fh $tagmap->{$tagname} || next; - - my @to_unget; - while(1) { - push @to_unget, $self->get_token; - last if $to_unget[-1]->is_end - and $to_unget[-1]->tagname eq $tagname; - - # TODO: support for X<...>'s found in here? (maybe hack into linearize_tokens) - } - - my $name = $self->linearize_tokens(@to_unget); - - print $fh "<a "; - print $fh "class='u' href='#___top' title='click to go to top of document'\n" - if $tagname =~ m/^head\d$/s; - - if(defined $name) { - my $esc = esc( $self->section_name_tidy( $name ) ); - if (not $id_dup{$esc}){ - print $fh qq[id="I$esc"]; - $id_dup{$esc}=1; - } - DEBUG and print "Linearized ", scalar(@to_unget), - " tokens as \"$name\".\n"; - - push @{ $self->{'PSHTML_index_points'} }, [$tagname, $name] - if $ToIndex{ $tagname }; - # Obviously, this discards all formatting codes (saving - # just their content), but ahwell. - - } else { # ludicrously long, so nevermind - DEBUG and print "Linearized ", scalar(@to_unget), - " tokens, but it was too long, so nevermind.\n"; - } - print $fh "\n>"; - $self->unget_token(@to_unget); - - } elsif ($tagname eq 'Data') { - my $next = $self->get_token; - next unless defined $next; - unless( $next->type eq 'text' ) { - $self->unget_token($next); - next; - } - DEBUG and print " raw text ", $next->text, "\n"; - printf $fh "\n" . $next->text . "\n"; - next; - - } else { - if( $tagname =~ m/^over-/s ) { - push @stack, ''; - } elsif( $tagname =~ m/^item-/s and @stack and $stack[-1] ) { - print $fh $stack[-1]; - $stack[-1] = ''; - } - print $fh $tagmap->{$tagname} || next; - ++$dont_wrap if $tagname eq 'Verbatim' or $tagname eq "VerbatimFormatted" - or $tagname eq 'X'; - } - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } elsif( $type eq 'end' ) { - if( ($tagname = $token->tagname) =~ m/^over-/s ) { - if( my $end = pop @stack ) { - print $fh $end; - } - } elsif( $tagname =~ m/^item-/s and @stack) { - $stack[-1] = $tagmap->{"/$tagname"}; - if( $tagname eq 'item-text' and defined(my $next = $self->get_token) ) { - $self->unget_token($next); - if( $next->type eq 'start' and $next->tagname !~ m/^item-/s ) { - print $fh $tagmap->{"/item-text"},$tagmap->{"item-body"}; - $stack[-1] = $tagmap->{"/item-body"}; - } - } - next; - } - print $fh $tagmap->{"/$tagname"} || next; - --$dont_wrap if $tagname eq 'Verbatim' or $tagname eq 'X'; - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } elsif( $type eq 'text' ) { - esc($type = $token->text); # reuse $type, why not - $type =~ s/([\?\!\"\'\.\,]) /$1\n/g unless $dont_wrap; - print $fh $type; - } - - } - return 1; -} - -########################################################################### -# - -sub do_link { - my($self, $token) = @_; - my $type = $token->attr('type'); - if(!defined $type) { - $self->whine("Typeless L!?", $token->attr('start_line')); - } elsif( $type eq 'pod') { return $self->do_pod_link($token); - } elsif( $type eq 'url') { return $self->do_url_link($token); - } elsif( $type eq 'man') { return $self->do_man_link($token); - } else { - $self->whine("L of unknown type $type!?", $token->attr('start_line')); - } - return 'FNORG'; # should never get called -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub do_url_link { return $_[1]->attr('to') } - -sub do_man_link { return undef } - # But subclasses are welcome to override this if they have man - # pages somewhere URL-accessible. - - -sub do_pod_link { - # And now things get really messy... - my($self, $link) = @_; - my $to = $link->attr('to'); - my $section = $link->attr('section'); - return undef unless( # should never happen - (defined $to and length $to) or - (defined $section and length $section) - ); - - $section = $self->section_escape($section) - if defined $section and length($section .= ''); # (stringify) - - DEBUG and printf "Resolving \"%s\" \"%s\"...\n", - $to || "(nil)", $section || "(nil)"; - - { - # An early hack: - my $complete_url = $self->resolve_pod_link_by_table($to, $section); - if( $complete_url ) { - DEBUG > 1 and print "resolve_pod_link_by_table(T,S) gives ", - $complete_url, "\n (Returning that.)\n"; - return $complete_url; - } else { - DEBUG > 4 and print " resolve_pod_link_by_table(T,S)", - " didn't return anything interesting.\n"; - } - } - - if(defined $to and length $to) { - # Give this routine first hack again - my $there = $self->resolve_pod_link_by_table($to); - if(defined $there and length $there) { - DEBUG > 1 - and print "resolve_pod_link_by_table(T) gives $there\n"; - } else { - $there = - $self->resolve_pod_page_link($to, $section); - # (I pass it the section value, but I don't see a - # particular reason it'd use it.) - DEBUG > 1 and print "resolve_pod_page_link gives ", $to || "(nil)", "\n"; - unless( defined $there and length $there ) { - DEBUG and print "Can't resolve $to\n"; - return undef; - } - # resolve_pod_page_link returning undef is how it - # can signal that it gives up on making a link - } - $to = $there; - } - - #DEBUG and print "So far [", $to||'nil', "] [", $section||'nil', "]\n"; - - my $out = (defined $to and length $to) ? $to : ''; - $out .= "#" . $section if defined $section and length $section; - - unless(length $out) { # sanity check - DEBUG and printf "Oddly, couldn't resolve \"%s\" \"%s\"...\n", - $to || "(nil)", $section || "(nil)"; - return undef; - } - - DEBUG and print "Resolved to $out\n"; - return $out; -} - - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - -sub section_escape { - my($self, $section) = @_; - return $self->section_url_escape( - $self->section_name_tidy($section) - ); -} - -sub section_name_tidy { - my($self, $section) = @_; - $section =~ tr/ /_/; - $section =~ s/[^0-9a-z]/_/ig; # drop crazy characters -# $section = $self->unicode_escape_url($section); - $section = '_' unless length $section; - return $section; -} - -sub section_url_escape { shift->general_url_escape(@_) } -sub pagepath_url_escape { shift->general_url_escape(@_) } - -sub general_url_escape { - my($self, $string) = @_; - - $string =~ s/([^\x00-\xFF])/join '', map sprintf('%%%02X',$_), unpack 'C*', $1/eg; - # express Unicode things as urlencode(utf(orig)). - - # A pretty conservative escaping, behoovey even for query components - # of a URL (see RFC 2396) - - $string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',ord($1))/eg; - # Yes, stipulate the list without a range, so that this can work right on - # all charsets that this module happens to run under. - # Altho, hmm, what about that ord? Presumably that won't work right - # under non-ASCII charsets. Something should be done - # about that, I guess? - - return $string; -} - -#-------------------------------------------------------------------------- -# -# Oh look, a yawning portal to Hell! Let's play touch football right by it! -# - -sub resolve_pod_page_link { - # resolve_pod_page_link must return a properly escaped URL - my $self = shift; - return $self->batch_mode() - ? $self->resolve_pod_page_link_batch_mode(@_) - : $self->resolve_pod_page_link_singleton_mode(@_) - ; -} - -sub resolve_pod_page_link_singleton_mode { - my($self, $it) = @_; - return undef unless defined $it and length $it; - my $url = $self->pagepath_url_escape($it); - - $url =~ s{::$}{}s; # probably never comes up anyway - $url =~ s{::}{/}g unless $self->perldoc_url_prefix =~ m/\?/s; # sane DWIM? - - return undef unless length $url; - return $self->perldoc_url_prefix . $url . $self->perldoc_url_postfix; -} - -sub resolve_pod_page_link_batch_mode { - my($self, $to) = @_; - DEBUG > 1 and print " During batch mode, resolving $to ...\n"; - my @path = grep length($_), split m/::/s, $to, -1; - unless( @path ) { # sanity - DEBUG and print "Very odd! Splitting $to gives (nil)!\n"; - return undef; - } - $self->batch_mode_rectify_path(\@path); - my $out = join('/', map $self->pagepath_url_escape($_), @path) - . $HTML_EXTENSION; - DEBUG > 1 and print " => $out\n"; - return $out; -} - -sub batch_mode_rectify_path { - my($self, $pathbits) = @_; - my $level = $self->batch_mode_current_level; - $level--; # how many levels up to go to get to the root - if($level < 1) { - unshift @$pathbits, '.'; # just to be pretty - } else { - unshift @$pathbits, ('..') x $level; - } - return; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub resolve_pod_link_by_table { - # A crazy hack to allow specifying custom L<foo> => URL mappings - - return unless $_[0]->{'podhtml_LOT'}; # An optimizy shortcut - - my($self, $to, $section) = @_; - - # TODO: add a method that actually populates podhtml_LOT from a file? - - if(defined $section) { - $to = '' unless defined $to and length $to; - return $self->{'podhtml_LOT'}{"$to#$section"}; # quite possibly undef! - } else { - return $self->{'podhtml_LOT'}{$to}; # quite possibly undef! - } - return; -} - -########################################################################### - -sub linearize_tokens { # self, tokens - my $self = shift; - my $out = ''; - - my $t; - while($t = shift @_) { - if(!ref $t or !UNIVERSAL::can($t, 'is_text')) { - $out .= $t; # a string, or some insane thing - } elsif($t->is_text) { - $out .= $t->text; - } elsif($t->is_start and $t->tag eq 'X') { - # Ignore until the end of this X<...> sequence: - my $x_open = 1; - while($x_open) { - next if( ($t = shift @_)->is_text ); - if( $t->is_start and $t->tag eq 'X') { ++$x_open } - elsif($t->is_end and $t->tag eq 'X') { --$x_open } - } - } - } - return undef if length $out > $Linearization_Limit; - return $out; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub unicode_escape_url { - my($self, $string) = @_; - $string =~ s/([^\x00-\xFF])/'('.ord($1).')'/eg; - # Turn char 1234 into "(1234)" - return $string; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sub esc { # a function. - if(defined wantarray) { - if(wantarray) { - @_ = splice @_; # break aliasing - } else { - my $x = shift; - $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg; - return $x; - } - } - foreach my $x (@_) { - # Escape things very cautiously: - $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg - if defined $x; - # Leave out "- so that "--" won't make it thru in X-generated comments - # with text in them. - - # Yes, stipulate the list without a range, so that this can work right on - # all charsets that this module happens to run under. - # Altho, hmm, what about that ord? Presumably that won't work right - # under non-ASCII charsets. Something should be done about that. - } - return @_; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -1; -__END__ - -=head1 NAME - -Pod::Simple::HTML - convert Pod to HTML - -=head1 SYNOPSIS - - perl -MPod::Simple::HTML -e Pod::Simple::HTML::go thingy.pod - - -=head1 DESCRIPTION - -This class is for making an HTML rendering of a Pod document. - -This is a subclass of L<Pod::Simple::PullParser> and inherits all its -methods (and options). - -Note that if you want to do a batch conversion of a lot of Pod -documents to HTML, you should see the module L<Pod::Simple::HTMLBatch>. - - - -=head1 CALLING FROM THE COMMAND LINE - -TODO - - perl -MPod::Simple::HTML -e Pod::Simple::HTML::go Thing.pod Thing.html - - - -=head1 CALLING FROM PERL - -TODO make a new object, set any options, and use parse_from_file - - -=head1 METHODS - -TODO -all (most?) accessorized methods - - -=head1 SUBCLASSING - -TODO - - can just set any of: html_css html_javascript title_prefix - 'html_header_before_title', - 'html_header_after_title', - 'html_footer', - -maybe override do_pod_link - -maybe override do_beginning do_end - - - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::HTMLBatch> - - -TODO: a corpus of sample Pod input and HTML output? Or common -idioms? - - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002-2004 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/HTMLBatch.pm b/web/bin/lib/Pod/Simple/HTMLBatch.pm deleted file mode 100644 index bce0a44..0000000 --- a/web/bin/lib/Pod/Simple/HTMLBatch.pm +++ /dev/null @@ -1,1342 +0,0 @@ - -require 5; -package Pod::Simple::HTMLBatch; -use strict; -use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION - $CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA -); -$VERSION = '3.02'; -@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML! - -# TODO: nocontents stylesheets. Strike some of the color variations? - -use Pod::Simple::HTML (); -BEGIN {*esc = \&Pod::Simple::HTML::esc } -use File::Spec (); -use UNIVERSAL (); - # "Isn't the Universe an amazing place? I wouldn't live anywhere else!" - -use Pod::Simple::Search; -$SEARCH_CLASS ||= 'Pod::Simple::Search'; - -BEGIN { - if(defined &DEBUG) { } # no-op - elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG } - else { *DEBUG = sub () {0}; } -} - -$SLEEPY = 1 if !defined $SLEEPY and $^O =~ /mswin|mac/i; -# flag to occasionally sleep for $SLEEPY - 1 seconds. - -$HTML_RENDER_CLASS ||= "Pod::Simple::HTML"; - -# -# Methods beginning with "_" are particularly internal and possibly ugly. -# - -Pod::Simple::_accessorize( __PACKAGE__, - 'verbose', # how verbose to be during batch conversion - 'html_render_class', # what class to use to render - 'contents_file', # If set, should be the name of a file (in current directory) - # to write the list of all modules to - 'index', # will set $htmlpage->index(...) to this (true or false) - 'progress', # progress object - 'contents_page_start', 'contents_page_end', - - 'css_flurry', '_css_wad', 'javascript_flurry', '_javascript_wad', - 'no_contents_links', # set to true to suppress automatic adding of << links. - '_contents', -); - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Just so we can run from the command line more easily -sub go { - @ARGV == 2 or die sprintf( - "Usage: perl -M%s -e %s:go indirs outdir\n (or use \"\@INC\" for indirs)\n", - __PACKAGE__, __PACKAGE__, - ); - - if(defined($ARGV[1]) and length($ARGV[1])) { - my $d = $ARGV[1]; - -e $d or die "I see no output directory named \"$d\"\nAborting"; - -d $d or die "But \"$d\" isn't a directory!\nAborting"; - -w $d or die "Directory \"$d\" isn't writeable!\nAborting"; - } - - __PACKAGE__->batch_convert(@ARGV); -} -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub new { - my $new = bless {}, ref($_[0]) || $_[0]; - $new->html_render_class($HTML_RENDER_CLASS); - $new->verbose(1 + DEBUG); - $new->_contents([]); - - $new->index(1); - - $new-> _css_wad([]); $new->css_flurry(1); - $new->_javascript_wad([]); $new->javascript_flurry(1); - - $new->contents_file( - 'index' . ($HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION) - ); - - $new->contents_page_start( join "\n", grep $_, - $Pod::Simple::HTML::Doctype_decl, - "<html><head>", - "<title>Perl Documentation</title>", - $Pod::Simple::HTML::Content_decl, - "</head>", - "\n<body class='contentspage'>\n<h1>Perl Documentation</h1>\n" - ); # override if you need a different title - - - $new->contents_page_end( sprintf( - "\n\n<p class='contentsfooty'>Generated by %s v%s under Perl v%s\n<br >At %s GMT, which is %s local time.</p>\n\n</body></html>\n", - esc( - ref($new), - eval {$new->VERSION} || $VERSION, - $], scalar(gmtime), scalar(localtime), - ))); - - return $new; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub muse { - my $self = shift; - if($self->verbose) { - print 'T+', int(time() - $self->{'_batch_start_time'}), "s: ", @_, "\n"; - } - return 1; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub batch_convert { - my($self, $dirs, $outdir) = @_; - $self ||= __PACKAGE__; # tolerate being called as an optionless function - $self = $self->new unless ref $self; # tolerate being used as a class method - - if(!defined($dirs) or $dirs eq '' or $dirs eq '@INC' ) { - $dirs = ''; - } elsif(ref $dirs) { - # OK, it's an explicit set of dirs to scan, specified as an arrayref. - } else { - # OK, it's an explicit set of dirs to scan, specified as a - # string like "/thing:/also:/whatever/perl" (":"-delim, as usual) - # or, under MSWin, like "c:/thing;d:/also;c:/whatever/perl" (";"-delim!) - require Config; - my $ps = quotemeta( $Config::Config{'path_sep'} || ":" ); - $dirs = [ grep length($_), split qr/$ps/, $dirs ]; - } - - $outdir = $self->filespecsys->curdir - unless defined $outdir and length $outdir; - - $self->_batch_convert_main($dirs, $outdir); -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _batch_convert_main { - my($self, $dirs, $outdir) = @_; - # $dirs is either false, or an arrayref. - # $outdir is a pathspec. - - $self->{'_batch_start_time'} ||= time(); - - $self->muse( "= ", scalar(localtime) ); - $self->muse( "Starting batch conversion to \"$outdir\"" ); - - my $progress = $self->progress; - if(!$progress and $self->verbose > 0 and $self->verbose() <= 5) { - require Pod::Simple::Progress; - $progress = Pod::Simple::Progress->new( - ($self->verbose < 2) ? () # Default omission-delay - : ($self->verbose == 2) ? 1 # Reduce the omission-delay - : 0 # Eliminate the omission-delay - ); - $self->progress($progress); - } - - if($dirs) { - $self->muse(scalar(@$dirs), " dirs to scan: @$dirs"); - } else { - $self->muse("Scanning \@INC. This could take a minute or two."); - } - my $mod2path = $self->find_all_pods($dirs ? $dirs : ()); - $self->muse("Done scanning."); - - my $total = keys %$mod2path; - unless($total) { - $self->muse("No pod found. Aborting batch conversion.\n"); - return $self; - } - - $progress and $progress->goal($total); - $self->muse("Now converting pod files to HTML.", - ($total > 25) ? " This will take a while more." : () - ); - - $self->_spray_css( $outdir ); - $self->_spray_javascript( $outdir ); - - $self->_do_all_batch_conversions($mod2path, $outdir); - - $progress and $progress->done(sprintf ( - "Done converting %d files.", $self->{"__batch_conv_page_count"} - )); - return $self->_batch_convert_finish($outdir); - return $self; -} - - -sub _do_all_batch_conversions { - my($self, $mod2path, $outdir) = @_; - $self->{"__batch_conv_page_count"} = 0; - - foreach my $module (sort {lc($a) cmp lc($b)} keys %$mod2path) { - $self->_do_one_batch_conversion($module, $mod2path, $outdir); - sleep($SLEEPY - 1) if $SLEEPY; - } - - return; -} - -sub _batch_convert_finish { - my($self, $outdir) = @_; - $self->write_contents_file($outdir); - $self->muse("Done with batch conversion. $$self{'__batch_conv_page_count'} files done."); - $self->muse( "= ", scalar(localtime) ); - $self->progress and $self->progress->done("All done!"); - return; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _do_one_batch_conversion { - my($self, $module, $mod2path, $outdir, $outfile) = @_; - - my $retval; - my $total = scalar keys %$mod2path; - my $infile = $mod2path->{$module}; - my @namelets = grep m/\S/, split "::", $module; - # this can stick around in the contents LoL - my $depth = scalar @namelets; - die "Contentless thingie?! $module $infile" unless @namelets; #sanity - - $outfile ||= do { - my @n = @namelets; - $n[-1] .= $HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION; - $self->filespecsys->catfile( $outdir, @n ); - }; - - my $progress = $self->progress; - - my $page = $self->html_render_class->new; - if(DEBUG > 5) { - $self->muse($self->{"__batch_conv_page_count"} + 1, "/$total: ", - ref($page), " render ($depth) $module => $outfile"); - } elsif(DEBUG > 2) { - $self->muse($self->{"__batch_conv_page_count"} + 1, "/$total: $module => $outfile") - } - - # Give each class a chance to init the converter: - - $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth) - if $page->can('batch_mode_page_object_init'); - $self->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth) - if $self->can('batch_mode_page_object_init'); - - # Now get busy... - $self->makepath($outdir => \@namelets); - - $progress and $progress->reach($self->{"__batch_conv_page_count"}, "Rendering $module"); - - if( $retval = $page->parse_from_file($infile, $outfile) ) { - ++ $self->{"__batch_conv_page_count"} ; - $self->note_for_contents_file( \@namelets, $infile, $outfile ); - } else { - $self->muse("Odd, parse_from_file(\"$infile\", \"$outfile\") returned false."); - } - - $page->batch_mode_page_object_kill($self, $module, $infile, $outfile, $depth) - if $page->can('batch_mode_page_object_kill'); - # The following isn't a typo. Note that it switches $self and $page. - $self->batch_mode_page_object_kill($page, $module, $infile, $outfile, $depth) - if $self->can('batch_mode_page_object_kill'); - - DEBUG > 4 and printf "%s %sb < $infile %s %sb\n", - $outfile, -s $outfile, $infile, -s $infile - ; - - undef($page); - return $retval; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub filespecsys { $_[0]{'_filespecsys'} || 'File::Spec' } - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub note_for_contents_file { - my($self, $namelets, $infile, $outfile) = @_; - - # I think the infile and outfile parts are never used. -- SMB - # But it's handy to have them around for debugging. - - if( $self->contents_file ) { - my $c = $self->_contents(); - push @$c, - [ join("::", @$namelets), $infile, $outfile, $namelets ] - # 0 1 2 3 - ; - DEBUG > 3 and print "Noting @$c[-1]\n"; - } - return; -} - -#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- - -sub write_contents_file { - my($self, $outdir) = @_; - my $outfile = $self->_contents_filespec($outdir) || return; - - $self->muse("Preparing list of modules for ToC"); - - my($toplevel, # maps toplevelbit => [all submodules] - $toplevel_form_freq, # ends up being 'foo' => 'Foo' - ) = $self->_prep_contents_breakdown; - - my $Contents = eval { $self->_wopen($outfile) }; - if( $Contents ) { - $self->muse( "Writing contents file $outfile" ); - } else { - warn "Couldn't write-open contents file $outfile: $!\nAbort writing to $outfile at all"; - return; - } - - $self->_write_contents_start( $Contents, $outfile, ); - $self->_write_contents_middle( $Contents, $outfile, $toplevel, $toplevel_form_freq ); - $self->_write_contents_end( $Contents, $outfile, ); - return $outfile; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _write_contents_start { - my($self, $Contents, $outfile) = @_; - my $starter = $self->contents_page_start || ''; - - { - my $css_wad = $self->_css_wad_to_markup(1); - if( $css_wad ) { - $starter =~ s{(</head>)}{\n$css_wad\n$1}i; # otherwise nevermind - } - - my $javascript_wad = $self->_javascript_wad_to_markup(1); - if( $javascript_wad ) { - $starter =~ s{(</head>)}{\n$javascript_wad\n$1}i; # otherwise nevermind - } - } - - unless(print $Contents $starter, "<dl class='superindex'>\n" ) { - warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; - close($Contents); - return 0; - } - return 1; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _write_contents_middle { - my($self, $Contents, $outfile, $toplevel2submodules, $toplevel_form_freq) = @_; - - foreach my $t (sort keys %$toplevel2submodules) { - my @downlines = sort {$a->[-1] cmp $b->[-1]} - @{ $toplevel2submodules->{$t} }; - - printf $Contents qq[<dt><a name="%s">%s</a></dt>\n<dd>\n], - esc( $t, $toplevel_form_freq->{$t} ) - ; - - my($path, $name); - foreach my $e (@downlines) { - $name = $e->[0]; - $path = join( "/", '.', esc( @{$e->[3]} ) ) - . ($HTML_EXTENSION || $Pod::Simple::HTML::HTML_EXTENSION); - print $Contents qq{ <a href="$path">}, esc($name), "</a> \n"; - } - print $Contents "</dd>\n\n"; - } - return 1; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _write_contents_end { - my($self, $Contents, $outfile) = @_; - unless( - print $Contents "</dl>\n", - $self->contents_page_end || '', - ) { - warn "Couldn't write to $outfile: $!"; - } - close($Contents) or warn "Couldn't close $outfile: $!"; - return 1; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _prep_contents_breakdown { - my($self) = @_; - my $contents = $self->_contents; - my %toplevel; # maps lctoplevelbit => [all submodules] - my %toplevel_form_freq; # ends up being 'foo' => 'Foo' - # (mapping anycase forms to most freq form) - - foreach my $entry (@$contents) { - my $toplevel = - $entry->[0] =~ m/^perl\w*$/ ? 'perl_core_docs' - # group all the perlwhatever docs together - : $entry->[3][0] # normal case - ; - ++$toplevel_form_freq{ lc $toplevel }{ $toplevel }; - push @{ $toplevel{ lc $toplevel } }, $entry; - push @$entry, lc($entry->[0]); # add a sort-order key to the end - } - - foreach my $toplevel (sort keys %toplevel) { - my $fgroup = $toplevel_form_freq{$toplevel}; - $toplevel_form_freq{$toplevel} = - ( - sort { $fgroup->{$b} <=> $fgroup->{$a} or $a cmp $b } - keys %$fgroup - # This hash is extremely unlikely to have more than 4 members, so this - # sort isn't so very wasteful - )[0]; - } - - return(\%toplevel, \%toplevel_form_freq) if wantarray; - return \%toplevel; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _contents_filespec { - my($self, $outdir) = @_; - my $outfile = $self->contents_file; - return unless $outfile; - return $self->filespecsys->catfile( $outdir, $outfile ); -} - -#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- - -sub makepath { - my($self, $outdir, $namelets) = @_; - return unless @$namelets > 1; - for my $i (0 .. ($#$namelets - 1)) { - my $dir = $self->filespecsys->catdir( $outdir, @$namelets[0 .. $i] ); - if(-e $dir) { - die "$dir exists but not as a directory!?" unless -d $dir; - next; - } - DEBUG > 3 and print " Making $dir\n"; - mkdir $dir, 0777 - or die "Can't mkdir $dir: $!\nAborting" - ; - } - return; -} - -#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- - -sub batch_mode_page_object_init { - my $self = shift; - my($page, $module, $infile, $outfile, $depth) = @_; - - # TODO: any further options to percolate onto this new object here? - - $page->default_title($module); - $page->index( $self->index ); - - $page->html_css( $self-> _css_wad_to_markup($depth) ); - $page->html_javascript( $self->_javascript_wad_to_markup($depth) ); - - $self->add_header_backlink($page, $module, $infile, $outfile, $depth); - $self->add_footer_backlink($page, $module, $infile, $outfile, $depth); - - - return $self; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub add_header_backlink { - my $self = shift; - return if $self->no_contents_links; - my($page, $module, $infile, $outfile, $depth) = @_; - $page->html_header_after_title( join '', - $page->html_header_after_title || '', - - qq[<p class="backlinktop"><b><a name="___top" href="], - $self->url_up_to_contents($depth), - qq[" accesskey="1" title="All Documents"><<</a></b></p>\n], - ) - if $self->contents_file - ; - return; -} - -sub add_footer_backlink { - my $self = shift; - return if $self->no_contents_links; - my($page, $module, $infile, $outfile, $depth) = @_; - $page->html_footer( join '', - qq[<p class="backlinkbottom"><b><a name="___bottom" href="], - $self->url_up_to_contents($depth), - qq[" title="All Documents"><<</a></b></p>\n], - - $page->html_footer || '', - ) - if $self->contents_file - ; - return; -} - -sub url_up_to_contents { - my($self, $depth) = @_; - --$depth; - return join '/', ('..') x $depth, esc($self->contents_file); -} - -#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- - -sub find_all_pods { - my($self, $dirs) = @_; - # You can override find_all_pods in a subclass if you want to - # do extra filtering or whatnot. But for the moment, we just - # pass to modnames2paths: - return $self->modnames2paths($dirs); -} - -#_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- - -sub modnames2paths { # return a hashref mapping modulenames => paths - my($self, $dirs) = @_; - - my $m2p; - { - my $search = $SEARCH_CLASS->new; - DEBUG and print "Searching via $search\n"; - $search->verbose(1) if DEBUG > 10; - $search->progress( $self->progress->copy->goal(0) ) if $self->progress; - $search->shadows(0); # don't bother noting shadowed files - $search->inc( $dirs ? 0 : 1 ); - $search->survey( $dirs ? @$dirs : () ); - $m2p = $search->name2path; - die "What, no name2path?!" unless $m2p; - } - - $self->muse("That's odd... no modules found!") unless keys %$m2p; - if( DEBUG > 4 ) { - print "Modules found (name => path):\n"; - foreach my $m (sort {lc($a) cmp lc($b)} keys %$m2p) { - print " $m $$m2p{$m}\n"; - } - print "(total ", scalar(keys %$m2p), ")\n\n"; - } elsif( DEBUG ) { - print "Found ", scalar(keys %$m2p), " modules.\n"; - } - $self->muse( "Found ", scalar(keys %$m2p), " modules." ); - - # return the Foo::Bar => /whatever/Foo/Bar.pod|pm hashref - return $m2p; -} - -#=========================================================================== - -sub _wopen { - # this is abstracted out so that the daemon class can override it - my($self, $outpath) = @_; - require Symbol; - my $out_fh = Symbol::gensym(); - DEBUG > 5 and print "Write-opening to $outpath\n"; - return $out_fh if open($out_fh, "> $outpath"); - require Carp; - Carp::croak("Can't write-open $outpath: $!"); -} - -#========================================================================== - -sub add_css { - my($self, $url, $is_default, $name, $content_type, $media, $_code) = @_; - return unless $url; - unless($name) { - # cook up a reasonable name based on the URL - $name = $url; - if( $name !~ m/\?/ and $name =~ m{([^/]+)$}s ) { - $name = $1; - $name =~ s/\.css//i; - } - } - $media ||= 'all'; - $content_type ||= 'text/css'; - - my $bunch = [$url, $name, $content_type, $media, $_code]; - if($is_default) { unshift @{ $self->_css_wad }, $bunch } - else { push @{ $self->_css_wad }, $bunch } - return; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _spray_css { - my($self, $outdir) = @_; - - return unless $self->css_flurry(); - $self->_gen_css_wad(); - - my $lol = $self->_css_wad; - foreach my $chunk (@$lol) { - my $url = $chunk->[0]; - my $outfile; - if( ref($chunk->[-1]) and $url =~ m{^(_[-a-z0-9_]+\.css$)} ) { - $outfile = $self->filespecsys->catfile( $outdir, $1 ); - DEBUG > 5 and print "Noting $$chunk[0] as a file I'll create.\n"; - } else { - DEBUG > 5 and print "OK, noting $$chunk[0] as an external CSS.\n"; - # Requires no further attention. - next; - } - - #$self->muse( "Writing autogenerated CSS file $outfile" ); - my $Cssout = $self->_wopen($outfile); - print $Cssout ${$chunk->[-1]} - or warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; - close($Cssout); - DEBUG > 5 and print "Wrote $outfile\n"; - } - - return; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _css_wad_to_markup { - my($self, $depth) = @_; - - my @css = @{ $self->_css_wad || return '' }; - return '' unless @css; - - my $rel = 'stylesheet'; - my $out = ''; - - --$depth; - my $uplink = $depth ? ('../' x $depth) : ''; - - foreach my $chunk (@css) { - next unless $chunk and @$chunk; - - my( $url1, $url2, $title, $type, $media) = ( - $self->_maybe_uplink( $chunk->[0], $uplink ), - esc(grep !ref($_), @$chunk) - ); - - $out .= qq{<link rel="$rel" title="$title" type="$type" href="$url1$url2" media="$media" >\n}; - - $rel = 'alternate stylesheet'; # alternates = all non-first iterations - } - return $out; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _maybe_uplink { - # if the given URL looks relative, return the given uplink string -- - # otherwise return emptystring - my($self, $url, $uplink) = @_; - ($url =~ m{^\./} or $url !~ m{[/\:]} ) - ? $uplink - : '' - # qualify it, if/as needed -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub _gen_css_wad { - my $self = $_[0]; - my $css_template = $self->_css_template; - foreach my $variation ( - - # Commented out for sake of concision: - # - # 011n=black_with_red_on_white - # 001n=black_with_yellow_on_white - # 101n=black_with_green_on_white - # 110=white_with_yellow_on_black - # 010=white_with_green_on_black - # 011=white_with_blue_on_black - # 100=white_with_red_on_black - - qw[ - 110n=black_with_blue_on_white - 010n=black_with_magenta_on_white - 100n=black_with_cyan_on_white - - 101=white_with_purple_on_black - 001=white_with_navy_blue_on_black - - 010a=grey_with_green_on_black - 010b=white_with_green_on_grey - 101an=black_with_green_on_grey - 101bn=grey_with_green_on_white - ]) { - - my $outname = $variation; - my($flipmode, @swap) = ( ($4 || ''), $1,$2,$3) - if $outname =~ s/^([012])([012])([[012])([a-z]*)=?//s; - @swap = () if '010' eq join '', @swap; # 010 is a swop-no-op! - - my $this_css = - "/* This file is autogenerated. Do not edit. $variation */\n\n" - . $css_template; - - # Only look at three-digitty colors, for now at least. - if( $flipmode =~ m/n/ ) { - $this_css =~ s/(#[0-9a-fA-F]{3})\b/_color_negate($1)/eg; - $this_css =~ s/\bthin\b/medium/g; - } - $this_css =~ s<#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])\b> - < join '', '#', ($1,$2,$3)[@swap] >eg if @swap; - - if( $flipmode =~ m/a/) - { $this_css =~ s/#fff\b/#999/gi } # black -> dark grey - elsif($flipmode =~ m/b/) - { $this_css =~ s/#000\b/#666/gi } # white -> light grey - - my $name = $outname; - $name =~ tr/-_/ /; - $self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css); - } - - # Now a few indexless variations: - foreach my $variation (qw[ - black_with_blue_on_white white_with_purple_on_black - white_with_green_on_grey grey_with_green_on_white - ]) { - my $outname = "indexless_$variation"; - my $this_css = join "\n", - "/* This file is autogenerated. Do not edit. $outname */\n", - "\@import url(\"./_$variation.css\");", - ".indexgroup { display: none; }", - "\n", - ; - my $name = $outname; - $name =~ tr/-_/ /; - $self->add_css( "_$outname.css", 0, $name, 0, 0, \$this_css); - } - - return; -} - -sub _color_negate { - my $x = lc $_[0]; - $x =~ tr[0123456789abcdef] - [fedcba9876543210]; - return $x; -} - -#=========================================================================== - -sub add_javascript { - my($self, $url, $content_type, $_code) = @_; - return unless $url; - push @{ $self->_javascript_wad }, [ - $url, $content_type || 'text/javascript', $_code - ]; - return; -} - -sub _spray_javascript { - my($self, $outdir) = @_; - return unless $self->javascript_flurry(); - $self->_gen_javascript_wad(); - - my $lol = $self->_javascript_wad; - foreach my $script (@$lol) { - my $url = $script->[0]; - my $outfile; - - if( ref($script->[-1]) and $url =~ m{^(_[-a-z0-9_]+\.js$)} ) { - $outfile = $self->filespecsys->catfile( $outdir, $1 ); - DEBUG > 5 and print "Noting $$script[0] as a file I'll create.\n"; - } else { - DEBUG > 5 and print "OK, noting $$script[0] as an external JavaScript.\n"; - next; - } - - #$self->muse( "Writing JavaScript file $outfile" ); - my $Jsout = $self->_wopen($outfile); - - print $Jsout ${$script->[-1]} - or warn "Couldn't print to $outfile: $!\nAbort writing to $outfile at all"; - close($Jsout); - DEBUG > 5 and print "Wrote $outfile\n"; - } - - return; -} - -sub _gen_javascript_wad { - my $self = $_[0]; - my $js_code = $self->_javascript || return; - $self->add_javascript( "_podly.js", 0, \$js_code); - return; -} - -sub _javascript_wad_to_markup { - my($self, $depth) = @_; - - my @scripts = @{ $self->_javascript_wad || return '' }; - return '' unless @scripts; - - my $out = ''; - - --$depth; - my $uplink = $depth ? ('../' x $depth) : ''; - - foreach my $s (@scripts) { - next unless $s and @$s; - - my( $url1, $url2, $type, $media) = ( - $self->_maybe_uplink( $s->[0], $uplink ), - esc(grep !ref($_), @$s) - ); - - $out .= qq{<script type="$type" src="$url1$url2"></script>\n}; - } - return $out; -} - -#=========================================================================== - -sub _css_template { return $CSS } -sub _javascript { return $JAVASCRIPT } - -$CSS = <<'EOCSS'; -/* For accessibility reasons, never specify text sizes in px/pt/pc/in/cm/mm */ - -@media all { .hide { display: none; } } - -@media print { - .noprint, div.indexgroup, .backlinktop, .backlinkbottom { display: none } - - * { - border-color: black !important; - color: black !important; - background-color: transparent !important; - background-image: none !important; - } - - dl.superindex > dd { - word-spacing: .6em; - } -} - -@media aural, braille, embossed { - div.indexgroup { display: none; } /* Too noisy, don't you think? */ - dl.superindex > dt:before { content: "Group "; } - dl.superindex > dt:after { content: " contains:"; } - .backlinktop a:before { content: "Back to contents"; } - .backlinkbottom a:before { content: "Back to contents"; } -} - -@media aural { - dl.superindex > dt { pause-before: 600ms; } -} - -@media screen, tty, tv, projection { - .noscreen { display: none; } - - a:link { color: #7070ff; text-decoration: underline; } - a:visited { color: #e030ff; text-decoration: underline; } - a:active { color: #800000; text-decoration: underline; } - body.contentspage a { text-decoration: none; } - a.u { color: #fff !important; text-decoration: none; } - - body.pod { - margin: 0 5px; - color: #fff; - background-color: #000; - } - - body.pod h1, body.pod h2, body.pod h3, body.pod h4 { - font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; - font-weight: normal; - margin-top: 1.2em; - margin-bottom: .1em; - border-top: thin solid transparent; - /* margin-left: -5px; border-left: 2px #7070ff solid; padding-left: 3px; */ - } - - body.pod h1 { border-top-color: #0a0; } - body.pod h2 { border-top-color: #080; } - body.pod h3 { border-top-color: #040; } - body.pod h4 { border-top-color: #010; } - - p.backlinktop + h1 { border-top: none; margin-top: 0em; } - p.backlinktop + h2 { border-top: none; margin-top: 0em; } - p.backlinktop + h3 { border-top: none; margin-top: 0em; } - p.backlinktop + h4 { border-top: none; margin-top: 0em; } - - body.pod dt { - font-size: 105%; /* just a wee bit more than normal */ - } - - .indexgroup { font-size: 80%; } - - .backlinktop, .backlinkbottom { - margin-left: -5px; - margin-right: -5px; - background-color: #040; - border-top: thin solid #050; - border-bottom: thin solid #050; - } - - .backlinktop a, .backlinkbottom a { - text-decoration: none; - color: #080; - background-color: #000; - border: thin solid #0d0; - } - .backlinkbottom { margin-bottom: 0; padding-bottom: 0; } - .backlinktop { margin-top: 0; padding-top: 0; } - - body.contentspage { - color: #fff; - background-color: #000; - } - - body.contentspage h1 { - color: #0d0; - margin-left: 1em; - margin-right: 1em; - text-indent: -.9em; - font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; - font-weight: normal; - border-top: thin solid #fff; - border-bottom: thin solid #fff; - text-align: center; - } - - dl.superindex > dt { - font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; - font-weight: normal; - font-size: 90%; - margin-top: .45em; - /* margin-bottom: -.15em; */ - } - dl.superindex > dd { - word-spacing: .6em; /* most important rule here! */ - } - dl.superindex > a:link { - text-decoration: none; - color: #fff; - } - - .contentsfooty { - border-top: thin solid #999; - font-size: 90%; - } - -} - -/* The End */ - -EOCSS - -#========================================================================== - -$JAVASCRIPT = <<'EOJAVASCRIPT'; - -// From http://www.alistapart.com/articles/alternate/ - -function setActiveStyleSheet(title) { - var i, a, main; - for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { - if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { - a.disabled = true; - if(a.getAttribute("title") == title) a.disabled = false; - } - } -} - -function getActiveStyleSheet() { - var i, a; - for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { - if( a.getAttribute("rel").indexOf("style") != -1 - && a.getAttribute("title") - && !a.disabled - ) return a.getAttribute("title"); - } - return null; -} - -function getPreferredStyleSheet() { - var i, a; - for(i=0 ; (a = document.getElementsByTagName("link")[i]) ; i++) { - if( a.getAttribute("rel").indexOf("style") != -1 - && a.getAttribute("rel").indexOf("alt") == -1 - && a.getAttribute("title") - ) return a.getAttribute("title"); - } - return null; -} - -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - } - else expires = ""; - document.cookie = name+"="+value+expires+"; path=/"; -} - -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(';'); - for(var i=0 ; i < ca.length ; i++) { - var c = ca[i]; - while (c.charAt(0)==' ') c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -window.onload = function(e) { - var cookie = readCookie("style"); - var title = cookie ? cookie : getPreferredStyleSheet(); - setActiveStyleSheet(title); -} - -window.onunload = function(e) { - var title = getActiveStyleSheet(); - createCookie("style", title, 365); -} - -var cookie = readCookie("style"); -var title = cookie ? cookie : getPreferredStyleSheet(); -setActiveStyleSheet(title); - -// The End - -EOJAVASCRIPT - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -1; -__END__ - - -=head1 NAME - -Pod::Simple::HTMLBatch - convert several Pod files to several HTML files - -=head1 SYNOPSIS - - perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' in out - - -=head1 DESCRIPTION - -This module is used for running batch-conversions of a lot of HTML -documents - -This class is NOT a subclass of Pod::Simple::HTML -(nor of bad old Pod::Html) -- although it uses -Pod::Simple::HTML for doing the conversion of each document. - -The normal use of this class is like so: - - use Pod::Simple::HTMLBatch; - my $batchconv = Pod::Simple::HTMLBatch->new; - $batchconv->some_option( some_value ); - $batchconv->some_other_option( some_other_value ); - $batchconv->batch_convert( \@search_dirs, $output_dir ); - -=head2 FROM THE COMMAND LINE - -Note that this class also provides -(but does not export) the function Pod::Simple::HTMLBatch::go. -This is basically just a shortcut for C<< -Pod::Simple::HTMLBatch->batch_convert(@ARGV) >>. -It's meant to be handy for calling from the command line. - -However, the shortcut requires that you specify exactly two command-line -arguments, C<indirs> and C<outdir>. - -Example: - - % mkdir out_html - % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go @INC out_html - (to convert the pod from Perl's @INC - files under the directory ../htmlversion) - -(Note that the command line there contains a literal atsign-I-N-C. This -is handled as a special case by batch_convert, in order to save you having -to enter the odd-looking "" as the first command-line parameter when you -mean "just use whatever's in @INC".) - -Example: - - % mkdir ../seekrut - % chmod og-rx ../seekrut - % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go . ../htmlversion - (to convert the pod under the current dir into HTML - files under the directory ../htmlversion) - -Example: - - % perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go happydocs . - (to convert all pod from happydocs into the current directory) - - - -=head1 MAIN METHODS - -=over - -=item $batchconv = Pod::Simple::HTMLBatch->new; - -This TODO - - -=item $batchconv->batch_convert( I<indirs>, I<outdir> ); - -this TODO - -=item $batchconv->batch_convert( undef , ...); - -=item $batchconv->batch_convert( q{@INC}, ...); - -These two values for I<indirs> specify that the normal Perl @INC - -=item $batchconv->batch_convert( \@dirs , ...); - -This specifies that the input directories are the items in -the arrayref C<\@dirs>. - -=item $batchconv->batch_convert( "somedir" , ...); - -This specifies that the director "somedir" is the input. -(This can be an absolute or relative path, it doesn't matter.) - -A common value you might want would be just "." for the current -directory: - - $batchconv->batch_convert( "." , ...); - - -=item $batchconv->batch_convert( 'somedir:someother:also' , ...); - -This specifies that you want the dirs "somedir", "somother", and "also" -scanned, just as if you'd passed the arrayref -C<[qw( somedir someother also)]>. Note that a ":"-separator is normal -under Unix, but Under MSWin, you'll need C<'somedir;someother;also'> -instead, since the pathsep on MSWin is ";" instead of ":". (And -I<that> is because ":" often comes up in paths, like -C<"c:/perl/lib">.) - -(Exactly what separator character should be used, is gotten from -C<$Config::Config{'path_sep'}>, via the L<Config> module.) - -=item $batchconv->batch_convert( ... , undef ); - -This specifies that you want the HTML output to go into the current -directory. - -(Note that a missing or undefined value means a different thing in -the first slot than in the second. That's so that C<batch_convert()> -with no arguments (or undef arguments) means "go from @INC, into -the current directory.) - -=item $batchconv->batch_convert( ... , 'somedir' ); - -This specifies that you want the HTML output to go into the -directory 'somedir'. -(This can be an absolute or relative path, it doesn't matter.) - -=back - - -Note that you can also call C<batch_convert> as a class method, -like so: - - Pod::Simple::HTMLBatch->batch_convert( ... ); - -That is just short for this: - - Pod::Simple::HTMLBatch-> new-> batch_convert(...); - -That is, it runs a conversion with default options, for -whatever inputdirs and output dir you specify. - - -=head2 ACCESSOR METHODS - -The following are all accessor methods -- that is, they don't do anything -on their own, but just alter the contents of the conversion object, -which comprises the options for this particular batch conversion. - -We show the "put" form of the accessors below (i.e., the syntax you use -for setting the accessor to a specific value). But you can also -call each method with no parameters to get its current value. For -example, C<< $self->contents_file() >> returns the current value of -the contents_file attribute. - -=over - - -=item $batchconv->verbose( I<nonnegative_integer> ); - -This controls how verbose to be during batch conversion, as far as -notes to STDOUT (or whatever is C<select>'d) about how the conversion -is going. If 0, no progress information is printed. -If 1 (the default value), some progress information is printed. -Higher values print more information. - - -=item $batchconv->index( I<true-or-false> ); - -This controls whether or not each HTML page is liable to have a little -table of contents at the top (which we call an "index" for historical -reasons). This is true by default. - - -=item $batchconv->contents_file( I<filename> ); - -If set, should be the name of a file (in the output directory) -to write the HTML index to. The default value is "index.html". -If you set this to a false value, no contents file will be written. - -=item $batchconv->contents_page_start( I<HTML_string> ); - -This specifies what string should be put at the beginning of -the contents page. -The default is a string more or less like this: - - <html> - <head><title>Perl Documentation</title></head> - <body class='contentspage'> - <h1>Perl Documentation</h1> - -=item $batchconv->contents_page_end( I<HTML_string> ); - -This specifies what string should be put at the end of the contents page. -The default is a string more or less like this: - - <p class='contentsfooty'>Generated by - Pod::Simple::HTMLBatch v3.01 under Perl v5.008 - <br >At Fri May 14 22:26:42 2004 GMT, - which is Fri May 14 14:26:42 2004 local time.</p> - - - -=item $batchconv->add_css( $url ); - -TODO - -=item $batchconv->add_javascript( $url ); - -TODO - -=item $batchconv->css_flurry( I<true-or-false> ); - -If true (the default value), we autogenerate some CSS files in the -output directory, and set our HTML files to use those. -TODO: continue - -=item $batchconv->javascript_flurry( I<true-or-false> ); - -If true (the default value), we autogenerate a JavaScript in the -output directory, and set our HTML files to use it. Currently, -the JavaScript is used only to get the browser to remember what -stylesheet it prefers. -TODO: continue - -=item $batchconv->no_contents_links( I<true-or-false> ); - -TODO - -=item $batchconv->html_render_class( I<classname> ); - -This sets what class is used for rendering the files. -The default is "Pod::Simple::Search". If you set it to something else, -it should probably be a subclass of Pod::Simple::Search, and you should -C<require> or C<use> that class so that's it's loaded before -Pod::Simple::HTMLBatch tries loading it. - -=back - - - - -=head1 NOTES ON CUSTOMIZATION - -TODO - - call add_css($someurl) to add stylesheet as alternate - call add_css($someurl,1) to add as primary stylesheet - - call add_javascript - - subclass Pod::Simple::HTML and set $batchconv->html_render_class to - that classname - and maybe override - $page->batch_mode_page_object_init($self, $module, $infile, $outfile, $depth) - or maybe override - $batchconv->batch_mode_page_object_init($page, $module, $infile, $outfile, $depth) - - - -=head1 ASK ME! - -If you want to do some kind of big pod-to-HTML version with some -particular kind of option that you don't see how to achieve using this -module, email me (C<sburke@cpan.org>) and I'll probably have a good idea -how to do it. For reasons of concision and energetic laziness, some -methods and options in this module (and the dozen modules it depends on) -are undocumented; but one of those undocumented bits might be just what -you're looking for. - - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::HTMLBatch>, L<perlpod>, L<perlpodspec> - - - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2004 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - - - diff --git a/web/bin/lib/Pod/Simple/HTMLLegacy.pm b/web/bin/lib/Pod/Simple/HTMLLegacy.pm deleted file mode 100644 index f78de90..0000000 --- a/web/bin/lib/Pod/Simple/HTMLLegacy.pm +++ /dev/null @@ -1,104 +0,0 @@ - -require 5; -package Pod::Simple::HTMLLegacy; -use strict; - -use vars qw($VERSION); -use Getopt::Long; - -$VERSION = "5.01"; - -#-------------------------------------------------------------------------- -# -# This class is meant to thinly emulate bad old Pod::Html -# -# TODO: some basic docs - -sub pod2html { - my @args = (@_); - - my( $verbose, $infile, $outfile, $title ); - my $index = 1; - - { - my($help); - - my($netscape); # dummy - local @ARGV = @args; - GetOptions( - "help" => \$help, - "verbose!" => \$verbose, - "infile=s" => \$infile, - "outfile=s" => \$outfile, - "title=s" => \$title, - "index!" => \$index, - - "netscape!" => \$netscape, - ) or return bad_opts(@args); - bad_opts(@args) if @ARGV; # it should be all switches! - return help_message() if $help; - } - - for($infile, $outfile) { $_ = undef unless defined and length } - - if($verbose) { - warn sprintf "%s version %s\n", __PACKAGE__, $VERSION; - warn "OK, processed args [@args] ...\n"; - warn sprintf - " Verbose: %s\n Index: %s\n Infile: %s\n Outfile: %s\n Title: %s\n", - map defined($_) ? $_ : "(nil)", - $verbose, $index, $infile, $outfile, $title, - ; - *Pod::Simple::HTML::DEBUG = sub(){1}; - } - require Pod::Simple::HTML; - Pod::Simple::HTML->VERSION(3); - - die "No such input file as $infile\n" - if defined $infile and ! -e $infile; - - - my $pod = Pod::Simple::HTML->new; - $pod->force_title($title) if defined $title; - $pod->index($index); - return $pod->parse_from_file($infile, $outfile); -} - -#-------------------------------------------------------------------------- - -sub bad_opts { die _help_message(); } -sub help_message { print STDOUT _help_message() } - -#-------------------------------------------------------------------------- - -sub _help_message { - - join '', - -"[", __PACKAGE__, " version ", $VERSION, qq~] -Usage: pod2html --help --infile=<name> --outfile=<name> - --verbose --index --noindex - -Options: - --help - prints this message. - --[no]index - generate an index at the top of the resulting html - (default behavior). - --infile - filename for the pod to convert (input taken from stdin - by default). - --outfile - filename for the resulting html file (output sent to - stdout by default). - --title - title that will appear in resulting html file. - --[no]verbose - self-explanatory (off by default). - -Note that pod2html is DEPRECATED, and this version implements only - some of the options known to older versions. -For more information, see 'perldoc pod2html'. -~; - -} - -1; -__END__ - -OVER the underpass! UNDER the overpass! Around the FUTURE and BEYOND REPAIR!! - diff --git a/web/bin/lib/Pod/Simple/LinkSection.pm b/web/bin/lib/Pod/Simple/LinkSection.pm deleted file mode 100644 index 14c3ba8..0000000 --- a/web/bin/lib/Pod/Simple/LinkSection.pm +++ /dev/null @@ -1,145 +0,0 @@ - -require 5; -package Pod::Simple::LinkSection; - # Based somewhat dimly on Array::Autojoin - -use strict; -use Pod::Simple::BlackBox; - -use overload( # So it'll stringify nice - '""' => \&Pod::Simple::BlackBox::stringify_lol, - 'bool' => \&Pod::Simple::BlackBox::stringify_lol, - # '.=' => \&tack_on, # grudgingly support - - 'fallback' => 1, # turn on cleverness -); - -sub tack_on { - $_[0] = ['', {}, "$_[0]" ]; - return $_[0][2] .= $_[1]; -} - -sub as_string { - goto &Pod::Simple::BlackBox::stringify_lol; -} -sub stringify { - goto &Pod::Simple::BlackBox::stringify_lol; -} - -sub new { - my $class = shift; - $class = ref($class) || $class; - my $new; - if(@_ == 1) { - if (!ref($_[0] || '')) { # most common case: one bare string - return bless ['', {}, $_[0] ], $class; - } elsif( ref($_[0] || '') eq 'ARRAY') { - $new = [ @{ $_[0] } ]; - } else { - Carp::croak( "$class new() doesn't know to clone $new" ); - } - } else { # misc stuff - $new = [ '', {}, @_ ]; - } - - # By now it's a treelet: [ 'foo', {}, ... ] - foreach my $x (@$new) { - if(ref($x || '') eq 'ARRAY') { - $x = $class->new($x); # recurse - } elsif(ref($x || '') eq 'HASH') { - $x = { %$x }; - } - # otherwise leave it. - } - - return bless $new, $class; -} - -# Not much in this class is likely to be link-section specific -- -# but it just so happens that link-sections are about the only treelets -# that are exposed to the user. - -1; - -__END__ - -# TODO: let it be an option whether a given subclass even wants little treelets? - - -__END__ - -=head1 NAME - -Pod::Simple::LinkSection -- represent "section" attributes of L codes - -=head1 SYNOPSIS - - # a long story - -=head1 DESCRIPTION - -This class is not of interest to general users. - -Pod::Simple uses this class for representing the value of the -"section" attribute of "L" start-element events. Most applications -can just use the normal stringification of objects of this class; -they stringify to just the text content of the section, -such as "foo" for -C<< LZ<><Stuff/foo> >>, and "bar" for -C<< LZ<><Stuff/bIZ<><ar>> >>. - -However, anyone particularly interested in getting the full value of -the treelet, can just traverse the content of the treeleet -@$treelet_object. To wit: - - - % perl -MData::Dumper -e - "use base qw(Pod::Simple::Methody); - sub start_L { print Dumper($_[1]{'section'} ) } - __PACKAGE__->new->parse_string_document('=head1 L<Foo/bI<ar>baz>>') - " -Output: - $VAR1 = bless( [ - '', - {}, - 'b', - bless( [ - 'I', - {}, - 'ar' - ], 'Pod::Simple::LinkSection' ), - 'baz' - ], 'Pod::Simple::LinkSection' ); - -But stringify it and you get just the text content: - - % perl -MData::Dumper -e - "use base qw(Pod::Simple::Methody); - sub start_L { print Dumper( '' . $_[1]{'section'} ) } - __PACKAGE__->new->parse_string_document('=head1 L<Foo/bI<ar>baz>>') - " -Output: - $VAR1 = 'barbaz'; - - -=head1 SEE ALSO - -L<Pod::Simple> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/Methody.pm b/web/bin/lib/Pod/Simple/Methody.pm deleted file mode 100644 index 2ad607e..0000000 --- a/web/bin/lib/Pod/Simple/Methody.pm +++ /dev/null @@ -1,127 +0,0 @@ - -require 5; -package Pod::Simple::Methody; -use strict; -use Pod::Simple (); -use vars qw(@ISA $VERSION); -$VERSION = '2.02'; -@ISA = ('Pod::Simple'); - -# Yes, we could use named variables, but I want this to be impose -# as little an additional performance hit as possible. - -sub _handle_element_start { - $_[1] =~ tr/-:./__/; - ( $_[0]->can( 'start_' . $_[1] ) - || return - )->( - $_[0], $_[2] - ); -} - -sub _handle_text { - ( $_[0]->can( 'handle_text' ) - || return - )->( - @_ - ); -} - -sub _handle_element_end { - $_[1] =~ tr/-:./__/; - ( $_[0]->can( 'end_' . $_[1] ) - || return - )->( - $_[0] - ); -} - -1; - - -__END__ - -=head1 NAME - -Pod::Simple::Methody -- turn Pod::Simple events into method calls - -=head1 SYNOPSIS - - require 5; - use strict; - package SomePodFormatter; - use base qw(Pod::Simple::Methody); - - sub handle_text { - my($self, $text) = @_; - ... - } - - sub start_head1 { - my($self, $attrs) = @_; - ... - } - sub end_head1 { - my($self) = @_; - ... - } - -...and start_/end_ methods for whatever other events you want to catch. - -=head1 DESCRIPTION - -This class is of -interest to people writing Pod formatters based on Pod::Simple. - -This class (which is very small -- read the source) overrides -Pod::Simple's _handle_element_start, _handle_text, and -_handle_element_end methods so that parser events are turned into method -calls. (Otherwise, this is a subclass of L<Pod::Simple> and inherits all -its methods.) - -You can use this class as the base class for a Pod formatter/processor. - -=head1 METHOD CALLING - -When Pod::Simple sees a "=head1 Hi there", for example, it basically does -this: - - $parser->_handle_element_start( "head1", \%attributes ); - $parser->_handle_text( "Hi there" ); - $parser->_handle_element_end( "head1" ); - -But if you subclass Pod::Simple::Methody, it will instead do this -when it sees a "=head1 Hi there": - - $parser->start_head1( \%attributes ) if $parser->can('start_head1'); - $parser->handle_text( "Hi there" ) if $parser->can('handle_text'); - $parser->end_head1() if $parser->can('end_head1'); - -If Pod::Simple sends an event where the element name has a dash, -period, or colon, the corresponding method name will have a underscore -in its place. For example, "foo.bar:baz" becomes start_foo_bar_baz -and end_foo_bar_baz. - -See the source for Pod::Simple::Text for an example of using this class. - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::Subclassing> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/Progress.pm b/web/bin/lib/Pod/Simple/Progress.pm deleted file mode 100644 index bc42a95..0000000 --- a/web/bin/lib/Pod/Simple/Progress.pm +++ /dev/null @@ -1,93 +0,0 @@ - -require 5; -package Pod::Simple::Progress; -$VERSION = "1.01"; -use strict; - -# Objects of this class are used for noting progress of an -# operation every so often. Messages delivered more often than that -# are suppressed. -# -# There's actually nothing in here that's specific to Pod processing; -# but it's ad-hoc enough that I'm not willing to give it a name that -# implies that it's generally useful, like "IO::Progress" or something. -# -# -- sburke -# -#-------------------------------------------------------------------------- - -sub new { - my($class,$delay) = @_; - my $self = bless {'quiet_until' => 1}, ref($class) || $class; - $self->to(*STDOUT{IO}); - $self->delay(defined($delay) ? $delay : 5); - return $self; -} - -sub copy { - my $orig = shift; - bless {%$orig, 'quiet_until' => 1}, ref($orig); -} -#-------------------------------------------------------------------------- - -sub reach { - my($self, $point, $note) = @_; - if( (my $now = time) >= $self->{'quiet_until'}) { - my $goal; - my $to = $self->{'to'}; - print $to join('', - ($self->{'quiet_until'} == 1) ? () : '... ', - (defined $point) ? ( - '#', - ($goal = $self->{'goal'}) ? ( - ' ' x (length($goal) - length($point)), - $point, '/', $goal, - ) : $point, - $note ? ': ' : (), - ) : (), - $note || '', - "\n" - ); - $self->{'quiet_until'} = $now + $self->{'delay'}; - } - return $self; -} - -#-------------------------------------------------------------------------- - -sub done { - my($self, $note) = @_; - $self->{'quiet_until'} = 1; - return $self->reach( undef, $note ); -} - -#-------------------------------------------------------------------------- -# Simple accessors: - -sub delay { - return $_[0]{'delay'} if @_ == 1; $_[0]{'delay'} = $_[1]; return $_[0] } -sub goal { - return $_[0]{'goal' } if @_ == 1; $_[0]{'goal' } = $_[1]; return $_[0] } -sub to { - return $_[0]{'to' } if @_ == 1; $_[0]{'to' } = $_[1]; return $_[0] } - -#-------------------------------------------------------------------------- - -unless(caller) { # Simple self-test: - my $p = __PACKAGE__->new->goal(5); - $p->reach(1, "Primus!"); - sleep 1; - $p->reach(2, "Secundus!"); - sleep 3; - $p->reach(3, "Tertius!"); - sleep 5; - $p->reach(4); - $p->reach(5, "Quintus!"); - sleep 1; - $p->done("All done"); -} - -#-------------------------------------------------------------------------- -1; -__END__ - diff --git a/web/bin/lib/Pod/Simple/PullParser.pm b/web/bin/lib/Pod/Simple/PullParser.pm deleted file mode 100644 index 15d9731..0000000 --- a/web/bin/lib/Pod/Simple/PullParser.pm +++ /dev/null @@ -1,795 +0,0 @@ - -require 5; -package Pod::Simple::PullParser; -$VERSION = '2.02'; -use Pod::Simple (); -BEGIN {@ISA = ('Pod::Simple')} - -use strict; -use Carp (); - -use Pod::Simple::PullParserStartToken; -use Pod::Simple::PullParserEndToken; -use Pod::Simple::PullParserTextToken; - -BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } - -__PACKAGE__->_accessorize( - 'source_fh', # the filehandle we're reading from - 'source_scalar_ref', # the scalarref we're reading from - 'source_arrayref', # the arrayref we're reading from -); - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# -# And here is how we implement a pull-parser on top of a push-parser... - -sub filter { - my($self, $source) = @_; - $self = $self->new unless ref $self; - - $source = *STDIN{IO} unless defined $source; - $self->set_source($source); - $self->output_fh(*STDOUT{IO}); - - $self->run; # define run() in a subclass if you want to use filter()! - return $self; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -sub parse_string_document { - my $this = shift; - $this->set_source(\ $_[0]); - $this->run; -} - -sub parse_file { - my($this, $filename) = @_; - $this->set_source($filename); - $this->run; -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# In case anyone tries to use them: - -sub run { - use Carp (); - if( __PACKAGE__ eq ref($_[0]) || $_[0]) { # I'm not being subclassed! - Carp::croak "You can call run() only on subclasses of " - . __PACKAGE__; - } else { - Carp::croak join '', - "You can't call run() because ", - ref($_[0]) || $_[0], " didn't define a run() method"; - } -} - -sub parse_lines { - use Carp (); - Carp::croak "Use set_source with ", __PACKAGE__, - " and subclasses, not parse_lines"; -} - -sub parse_line { - use Carp (); - Carp::croak "Use set_source with ", __PACKAGE__, - " and subclasses, not parse_line"; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub new { - my $class = shift; - my $self = $class->SUPER::new(@_); - die "Couldn't construct for $class" unless $self; - - $self->{'token_buffer'} ||= []; - $self->{'start_token_class'} ||= 'Pod::Simple::PullParserStartToken'; - $self->{'text_token_class'} ||= 'Pod::Simple::PullParserTextToken'; - $self->{'end_token_class'} ||= 'Pod::Simple::PullParserEndToken'; - - DEBUG > 1 and print "New pullparser object: $self\n"; - - return $self; -} - -# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - -sub get_token { - my $self = shift; - DEBUG > 1 and print "\nget_token starting up on $self.\n"; - DEBUG > 2 and print " Items in token-buffer (", - scalar( @{ $self->{'token_buffer'} } ) , - ") :\n", map( - " " . $_->dump . "\n", @{ $self->{'token_buffer'} } - ), - @{ $self->{'token_buffer'} } ? '' : ' (no tokens)', - "\n" - ; - - until( @{ $self->{'token_buffer'} } ) { - DEBUG > 3 and print "I need to get something into my empty token buffer...\n"; - if($self->{'source_dead'}) { - DEBUG and print "$self 's source is dead.\n"; - push @{ $self->{'token_buffer'} }, undef; - } elsif(exists $self->{'source_fh'}) { - my @lines; - my $fh = $self->{'source_fh'} - || Carp::croak('You have to call set_source before you can call get_token'); - - DEBUG and print "$self 's source is filehandle $fh.\n"; - # Read those many lines at a time - for(my $i = Pod::Simple::MANY_LINES; $i--;) { - DEBUG > 3 and print " Fetching a line from source filehandle $fh...\n"; - local $/ = $Pod::Simple::NL; - push @lines, scalar(<$fh>); # readline - DEBUG > 3 and print " Line is: ", - defined($lines[-1]) ? $lines[-1] : "<undef>\n"; - unless( defined $lines[-1] ) { - DEBUG and print "That's it for that source fh! Killing.\n"; - delete $self->{'source_fh'}; # so it can be GC'd - last; - } - # but pass thru the undef, which will set source_dead to true - - # TODO: look to see if $lines[-1] is =encoding, and if so, - # do horribly magic things - - } - - if(DEBUG > 8) { - print "* I've gotten ", scalar(@lines), " lines:\n"; - foreach my $l (@lines) { - if(defined $l) { - print " line {$l}\n"; - } else { - print " line undef\n"; - } - } - print "* end of ", scalar(@lines), " lines\n"; - } - - $self->SUPER::parse_lines(@lines); - - } elsif(exists $self->{'source_arrayref'}) { - DEBUG and print "$self 's source is arrayref $self->{'source_arrayref'}, with ", - scalar(@{$self->{'source_arrayref'}}), " items left in it.\n"; - - DEBUG > 3 and print " Fetching ", Pod::Simple::MANY_LINES, " lines.\n"; - $self->SUPER::parse_lines( - splice @{ $self->{'source_arrayref'} }, - 0, - Pod::Simple::MANY_LINES - ); - unless( @{ $self->{'source_arrayref'} } ) { - DEBUG and print "That's it for that source arrayref! Killing.\n"; - $self->SUPER::parse_lines(undef); - delete $self->{'source_arrayref'}; # so it can be GC'd - } - # to make sure that an undef is always sent to signal end-of-stream - - } elsif(exists $self->{'source_scalar_ref'}) { - - DEBUG and print "$self 's source is scalarref $self->{'source_scalar_ref'}, with ", - length(${ $self->{'source_scalar_ref'} }) - - (pos(${ $self->{'source_scalar_ref'} }) || 0), - " characters left to parse.\n"; - - DEBUG > 3 and print " Fetching a line from source-string...\n"; - if( ${ $self->{'source_scalar_ref'} } =~ - m/([^\n\r]*)((?:\r?\n)?)/g - ) { - #print(">> $1\n"), - $self->SUPER::parse_lines($1) - if length($1) or length($2) - or pos( ${ $self->{'source_scalar_ref'} }) - != length( ${ $self->{'source_scalar_ref'} }); - # I.e., unless it's a zero-length "empty line" at the very - # end of "foo\nbar\n" (i.e., between the \n and the EOS). - } else { # that's the end. Byebye - $self->SUPER::parse_lines(undef); - delete $self->{'source_scalar_ref'}; - DEBUG and print "That's it for that source scalarref! Killing.\n"; - } - - - } else { - die "What source??"; - } - } - DEBUG and print "get_token about to return ", - Pod::Simple::pretty( @{$self->{'token_buffer'}} - ? $self->{'token_buffer'}[-1] : undef - ), "\n"; - return shift @{$self->{'token_buffer'}}; # that's an undef if empty -} - -use UNIVERSAL (); -sub unget_token { - my $self = shift; - DEBUG and print "Ungetting ", scalar(@_), " tokens: ", - @_ ? "@_\n" : "().\n"; - foreach my $t (@_) { - Carp::croak "Can't unget that, because it's not a token -- it's undef!" - unless defined $t; - Carp::croak "Can't unget $t, because it's not a token -- it's a string!" - unless ref $t; - Carp::croak "Can't unget $t, because it's not a token object!" - unless UNIVERSAL::can($t, 'type'); - } - - unshift @{$self->{'token_buffer'}}, @_; - DEBUG > 1 and print "Token buffer now has ", - scalar(@{$self->{'token_buffer'}}), " items in it.\n"; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -# $self->{'source_filename'} = $source; - -sub set_source { - my $self = shift @_; - return $self->{'source_fh'} unless @_; - my $handle; - if(!defined $_[0]) { - Carp::croak("Can't use empty-string as a source for set_source"); - } elsif(ref(\( $_[0] )) eq 'GLOB') { - $self->{'source_filename'} = '' . ($handle = $_[0]); - DEBUG and print "$self 's source is glob $_[0]\n"; - # and fall thru - } elsif(ref( $_[0] ) eq 'SCALAR') { - $self->{'source_scalar_ref'} = $_[0]; - DEBUG and print "$self 's source is scalar ref $_[0]\n"; - return; - } elsif(ref( $_[0] ) eq 'ARRAY') { - $self->{'source_arrayref'} = $_[0]; - DEBUG and print "$self 's source is array ref $_[0]\n"; - return; - } elsif(ref $_[0]) { - $self->{'source_filename'} = '' . ($handle = $_[0]); - DEBUG and print "$self 's source is fh-obj $_[0]\n"; - } elsif(!length $_[0]) { - Carp::croak("Can't use empty-string as a source for set_source"); - } else { # It's a filename! - DEBUG and print "$self 's source is filename $_[0]\n"; - { - local *PODSOURCE; - open(PODSOURCE, "<$_[0]") || Carp::croak "Can't open $_[0]: $!"; - $handle = *PODSOURCE{IO}; - } - $self->{'source_filename'} = $_[0]; - DEBUG and print " Its name is $_[0].\n"; - - # TODO: file-discipline things here! - } - - $self->{'source_fh'} = $handle; - DEBUG and print " Its handle is $handle\n"; - return 1; -} - -# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ - -sub get_title_short { shift->get_short_title(@_) } # alias - -sub get_short_title { - my $title = shift->get_title(@_); - $title = $1 if $title =~ m/^(\S{1,60})\s+--?\s+./s; - # turn "Foo::Bar -- bars for your foo" into "Foo::Bar" - return $title; -} - -sub get_title { shift->_get_titled_section( - 'NAME', max_token => 50, desperate => 1, @_) -} -sub get_version { shift->_get_titled_section( - 'VERSION', - max_token => 400, - accept_verbatim => 1, - max_content_length => 3_000, - @_, - ); -} -sub get_description { shift->_get_titled_section( - 'DESCRIPTION', - max_token => 400, - max_content_length => 3_000, - @_, -) } - -sub get_authors { shift->get_author(@_) } # a harmless alias - -sub get_author { - my $this = shift; - # Max_token is so high because these are - # typically at the end of the document: - $this->_get_titled_section('AUTHOR' , max_token => 10_000, @_) || - $this->_get_titled_section('AUTHORS', max_token => 10_000, @_); -} - -#-------------------------------------------------------------------------- - -sub _get_titled_section { - # Based on a get_title originally contributed by Graham Barr - my($self, $titlename, %options) = (@_); - - my $max_token = delete $options{'max_token'}; - my $desperate_for_title = delete $options{'desperate'}; - my $accept_verbatim = delete $options{'accept_verbatim'}; - my $max_content_length = delete $options{'max_content_length'}; - $max_content_length = 120 unless defined $max_content_length; - - Carp::croak( "Unknown " . ((1 == keys %options) ? "option: " : "options: ") - . join " ", map "[$_]", sort keys %options - ) - if keys %options; - - my %content_containers; - $content_containers{'Para'} = 1; - if($accept_verbatim) { - $content_containers{'Verbatim'} = 1; - $content_containers{'VerbatimFormatted'} = 1; - } - - my $token_count = 0; - my $title; - my @to_unget; - my $state = 0; - my $depth = 0; - - Carp::croak "What kind of titlename is \"$titlename\"?!" unless - defined $titlename and $titlename =~ m/^[A-Z ]{1,60}$/s; #sanity - my $titlename_re = quotemeta($titlename); - - my $head1_text_content; - my $para_text_content; - - while( - ++$token_count <= ($max_token || 1_000_000) - and defined(my $token = $self->get_token) - ) { - push @to_unget, $token; - - if ($state == 0) { # seeking =head1 - if( $token->is_start and $token->tagname eq 'head1' ) { - DEBUG and print " Found head1. Seeking content...\n"; - ++$state; - $head1_text_content = ''; - } - } - - elsif($state == 1) { # accumulating text until end of head1 - if( $token->is_text ) { - DEBUG and print " Adding \"", $token->text, "\" to head1-content.\n"; - $head1_text_content .= $token->text; - } elsif( $token->is_end and $token->tagname eq 'head1' ) { - DEBUG and print " Found end of head1. Considering content...\n"; - if($head1_text_content eq $titlename - or $head1_text_content =~ m/\($titlename_re\)/s - # We accept "=head1 Nomen Modularis (NAME)" for sake of i18n - ) { - DEBUG and print " Yup, it was $titlename. Seeking next para-content...\n"; - ++$state; - } elsif( - $desperate_for_title - # if we're so desperate we'll take the first - # =head1's content as a title - and $head1_text_content =~ m/\S/ - and $head1_text_content !~ m/^[ A-Z]+$/s - and $head1_text_content !~ - m/\((?: - NAME | TITLE | VERSION | AUTHORS? | DESCRIPTION | SYNOPSIS - | COPYRIGHT | LICENSE | NOTES? | FUNCTIONS? | METHODS? - | CAVEATS? | BUGS? | SEE\ ALSO | SWITCHES | ENVIRONMENT - )\)/sx - # avoid accepting things like =head1 Thingy Thongy (DESCRIPTION) - and ($max_content_length - ? (length($head1_text_content) <= $max_content_length) # sanity - : 1) - ) { - DEBUG and print " It looks titular: \"$head1_text_content\".\n", - "\n Using that.\n"; - $title = $head1_text_content; - last; - } else { - --$state; - DEBUG and print " Didn't look titular ($head1_text_content).\n", - "\n Dropping back to seeking-head1-content mode...\n"; - } - } - } - - elsif($state == 2) { - # seeking start of para (which must immediately follow) - if($token->is_start and $content_containers{ $token->tagname }) { - DEBUG and print " Found start of Para. Accumulating content...\n"; - $para_text_content = ''; - ++$state; - } else { - DEBUG and print - " Didn't see an immediately subsequent start-Para. Reseeking H1\n"; - $state = 0; - } - } - - elsif($state == 3) { - # accumulating text until end of Para - if( $token->is_text ) { - DEBUG and print " Adding \"", $token->text, "\" to para-content.\n"; - $para_text_content .= $token->text; - # and keep looking - - } elsif( $token->is_end and $content_containers{ $token->tagname } ) { - DEBUG and print " Found end of Para. Considering content: ", - $para_text_content, "\n"; - - if( $para_text_content =~ m/\S/ - and ($max_content_length - ? (length($para_text_content) <= $max_content_length) - : 1) - ) { - # Some minimal sanity constraints, I think. - DEBUG and print " It looks contentworthy, I guess. Using it.\n"; - $title = $para_text_content; - last; - } else { - DEBUG and print " Doesn't look at all contentworthy!\n Giving up.\n"; - undef $title; - last; - } - } - } - - else { - die "IMPOSSIBLE STATE $state!\n"; # should never happen - } - - } - - # Put it all back! - $self->unget_token(@to_unget); - - if(DEBUG) { - if(defined $title) { print " Returing title <$title>\n" } - else { print "Returning title <>\n" } - } - - return '' unless defined $title; - $title =~ s/^\s+//; - return $title; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -# -# Methods that actually do work at parse-time: - -sub _handle_element_start { - my $self = shift; # leaving ($element_name, $attr_hash_r) - DEBUG > 2 and print "++ $_[0] (", map("<$_> ", %{$_[1]}), ")\n"; - - push @{ $self->{'token_buffer'} }, - $self->{'start_token_class'}->new(@_); - return; -} - -sub _handle_text { - my $self = shift; # leaving ($text) - DEBUG > 2 and print "== $_[0]\n"; - push @{ $self->{'token_buffer'} }, - $self->{'text_token_class'}->new(@_); - return; -} - -sub _handle_element_end { - my $self = shift; # leaving ($element_name); - DEBUG > 2 and print "-- $_[0]\n"; - push @{ $self->{'token_buffer'} }, - $self->{'end_token_class'}->new(@_); - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -1; - - -__END__ - -=head1 NAME - -Pod::Simple::PullParser -- a pull-parser interface to parsing Pod - -=head1 SYNOPSIS - - my $parser = SomePodProcessor->new; - $parser->set_source( "whatever.pod" ); - $parser->run; - -Or: - - my $parser = SomePodProcessor->new; - $parser->set_source( $some_filehandle_object ); - $parser->run; - -Or: - - my $parser = SomePodProcessor->new; - $parser->set_source( \$document_source ); - $parser->run; - -Or: - - my $parser = SomePodProcessor->new; - $parser->set_source( \@document_lines ); - $parser->run; - -And elsewhere: - - require 5; - package SomePodProcessor; - use strict; - use base qw(Pod::Simple::PullParser); - - sub run { - my $self = shift; - Token: - while(my $token = $self->get_token) { - ...process each token... - } - } - -=head1 DESCRIPTION - -This class is for using Pod::Simple to build a Pod processor -- but -one that uses an interface based on a stream of token objects, -instead of based on events. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -A subclass of Pod::Simple::PullParser should define a C<run> method -that calls C<< $token = $parser->get_token >> to pull tokens. - -See the source for Pod::Simple::RTF for an example of a formatter -that uses Pod::Simple::PullParser. - -=head1 METHODS - -=over - -=item my $token = $parser->get_token - -This returns the next token object (which will be of a subclass of -L<Pod::Simple::PullParserToken>), or undef if the parser-stream has hit -the end of the document. - -=item $parser->unget_token( $token ) - -=item $parser->unget_token( $token1, $token2, ... ) - -This restores the token object(s) to the front of the parser stream. - -=back - -The source has to be set before you can parse anything. The lowest-level -way is to call C<set_source>: - -=over - -=item $parser->set_source( $filename ) - -=item $parser->set_source( $filehandle_object ) - -=item $parser->set_source( \$document_source ) - -=item $parser->set_source( \@document_lines ) - -=back - -Or you can call these methods, which Pod::Simple::PullParser has defined -to work just like Pod::Simple's same-named methods: - -=over - -=item $parser->parse_file(...) - -=item $parser->parse_string_document(...) - -=item $parser->filter(...) - -=item $parser->parse_from_file(...) - -=back - -For those to work, the Pod-processing subclass of -Pod::Simple::PullParser has to have defined a $parser->run method -- -so it is advised that all Pod::Simple::PullParser subclasses do so. -See the Synopsis above, or the source for Pod::Simple::RTF. - -Authors of formatter subclasses might find these methods useful to -call on a parser object that you haven't started pulling tokens -from yet: - -=over - -=item my $title_string = $parser->get_title - -This tries to get the title string out of $parser, by getting some tokens, -and scanning them for the title, and then ungetting them so that you can -process the token-stream from the beginning. - -For example, suppose you have a document that starts out: - - =head1 NAME - - Hoo::Boy::Wowza -- Stuff B<wow> yeah! - -$parser->get_title on that document will return "Hoo::Boy::Wowza -- -Stuff wow yeah!". - -In cases where get_title can't find the title, it will return empty-string -(""). - -=item my $title_string = $parser->get_short_title - -This is just like get_title, except that it returns just the modulename, if -the title seems to be of the form "SomeModuleName -- description". - -For example, suppose you have a document that starts out: - - =head1 NAME - - Hoo::Boy::Wowza -- Stuff B<wow> yeah! - -then $parser->get_short_title on that document will return -"Hoo::Boy::Wowza". - -But if the document starts out: - - =head1 NAME - - Hooboy, stuff B<wow> yeah! - -then $parser->get_short_title on that document will return "Hooboy, -stuff wow yeah!". - -If the title can't be found, then get_short_title returns empty-string -(""). - -=item $author_name = $parser->get_author - -This works like get_title except that it returns the contents of the -"=head1 AUTHOR\n\nParagraph...\n" section, assuming that that section -isn't terribly long. - -(This method tolerates "AUTHORS" instead of "AUTHOR" too.) - -=item $description_name = $parser->get_description - -This works like get_title except that it returns the contents of the -"=head1 PARAGRAPH\n\nParagraph...\n" section, assuming that that section -isn't terribly long. - -=item $version_block = $parser->get_version - -This works like get_title except that it returns the contents of -the "=head1 VERSION\n\n[BIG BLOCK]\n" block. Note that this does NOT -return the module's C<$VERSION>!! - - -=back - -=head1 NOTE - -You don't actually I<have> to define a C<run> method. If you're -writing a Pod-formatter class, you should define a C<run> just so -that users can call C<parse_file> etc, but you don't I<have> to. - -And if you're not writing a formatter class, but are instead just -writing a program that does something simple with a Pod::PullParser -object (and not an object of a subclass), then there's no reason to -bother subclassing to add a C<run> method. - -=head1 SEE ALSO - -L<Pod::Simple> - -L<Pod::Simple::PullParserToken> -- and its subclasses -L<Pod::Simple::PullParserStartToken>, -L<Pod::Simple::PullParserTextToken>, and -L<Pod::Simple::PullParserEndToken>. - -L<HTML::TokeParser>, which inspired this. - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - - - -JUNK: - -sub _old_get_title { # some witchery in here - my $self = $_[0]; - my $title; - my @to_unget; - - while(1) { - push @to_unget, $self->get_token; - unless(defined $to_unget[-1]) { # whoops, short doc! - pop @to_unget; - last; - } - - DEBUG and print "-Got token ", $to_unget[-1]->dump, "\n"; - - (DEBUG and print "Too much in the buffer.\n"), - last if @to_unget > 25; # sanity - - my $pattern = ''; - if( #$to_unget[-1]->type eq 'end' - #and $to_unget[-1]->tagname eq 'Para' - #and - ($pattern = join('', - map {; - ($_->type eq 'start') ? ("<" . $_->tagname .">") - : ($_->type eq 'end' ) ? ("</". $_->tagname .">") - : ($_->type eq 'text' ) ? ($_->text =~ m<^([A-Z]+)$>s ? $1 : 'X') - : "BLORP" - } @to_unget - )) =~ m{<head1>NAME</head1><Para>(X|</?[BCIFLS]>)+</Para>$}s - ) { - # Whee, it fits the pattern - DEBUG and print "Seems to match =head1 NAME pattern.\n"; - $title = ''; - foreach my $t (reverse @to_unget) { - last if $t->type eq 'start' and $t->tagname eq 'Para'; - $title = $t->text . $title if $t->type eq 'text'; - } - undef $title if $title =~ m<^\s*$>; # make sure it's contentful! - last; - - } elsif ($pattern =~ m{<head(\d)>(.+)</head\d>$} - and !( $1 eq '1' and $2 eq 'NAME' ) - ) { - # Well, it fits a fallback pattern - DEBUG and print "Seems to match NAMEless pattern.\n"; - $title = ''; - foreach my $t (reverse @to_unget) { - last if $t->type eq 'start' and $t->tagname =~ m/^head\d$/s; - $title = $t->text . $title if $t->type eq 'text'; - } - undef $title if $title =~ m<^\s*$>; # make sure it's contentful! - last; - - } else { - DEBUG and $pattern and print "Leading pattern: $pattern\n"; - } - } - - # Put it all back: - $self->unget_token(@to_unget); - - if(DEBUG) { - if(defined $title) { print " Returing title <$title>\n" } - else { print "Returning title <>\n" } - } - - return '' unless defined $title; - return $title; -} - diff --git a/web/bin/lib/Pod/Simple/PullParserEndToken.pm b/web/bin/lib/Pod/Simple/PullParserEndToken.pm deleted file mode 100644 index 7b219f8..0000000 --- a/web/bin/lib/Pod/Simple/PullParserEndToken.pm +++ /dev/null @@ -1,93 +0,0 @@ - -require 5; -package Pod::Simple::PullParserEndToken; -use Pod::Simple::PullParserToken (); -@ISA = ('Pod::Simple::PullParserToken'); -use strict; - -sub new { # Class->new(tagname); - my $class = shift; - return bless ['end', @_], ref($class) || $class; -} - -# Purely accessors: - -sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] } -sub tag { shift->tagname(@_) } - -# shortcut: -sub is_tagname { $_[0][1] eq $_[1] } -sub is_tag { shift->is_tagname(@_) } - -1; - - -__END__ - -=head1 NAME - -Pod::Simple::PullParserEndToken -- end-tokens from Pod::Simple::PullParser - -=head1 SYNOPSIS - -(See L<Pod::Simple::PullParser>) - -=head1 DESCRIPTION - -When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might -get an object of this class. - -This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods, -and adds these methods: - -=over - -=item $token->tagname - -This returns the tagname for this end-token object. -For example, parsing a "=head1 ..." line will give you -a start-token with the tagname of "head1", token(s) for its -content, and then an end-token with the tagname of "head1". - -=item $token->tagname(I<somestring>) - -This changes the tagname for this end-token object. -You probably won't need to do this. - -=item $token->tag(...) - -A shortcut for $token->tagname(...) - -=item $token->is_tag(I<somestring>) or $token->is_tagname(I<somestring>) - -These are shortcuts for C<< $token->tag() eq I<somestring> >> - -=back - -You're unlikely to ever need to construct an object of this class for -yourself, but if you want to, call -C<< -Pod::Simple::PullParserEndToken->new( I<tagname> ) ->> - -=head1 SEE ALSO - -L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/PullParserStartToken.pm b/web/bin/lib/Pod/Simple/PullParserStartToken.pm deleted file mode 100644 index 9ead50d..0000000 --- a/web/bin/lib/Pod/Simple/PullParserStartToken.pm +++ /dev/null @@ -1,130 +0,0 @@ - -require 5; -package Pod::Simple::PullParserStartToken; -use Pod::Simple::PullParserToken (); -@ISA = ('Pod::Simple::PullParserToken'); -use strict; - -sub new { # Class->new(tagname, optional_attrhash); - my $class = shift; - return bless ['start', @_], ref($class) || $class; -} - -# Purely accessors: - -sub tagname { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] } -sub tag { shift->tagname(@_) } - -sub is_tagname { $_[0][1] eq $_[1] } -sub is_tag { shift->is_tagname(@_) } - - -sub attr_hash { $_[0][2] ||= {} } - -sub attr { - if(@_ == 2) { # Reading: $token->attr('attrname') - ${$_[0][2] || return undef}{ $_[1] }; - } elsif(@_ > 2) { # Writing: $token->attr('attrname', 'newval') - ${$_[0][2] ||= {}}{ $_[1] } = $_[2]; - } else { - require Carp; - Carp::croak( - 'usage: $object->attr("val") or $object->attr("key", "newval")'); - return undef; - } -} - -1; - - -__END__ - -=head1 NAME - -Pod::Simple::PullParserStartToken -- start-tokens from Pod::Simple::PullParser - -=head1 SYNOPSIS - -(See L<Pod::Simple::PullParser>) - -=head1 DESCRIPTION - -When you do $parser->get_token on a L<Pod::Simple::PullParser> object, you might -get an object of this class. - -This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods, -and adds these methods: - -=over - -=item $token->tagname - -This returns the tagname for this start-token object. -For example, parsing a "=head1 ..." line will give you -a start-token with the tagname of "head1", token(s) for its -content, and then an end-token with the tagname of "head1". - -=item $token->tagname(I<somestring>) - -This changes the tagname for this start-token object. -You probably won't need -to do this. - -=item $token->tag(...) - -A shortcut for $token->tagname(...) - -=item $token->is_tag(I<somestring>) or $token->is_tagname(I<somestring>) - -These are shortcuts for C<< $token->tag() eq I<somestring> >> - -=item $token->attr(I<attrname>) - -This returns the value of the I<attrname> attribute for this start-token -object, or undef. - -For example, parsing a LZ<><Foo/"Bar"> link will produce a start-token -with a "to" attribute with the value "Foo", a "type" attribute with the -value "pod", and a "section" attribute with the value "Bar". - -=item $token->attr(I<attrname>, I<newvalue>) - -This sets the I<attrname> attribute for this start-token object to -I<newvalue>. You probably won't need to do this. - -=item $token->attr_hash - -This returns the hashref that is the attribute set for this start-token. -This is useful if (for example) you want to ask what all the attributes -are -- you can just do C<< keys %{$token->attr_hash} >> - -=back - - -You're unlikely to ever need to construct an object of this class for -yourself, but if you want to, call -C<< -Pod::Simple::PullParserStartToken->new( I<tagname>, I<attrhash> ) ->> - -=head1 SEE ALSO - -L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/PullParserTextToken.pm b/web/bin/lib/Pod/Simple/PullParserTextToken.pm deleted file mode 100644 index 2d1a1d7..0000000 --- a/web/bin/lib/Pod/Simple/PullParserTextToken.pm +++ /dev/null @@ -1,101 +0,0 @@ - -require 5; -package Pod::Simple::PullParserTextToken; -use Pod::Simple::PullParserToken (); -@ISA = ('Pod::Simple::PullParserToken'); -use strict; - -sub new { # Class->new(text); - my $class = shift; - return bless ['text', @_], ref($class) || $class; -} - -# Purely accessors: - -sub text { (@_ == 2) ? ($_[0][1] = $_[1]) : $_[0][1] } - -sub text_r { \ $_[0][1] } - -1; - -__END__ - -=head1 NAME - -Pod::Simple::PullParserTextToken -- text-tokens from Pod::Simple::PullParser - -=head1 SYNOPSIS - -(See L<Pod::Simple::PullParser>) - -=head1 DESCRIPTION - -When you do $parser->get_token on a L<Pod::Simple::PullParser>, you might -get an object of this class. - -This is a subclass of L<Pod::Simple::PullParserToken> and inherits all its methods, -and adds these methods: - -=over - -=item $token->text - -This returns the text that this token holds. For example, parsing -CZ<><foo> will return a C start-token, a text-token, and a C end-token. And -if you want to get the "foo" out of the text-token, call C<< $token->text >> - -=item $token->text(I<somestring>) - -This changes the string that this token holds. You probably won't need -to do this. - -=item $token->text_r() - -This returns a scalar reference to the string that this token holds. -This can be useful if you don't want to memory-copy the potentially -large text value (well, as large as a paragraph or a verbatim block) -as calling $token->text would do. - -Or, if you want to alter the value, you can even do things like this: - - for ( ${ $token->text_r } ) { # Aliases it with $_ !! - - s/ The / the /g; # just for example - - if( 'A' eq chr(65) ) { # (if in an ASCII world) - tr/\xA0/ /; - tr/\xAD//d; - } - - ...or however you want to alter the value... - } - -=back - -You're unlikely to ever need to construct an object of this class for -yourself, but if you want to, call -C<< -Pod::Simple::PullParserTextToken->new( I<text> ) ->> - -=head1 SEE ALSO - -L<Pod::Simple::PullParserToken>, L<Pod::Simple>, L<Pod::Simple::Subclassing> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/PullParserToken.pm b/web/bin/lib/Pod/Simple/PullParserToken.pm deleted file mode 100644 index 9ec3659..0000000 --- a/web/bin/lib/Pod/Simple/PullParserToken.pm +++ /dev/null @@ -1,138 +0,0 @@ - -require 5; -package Pod::Simple::PullParserToken; - # Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token -@ISA = (); -$VERSION = '2.02'; -use strict; - -sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway - my $class = shift; - return bless [@_], ref($class) || $class; -} - -sub type { $_[0][0] } # Can't change the type of an object -sub dump { Pod::Simple::pretty( [ @{ $_[0] } ] ) } - -sub is_start { $_[0][0] eq 'start' } -sub is_end { $_[0][0] eq 'end' } -sub is_text { $_[0][0] eq 'text' } - -1; -__END__ - -sub dump { '[' . _esc( @{ $_[0] } ) . ']' } - -# JUNK: - -sub _esc { - return '' unless @_; - my @out; - foreach my $in (@_) { - push @out, '"' . $in . '"'; - $out[-1] =~ s/([^- \:\:\.\,\'\>\<\"\/\=\?\+\|\[\]\{\}\_a-zA-Z0-9_\`\~\!\#\%\^\&\*\(\)])/ - sprintf( (ord($1) < 256) ? "\\x%02X" : "\\x{%X}", ord($1)) - /eg; - } - return join ', ', @out; -} - - -__END__ - -=head1 NAME - -Pod::Simple::PullParserToken -- tokens from Pod::Simple::PullParser - -=head1 SYNOPSIS - -Given a $parser that's an object of class Pod::Simple::PullParser -(or a subclass)... - - while(my $token = $parser->get_token) { - $DEBUG and print "Token: ", $token->dump, "\n"; - if($token->is_start) { - ...access $token->tagname, $token->attr, etc... - - } elsif($token->is_text) { - ...access $token->text, $token->text_r, etc... - - } elsif($token->is_end) { - ...access $token->tagname... - - } - } - -(Also see L<Pod::Simple::PullParser>) - -=head1 DESCRIPTION - -When you do $parser->get_token on a L<Pod::Simple::PullParser>, you should -get an object of a subclass of Pod::Simple::PullParserToken. - -Subclasses will add methods, and will also inherit these methods: - -=over - -=item $token->type - -This returns the type of the token. This will be either the string -"start", the string "text", or the string "end". - -Once you know what the type of an object is, you then know what -subclass it belongs to, and therefore what methods it supports. - -Yes, you could probably do the same thing with code like -$token->isa('Pod::Simple::PullParserEndToken'), but that's not so -pretty as using just $token->type, or even the following shortcuts: - -=item $token->is_start - -This is a shortcut for C<< $token->type() eq "start" >> - -=item $token->is_text - -This is a shortcut for C<< $token->type() eq "text" >> - -=item $token->is_end - -This is a shortcut for C<< $token->type() eq "end" >> - -=item $token->dump - -This returns a handy stringified value of this object. This -is useful for debugging, as in: - - while(my $token = $parser->get_token) { - $DEBUG and print "Token: ", $token->dump, "\n"; - ... - } - -=back - -=head1 SEE ALSO - -My subclasses: -L<Pod::Simple::PullParserStartToken>, -L<Pod::Simple::PullParserTextToken>, and -L<Pod::Simple::PullParserEndToken>. - -L<Pod::Simple::PullParser> and L<Pod::Simple> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/RTF.pm b/web/bin/lib/Pod/Simple/RTF.pm deleted file mode 100644 index de2a7b3..0000000 --- a/web/bin/lib/Pod/Simple/RTF.pm +++ /dev/null @@ -1,674 +0,0 @@ - -require 5; -package Pod::Simple::RTF; - -#sub DEBUG () {4}; -#sub Pod::Simple::DEBUG () {4}; -#sub Pod::Simple::PullParser::DEBUG () {4}; - -use strict; -use vars qw($VERSION @ISA %Escape $WRAP %Tagmap); -$VERSION = '2.02'; -use Pod::Simple::PullParser (); -BEGIN {@ISA = ('Pod::Simple::PullParser')} - -use Carp (); -BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG } - -$WRAP = 1 unless defined $WRAP; - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub _openclose { - return map {; - m/^([-A-Za-z]+)=(\w[^\=]*)$/s or die "what's <$_>?"; - ( $1, "{\\$2\n", "/$1", "}" ); - } @_; -} - -my @_to_accept; - -%Tagmap = ( - # 'foo=bar' means ('foo' => '{\bar'."\n", '/foo' => '}') - _openclose( - 'B=cs18\b', - 'I=cs16\i', - 'C=cs19\f1\lang1024\noproof', - 'F=cs17\i\lang1024\noproof', - - 'VerbatimI=cs26\i', - 'VerbatimB=cs27\b', - 'VerbatimBI=cs28\b\i', - - map {; m/^([-a-z]+)/s && push @_to_accept, $1; $_ } - qw[ - underline=ul smallcaps=scaps shadow=shad - superscript=super subscript=sub strikethrough=strike - outline=outl emboss=embo engrave=impr - dotted-underline=uld dash-underline=uldash - dot-dash-underline=uldashd dot-dot-dash-underline=uldashdd - double-underline=uldb thick-underline=ulth - word-underline=ulw wave-underline=ulwave - ] - # But no double-strikethrough, because MSWord can't agree with the - # RTF spec on whether it's supposed to be \strikedl or \striked1 (!!!) - ), - - # Bit of a hack here: - 'L=pod' => '{\cs22\i'."\n", - 'L=url' => '{\cs23\i'."\n", - 'L=man' => '{\cs24\i'."\n", - '/L' => '}', - - 'Data' => "\n", - '/Data' => "\n", - - 'Verbatim' => "\n{\\pard\\li#rtfindent##rtfkeep#\\plain\\s20\\sa180\\f1\\fs18\\lang1024\\noproof\n", - '/Verbatim' => "\n\\par}\n", - 'VerbatimFormatted' => "\n{\\pard\\li#rtfindent##rtfkeep#\\plain\\s20\\sa180\\f1\\fs18\\lang1024\\noproof\n", - '/VerbatimFormatted' => "\n\\par}\n", - 'Para' => "\n{\\pard\\li#rtfindent#\\sa180\n", - '/Para' => "\n\\par}\n", - 'head1' => "\n{\\pard\\li#rtfindent#\\s31\\keepn\\sb90\\sa180\\f2\\fs#head1_halfpoint_size#\\ul{\n", - '/head1' => "\n}\\par}\n", - 'head2' => "\n{\\pard\\li#rtfindent#\\s32\\keepn\\sb90\\sa180\\f2\\fs#head2_halfpoint_size#\\ul{\n", - '/head2' => "\n}\\par}\n", - 'head3' => "\n{\\pard\\li#rtfindent#\\s33\\keepn\\sb90\\sa180\\f2\\fs#head3_halfpoint_size#\\ul{\n", - '/head3' => "\n}\\par}\n", - 'head4' => "\n{\\pard\\li#rtfindent#\\s34\\keepn\\sb90\\sa180\\f2\\fs#head4_halfpoint_size#\\ul{\n", - '/head4' => "\n}\\par}\n", - # wordpad borks on \tc\tcl1, or I'd put that in =head1 and =head2 - - 'item-bullet' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n", - '/item-bullet' => "\n\\par}\n", - 'item-number' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n", - '/item-number' => "\n\\par}\n", - 'item-text' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n", - '/item-text' => "\n\\par}\n", - - # we don't need any styles for over-* and /over-* -); - - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sub new { - my $new = shift->SUPER::new(@_); - $new->nix_X_codes(1); - $new->nbsp_for_S(1); - $new->accept_targets( 'rtf', 'RTF' ); - - $new->{'Tagmap'} = {%Tagmap}; - - $new->accept_codes(@_to_accept); - $new->accept_codes('VerbatimFormatted'); - DEBUG > 2 and print "To accept: ", join(' ',@_to_accept), "\n"; - $new->doc_lang( - ( $ENV{'RTFDEFLANG'} || '') =~ m/^(\d{1,10})$/s ? $1 - : ($ENV{'RTFDEFLANG'} || '') =~ m/^0?x([a-fA-F0-9]{1,10})$/s ? hex($1) - # yes, tolerate hex! - : ($ENV{'RTFDEFLANG'} || '') =~ m/^([a-fA-F0-9]{4})$/s ? hex($1) - # yes, tolerate even more hex! - : '1033' - ); - - $new->head1_halfpoint_size(32); - $new->head2_halfpoint_size(28); - $new->head3_halfpoint_size(25); - $new->head4_halfpoint_size(22); - $new->codeblock_halfpoint_size(18); - $new->header_halfpoint_size(17); - $new->normal_halfpoint_size(25); - - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -__PACKAGE__->_accessorize( - 'doc_lang', - 'head1_halfpoint_size', - 'head2_halfpoint_size', - 'head3_halfpoint_size', - 'head4_halfpoint_size', - 'codeblock_halfpoint_size', - 'header_halfpoint_size', - 'normal_halfpoint_size', - 'no_proofing_exemptions', -); - - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sub run { - my $self = $_[0]; - return $self->do_middle if $self->bare_output; - return - $self->do_beginning && $self->do_middle && $self->do_end; -} - - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub do_middle { # the main work - my $self = $_[0]; - my $fh = $self->{'output_fh'}; - - my($token, $type, $tagname, $scratch); - my @stack; - my @indent_stack; - $self->{'rtfindent'} = 0 unless defined $self->{'rtfindent'}; - - while($token = $self->get_token) { - - if( ($type = $token->type) eq 'text' ) { - if( $self->{'rtfverbatim'} ) { - DEBUG > 1 and print " $type " , $token->text, " in verbatim!\n"; - rtf_esc_codely($scratch = $token->text); - print $fh $scratch; - next; - } - - DEBUG > 1 and print " $type " , $token->text, "\n"; - - $scratch = $token->text; - $scratch =~ tr/\t\cb\cc/ /d; - - $self->{'no_proofing_exemptions'} or $scratch =~ - s/(?: - ^ - | - (?<=[\cm\cj\t "\[\<\(]) - ) # start on whitespace, sequence-start, or quote - ( # something looking like a Perl token: - (?: - [\$\@\:\<\*\\_]\S+ # either starting with a sigil, etc. - ) - | - # or starting alpha, but containing anything strange: - (?: - [a-zA-Z'\x80-\xFF]+[\$\@\:_<>\(\\\*]\S+ - ) - ) - /\cb$1\cc/xsg - ; - - rtf_esc($scratch); - $scratch =~ - s/( - [^\cm\cj\n]{65} # Snare 65 characters from a line - [^\cm\cj\n\x20]{0,50} # and finish any current word - ) - (\x20{1,10})(?![\cm\cj\n]) # capture some spaces not at line-end - /$1$2\n/gx # and put a NL before those spaces - if $WRAP; - # This may wrap at well past the 65th column, but not past the 120th. - - print $fh $scratch; - - } elsif( $type eq 'start' ) { - DEBUG > 1 and print " +$type ",$token->tagname, - " (", map("<$_> ", %{$token->attr_hash}), ")\n"; - - if( ($tagname = $token->tagname) eq 'Verbatim' - or $tagname eq 'VerbatimFormatted' - ) { - ++$self->{'rtfverbatim'}; - my $next = $self->get_token; - next unless defined $next; - my $line_count = 1; - if($next->type eq 'text') { - my $t = $next->text_r; - while( $$t =~ m/$/mg ) { - last if ++$line_count > 15; # no point in counting further - } - DEBUG > 3 and print " verbatim line count: $line_count\n"; - } - $self->unget_token($next); - $self->{'rtfkeep'} = ($line_count > 15) ? '' : '\keepn' ; - - } elsif( $tagname =~ m/^item-/s ) { - my @to_unget; - my $text_count_here = 0; - $self->{'rtfitemkeepn'} = ''; - # Some heuristics to stop item-*'s functioning as subheadings - # from getting split from the things they're subheadings for. - # - # It's not terribly pretty, but it really does make things pretty. - # - while(1) { - push @to_unget, $self->get_token; - pop(@to_unget), last unless defined $to_unget[-1]; - # Erroneously used to be "unshift" instead of pop! Adds instead - # of removes, and operates on the beginning instead of the end! - - if($to_unget[-1]->type eq 'text') { - if( ($text_count_here += length ${$to_unget[-1]->text_r}) > 150 ){ - DEBUG > 1 and print " item-* is too long to be keepn'd.\n"; - last; - } - } elsif (@to_unget > 1 and - $to_unget[-2]->type eq 'end' and - $to_unget[-2]->tagname =~ m/^item-/s - ) { - # Bail out here, after setting rtfitemkeepn yea or nay. - $self->{'rtfitemkeepn'} = '\keepn' if - $to_unget[-1]->type eq 'start' and - $to_unget[-1]->tagname eq 'Para'; - - DEBUG > 1 and printf " item-* before %s(%s) %s keepn'd.\n", - $to_unget[-1]->type, - $to_unget[-1]->can('tagname') ? $to_unget[-1]->tagname : '', - $self->{'rtfitemkeepn'} ? "gets" : "doesn't get"; - last; - } elsif (@to_unget > 40) { - DEBUG > 1 and print " item-* now has too many tokens (", - scalar(@to_unget), - (DEBUG > 4) ? (q<: >, map($_->dump, @to_unget)) : (), - ") to be keepn'd.\n"; - last; # give up - } - # else keep while'ing along - } - # Now put it aaaaall back... - $self->unget_token(@to_unget); - - } elsif( $tagname =~ m/^over-/s ) { - push @stack, $1; - push @indent_stack, - int($token->attr('indent') * 4 * $self->normal_halfpoint_size); - DEBUG and print "Indenting over $indent_stack[-1] twips.\n"; - $self->{'rtfindent'} += $indent_stack[-1]; - - } elsif ($tagname eq 'L') { - $tagname .= '=' . ($token->attr('type') || 'pod'); - - } elsif ($tagname eq 'Data') { - my $next = $self->get_token; - next unless defined $next; - unless( $next->type eq 'text' ) { - $self->unget_token($next); - next; - } - DEBUG and print " raw text ", $next->text, "\n"; - printf $fh "\n" . $next->text . "\n"; - next; - } - - defined($scratch = $self->{'Tagmap'}{$tagname}) or next; - $scratch =~ s/\#([^\#]+)\#/${$self}{$1}/g; # interpolate - print $fh $scratch; - - if ($tagname eq 'item-number') { - print $fh $token->attr('number'), ". \n"; - } elsif ($tagname eq 'item-bullet') { - print $fh "\\'95 \n"; - #for funky testing: print $fh '', rtf_esc("\x{4E4B}\x{9053}"); - } - - } elsif( $type eq 'end' ) { - DEBUG > 1 and print " -$type ",$token->tagname,"\n"; - if( ($tagname = $token->tagname) =~ m/^over-/s ) { - DEBUG and print "Indenting back $indent_stack[-1] twips.\n"; - $self->{'rtfindent'} -= pop @indent_stack; - pop @stack; - } elsif( $tagname eq 'Verbatim' or $tagname eq 'VerbatimFormatted') { - --$self->{'rtfverbatim'}; - } - defined($scratch = $self->{'Tagmap'}{"/$tagname"}) or next; - $scratch =~ s/\#([^\#]+)\#/${$self}{$1}/g; # interpolate - print $fh $scratch; - } - } - return 1; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sub do_beginning { - my $self = $_[0]; - my $fh = $self->{'output_fh'}; - return print $fh join '', - $self->doc_init, - $self->font_table, - $self->stylesheet, - $self->color_table, - $self->doc_info, - $self->doc_start, - "\n" - ; -} - -sub do_end { - my $self = $_[0]; - my $fh = $self->{'output_fh'}; - return print $fh '}'; # that should do it -} - -########################################################################### - -sub stylesheet { - return sprintf <<'END', -{\stylesheet -{\snext0 Normal;} -{\*\cs10 \additive Default Paragraph Font;} -{\*\cs16 \additive \i \sbasedon10 pod-I;} -{\*\cs17 \additive \i\lang1024\noproof \sbasedon10 pod-F;} -{\*\cs18 \additive \b \sbasedon10 pod-B;} -{\*\cs19 \additive \f1\lang1024\noproof\sbasedon10 pod-C;} -{\s20\ql \li0\ri0\sa180\widctlpar\f1\fs%s\lang1024\noproof\sbasedon0 \snext0 pod-codeblock;} -{\*\cs21 \additive \lang1024\noproof \sbasedon10 pod-computerese;} -{\*\cs22 \additive \i\lang1024\noproof\sbasedon10 pod-L-pod;} -{\*\cs23 \additive \i\lang1024\noproof\sbasedon10 pod-L-url;} -{\*\cs24 \additive \i\lang1024\noproof\sbasedon10 pod-L-man;} - -{\*\cs25 \additive \f1\lang1024\noproof\sbasedon0 pod-codelbock-plain;} -{\*\cs26 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-ital;} -{\*\cs27 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-bold;} -{\*\cs28 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-bold-ital;} - -{\s31\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head1;} -{\s32\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head2;} -{\s33\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head3;} -{\s34\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head4;} -} - -END - - $_[0]->codeblock_halfpoint_size(), - $_[0]->head1_halfpoint_size(), - $_[0]->head2_halfpoint_size(), - $_[0]->head3_halfpoint_size(), - $_[0]->head4_halfpoint_size(), - ; -} - -########################################################################### -# Override these as necessary for further customization - -sub font_table { - return <<'END'; # text font, code font, heading font -{\fonttbl -{\f0\froman Times New Roman;} -{\f1\fmodern Courier New;} -{\f2\fswiss Arial;} -} - -END -} - -sub doc_init { - return <<'END'; -{\rtf1\ansi\deff0 - -END -} - -sub color_table { - return <<'END'; -{\colortbl;\red255\green0\blue0;\red0\green0\blue255;} -END -} - - -sub doc_info { - my $self = $_[0]; - - my $class = ref($self) || $self; - - my $tag = __PACKAGE__ . ' ' . $VERSION; - - unless($class eq __PACKAGE__) { - $tag = " ($tag)"; - $tag = " v" . $self->VERSION . $tag if defined $self->VERSION; - $tag = $class . $tag; - } - - return sprintf <<'END', -{\info{\doccomm -%s - using %s v%s - under Perl v%s at %s GMT} -{\author [see doc]}{\company [see doc]}{\operator [see doc]} -} - -END - - # None of the following things should need escaping, I dare say! - $tag, - $ISA[0], $ISA[0]->VERSION(), - $], scalar(gmtime), - ; -} - -sub doc_start { - my $self = $_[0]; - my $title = $self->get_short_title(); - DEBUG and print "Short Title: <$title>\n"; - $title .= ' ' if length $title; - - $title =~ s/ *$/ /s; - $title =~ s/^ //s; - $title =~ s/ $/, /s; - # make sure it ends in a comma and a space, unless it's 0-length - - my $is_obviously_module_name; - $is_obviously_module_name = 1 - if $title =~ m/^\S+$/s and $title =~ m/::/s; - # catches the most common case, at least - - DEBUG and print "Title0: <$title>\n"; - $title = rtf_esc($title); - DEBUG and print "Title1: <$title>\n"; - $title = '\lang1024\noproof ' . $title - if $is_obviously_module_name; - - return sprintf <<'END', -\deflang%s\plain\lang%s\widowctrl -{\header\pard\qr\plain\f2\fs%s -%s -p.\chpgn\par} -\fs%s - -END - ($self->doc_lang) x 2, - $self->header_halfpoint_size, - $title, - $self->normal_halfpoint_size, - ; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#------------------------------------------------------------------------- - -use integer; -sub rtf_esc { - my $x; # scratch - if(!defined wantarray) { # void context: alter in-place! - for(@_) { - s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - } - return; - } elsif(wantarray) { # return an array - return map {; ($x = $_) =~ - s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - $x; - } @_; - } else { # return a single scalar - ($x = ((@_ == 1) ? $_[0] : join '', @_) - ) =~ s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - # Escape \, {, }, -, control chars, and 7f-ff. - $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - return $x; - } -} - -sub rtf_esc_codely { - # Doesn't change "-" to hard-hyphen, nor apply computerese style-smarts. - # We don't want to change the "-" to hard-hyphen, because we want to - # be able to paste this into a file and run it without there being - # dire screaming about the mysterious hard-hyphen character (which - # looks just like a normal dash character). - - my $x; # scratch - if(!defined wantarray) { # void context: alter in-place! - for(@_) { - s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - } - return; - } elsif(wantarray) { # return an array - return map {; ($x = $_) =~ - s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - $x; - } @_; - } else { # return a single scalar - ($x = ((@_ == 1) ? $_[0] : join '', @_) - ) =~ s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER - # Escape \, {, }, -, control chars, and 7f-ff. - $x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg; - return $x; - } -} - -%Escape = ( - map( (chr($_),chr($_)), # things not apparently needing escaping - 0x20 .. 0x7E ), - map( (chr($_),sprintf("\\'%02x", $_)), # apparently escapeworthy things - 0x00 .. 0x1F, 0x5c, 0x7b, 0x7d, 0x7f .. 0xFF, 0x46), - - # We get to escape out 'F' so that we can send RTF files thru the mail - # without the slightest worry that paragraphs beginning with "From" - # will get munged. - - # And some refinements: - "\cm" => "\n", - "\cj" => "\n", - "\n" => "\n\\line ", - - "\t" => "\\tab ", # Tabs (altho theoretically raw \t's are okay) - "\f" => "\n\\page\n", # Formfeed - "-" => "\\_", # Turn plaintext '-' into a non-breaking hyphen - "\xA0" => "\\~", # Latin-1 non-breaking space - "\xAD" => "\\-", # Latin-1 soft (optional) hyphen - - # CRAZY HACKS: - "\n" => "\\line\n", - "\r" => "\n", - "\cb" => "{\n\\cs21\\lang1024\\noproof ", # \\cf1 - "\cc" => "}", -); -1; - -__END__ - -=head1 NAME - -Pod::Simple::RTF -- format Pod as RTF - -=head1 SYNOPSIS - - perl -MPod::Simple::RTF -e \ - "exit Pod::Simple::RTF->filter(shift)->any_errata_seen" \ - thingy.pod > thingy.rtf - -=head1 DESCRIPTION - -This class is a formatter that takes Pod and renders it as RTF, good for -viewing/printing in MSWord, WordPad/write.exe, TextEdit, etc. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -=head1 FORMAT CONTROL ATTRIBUTES - -You can set these attributes on the parser object before you -call C<parse_file> (or a similar method) on it: - -=over - -=item $parser->head1_halfpoint_size( I<halfpoint_integer> ); - -=item $parser->head2_halfpoint_size( I<halfpoint_integer> ); - -=item $parser->head3_halfpoint_size( I<halfpoint_integer> ); - -=item $parser->head4_halfpoint_size( I<halfpoint_integer> ); - -These methods set the size (in half-points, like 52 for 26-point) -that these heading levels will appear as. - -=item $parser->codeblock_halfpoint_size( I<halfpoint_integer> ); - -This method sets the size (in half-points, like 21 for 10.5-point) -that codeblocks ("verbatim sections") will appear as. - -=item $parser->header_halfpoint_size( I<halfpoint_integer> ); - -This method sets the size (in half-points, like 15 for 7.5-point) -that the header on each page will appear in. The header -is usually just "I<modulename> p. I<pagenumber>". - -=item $parser->normal_halfpoint_size( I<halfpoint_integer> ); - -This method sets the size (in half-points, like 26 for 13-point) -that normal paragraphic text will appear in. - -=item $parser->no_proofing_exemptions( I<true_or_false> ); - -Set this value to true if you don't want the formatter to try -putting a hidden code on all Perl symbols (as best as it can -notice them) that labels them as being not in English, and -so not worth spellchecking. - -=item $parser->doc_lang( I<microsoft_decimal_language_code> ) - -This sets the language code to tag this document as being in. By -default, it is currently the value of the environment variable -C<RTFDEFLANG>, or if that's not set, then the value -1033 (for US English). - -Setting this appropriately is useful if you want to use the RTF -to spellcheck, and/or if you want it to hyphenate right. - -Here are some notable values: - - 1033 US English - 2057 UK English - 3081 Australia English - 4105 Canada English - 1034 Spain Spanish - 2058 Mexico Spanish - 1031 Germany German - 1036 France French - 3084 Canada French - 1035 Finnish - 1044 Norwegian (Bokmal) - 2068 Norwegian (Nynorsk) - -=back - -If you are particularly interested in customizing this module's output -even more, see the source and/or write to me. - -=head1 SEE ALSO - -L<Pod::Simple>, L<RTF::Writer>, L<RTF::Cookbook>, L<RTF::Document>, -L<RTF::Generator> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/Search.pm b/web/bin/lib/Pod/Simple/Search.pm deleted file mode 100644 index 980b3b7..0000000 --- a/web/bin/lib/Pod/Simple/Search.pm +++ /dev/null @@ -1,1016 +0,0 @@ - -require 5.005; -package Pod::Simple::Search; -use strict; - -use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY); -$VERSION = 3.04; ## Current version of this package - -BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level -use Carp (); - -$SLEEPY = 1 if !defined $SLEEPY and $^O =~ /mswin|mac/i; - # flag to occasionally sleep for $SLEEPY - 1 seconds. - -$MAX_VERSION_WITHIN ||= 60; - -############################################################################# - -#use diagnostics; -use File::Spec (); -use File::Basename qw( basename ); -use Config (); -use Cwd qw( cwd ); - -#========================================================================== -__PACKAGE__->_accessorize( # Make my dumb accessor methods - 'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob', - 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', -); -#========================================================================== - -sub new { - my $class = shift; - my $self = bless {}, ref($class) || $class; - $self->init; - return $self; -} - -sub init { - my $self = shift; - $self->inc(1); - $self->verbose(DEBUG); - return $self; -} - -#-------------------------------------------------------------------------- - -sub survey { - my($self, @search_dirs) = @_; - $self = $self->new unless ref $self; # tolerate being a class method - - $self->_expand_inc( \@search_dirs ); - - - $self->{'_scan_count'} = 0; - $self->{'_dirs_visited'} = {}; - $self->path2name( {} ); - $self->name2path( {} ); - $self->limit_re( $self->_limit_glob_to_limit_re ) if $self->{'limit_glob'}; - my $cwd = cwd(); - my $verbose = $self->verbose; - local $_; # don't clobber the caller's $_ ! - - foreach my $try (@search_dirs) { - unless( File::Spec->file_name_is_absolute($try) ) { - # make path absolute - $try = File::Spec->catfile( $cwd ,$try); - } - # simplify path - $try = File::Spec->canonpath($try); - - my $start_in; - my $modname_prefix; - if($self->{'dir_prefix'}) { - $start_in = File::Spec->catdir( - $try, - grep length($_), split '[\\/:]+', $self->{'dir_prefix'} - ); - $modname_prefix = [grep length($_), split m{[:/\\]}, $self->{'dir_prefix'}]; - $verbose and print "Appending \"$self->{'dir_prefix'}\" to $try, ", - "giving $start_in (= @$modname_prefix)\n"; - } else { - $start_in = $try; - } - - if( $self->{'_dirs_visited'}{$start_in} ) { - $verbose and print "Directory '$start_in' already seen, skipping.\n"; - next; - } else { - $self->{'_dirs_visited'}{$start_in} = 1; - } - - unless(-e $start_in) { - $verbose and print "Skipping non-existent $start_in\n"; - next; - } - - my $closure = $self->_make_search_callback; - - if(-d $start_in) { - # Normal case: - $verbose and print "Beginning excursion under $start_in\n"; - $self->_recurse_dir( $start_in, $closure, $modname_prefix ); - $verbose and print "Back from excursion under $start_in\n\n"; - - } elsif(-f _) { - # A excursion consisting of just one file! - $_ = basename($start_in); - $verbose and print "Pondering $start_in ($_)\n"; - $closure->($start_in, $_, 0, []); - - } else { - $verbose and print "Skipping mysterious $start_in\n"; - } - } - $self->progress and $self->progress->done( - "Noted $$self{'_scan_count'} Pod files total"); - - return unless defined wantarray; # void - return $self->name2path unless wantarray; # scalar - return $self->name2path, $self->path2name; # list -} - - -#========================================================================== -sub _make_search_callback { - my $self = $_[0]; - - # Put the options in variables, for easy access - my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,$path2name,$name2path) = - map scalar($self->$_()), - qw(laborious verbose shadows limit_re callback progress path2name name2path); - - my($file, $shortname, $isdir, $modname_bits); - return sub { - ($file, $shortname, $isdir, $modname_bits) = @_; - - if($isdir) { # this never gets called on the startdir itself, just subdirs - - if( $self->{'_dirs_visited'}{$file} ) { - $verbose and print "Directory '$file' already seen, skipping.\n"; - return 'PRUNE'; - } - - print "Looking in dir $file\n" if $verbose; - - unless ($laborious) { # $laborious overrides pruning - if( m/^(\d+\.[\d_]{3,})\z/s - and do { my $x = $1; $x =~ tr/_//d; $x != $] } - ) { - $verbose and print "Perl $] version mismatch on $_, skipping.\n"; - return 'PRUNE'; - } - - if( m/^([A-Za-z][a-zA-Z0-9_]*)\z/s ) { - $verbose and print "$_ is a well-named module subdir. Looking....\n"; - } else { - $verbose and print "$_ is a fishy directory name. Skipping.\n"; - return 'PRUNE'; - } - } # end unless $laborious - - $self->{'_dirs_visited'}{$file} = 1; - return; # (not pruning); - } - - - # Make sure it's a file even worth even considering - if($laborious) { - unless( - m/\.(pod|pm|plx?)\z/i || -x _ and -T _ - # Note that the cheapest operation (the RE) is run first. - ) { - $verbose > 1 and print " Brushing off uninteresting $file\n"; - return; - } - } else { - unless( m/^[-_a-zA-Z0-9]+\.(?:pod|pm|plx?)\z/is ) { - $verbose > 1 and print " Brushing off oddly-named $file\n"; - return; - } - } - - $verbose and print "Considering item $file\n"; - my $name = $self->_path2modname( $file, $shortname, $modname_bits ); - $verbose > 0.01 and print " Nominating $file as $name\n"; - - if($limit_re and $name !~ m/$limit_re/i) { - $verbose and print "Shunning $name as not matching $limit_re\n"; - return; - } - - if( !$shadows and $name2path->{$name} ) { - $verbose and print "Not worth considering $file ", - "-- already saw $name as ", - join(' ', grep($path2name->{$_} eq $name, keys %$path2name)), "\n"; - return; - } - - # Put off until as late as possible the expense of - # actually reading the file: - if( m/\.pod\z/is ) { - # just assume it has pod, okay? - } else { - $progress and $progress->reach($self->{'_scan_count'}, "Scanning $file"); - return unless $self->contains_pod( $file ); - } - ++ $self->{'_scan_count'}; - - # Or finally take note of it: - if( $name2path->{$name} ) { - $verbose and print - "Duplicate POD found (shadowing?): $name ($file)\n", - " Already seen in ", - join(' ', grep($path2name->{$_} eq $name, keys %$path2name)), "\n"; - } else { - $name2path->{$name} = $file; # Noting just the first occurrence - } - $verbose and print " Noting $name = $file\n"; - if( $callback ) { - local $_ = $_; # insulate from changes, just in case - $callback->($file, $name); - } - $path2name->{$file} = $name; - return; - } -} - -#========================================================================== - -sub _path2modname { - my($self, $file, $shortname, $modname_bits) = @_; - - # this code simplifies the POD name for Perl modules: - # * remove "site_perl" - # * remove e.g. "i586-linux" (from 'archname') - # * remove e.g. 5.00503 - # * remove pod/ if followed by perl*.pod (e.g. in pod/perlfunc.pod) - # * dig into the file for case-preserved name if not already mixed case - - my @m = @$modname_bits; - my $x; - my $verbose = $self->verbose; - - # Shaving off leading naughty-bits - while(@m - and defined($x = lc( $m[0] )) - and( $x eq 'site_perl' - or($x eq 'pod' and @m == 1 and $shortname =~ m{^perl.*\.pod$}s ) - or $x =~ m{\\d+\\.z\\d+([_.]?\\d+)?} # if looks like a vernum - or $x eq lc( $Config::Config{'archname'} ) - )) { shift @m } - - my $name = join '::', @m, $shortname; - $self->_simplify_base($name); - - # On VMS, case-preserved document names can't be constructed from - # filenames, so try to extract them from the "=head1 NAME" tag in the - # file instead. - if ($^O eq 'VMS' && ($name eq lc($name) || $name eq uc($name))) { - open PODFILE, "<$file" or die "_path2modname: Can't open $file: $!"; - my $in_pod = 0; - my $in_name = 0; - my $line; - while ($line = <PODFILE>) { - chomp $line; - $in_pod = 1 if ($line =~ m/^=\w/); - $in_pod = 0 if ($line =~ m/^=cut/); - next unless $in_pod; # skip non-pod text - next if ($line =~ m/^\s*\z/); # and blank lines - next if ($in_pod && ($line =~ m/^X</)); # and commands - if ($in_name) { - if ($line =~ m/(\w+::)?(\w+)/) { - # substitute case-preserved version of name - my $podname = $2; - my $prefix = $1 || ''; - $verbose and print "Attempting case restore of '$name' from '$prefix$podname'\n"; - unless ($name =~ s/$prefix$podname/$prefix$podname/i) { - $verbose and print "Attempting case restore of '$name' from '$podname'\n"; - $name =~ s/$podname/$podname/i; - } - last; - } - } - $in_name = 1 if ($line =~ m/^=head1 NAME/); - } - close PODFILE; - } - - return $name; -} - -#========================================================================== - -sub _recurse_dir { - my($self, $startdir, $callback, $modname_bits) = @_; - - my $maxdepth = $self->{'fs_recursion_maxdepth'} || 10; - my $verbose = $self->verbose; - - my $here_string = File::Spec->curdir; - my $up_string = File::Spec->updir; - $modname_bits ||= []; - - my $recursor; - $recursor = sub { - my($dir_long, $dir_bare) = @_; - if( @$modname_bits >= 10 ) { - $verbose and print "Too deep! [@$modname_bits]\n"; - return; - } - - unless(-d $dir_long) { - $verbose > 2 and print "But it's not a dir! $dir_long\n"; - return; - } - unless( opendir(INDIR, $dir_long) ) { - $verbose > 2 and print "Can't opendir $dir_long : $!\n"; - closedir(INDIR); - return - } - my @items = sort readdir(INDIR); - closedir(INDIR); - - push @$modname_bits, $dir_bare unless $dir_bare eq ''; - - my $i_full; - foreach my $i (@items) { - next if $i eq $here_string or $i eq $up_string or $i eq ''; - $i_full = File::Spec->catfile( $dir_long, $i ); - - if(!-r $i_full) { - $verbose and print "Skipping unreadable $i_full\n"; - - } elsif(-f $i_full) { - $_ = $i; - $callback->( $i_full, $i, 0, $modname_bits ); - - } elsif(-d _) { - $i =~ s/\.DIR\z//i if $^O eq 'VMS'; - $_ = $i; - my $rv = $callback->( $i_full, $i, 1, $modname_bits ) || ''; - - if($rv eq 'PRUNE') { - $verbose > 1 and print "OK, pruning"; - } else { - # Otherwise, recurse into it - $recursor->( File::Spec->catdir($dir_long, $i) , $i); - } - } else { - $verbose > 1 and print "Skipping oddity $i_full\n"; - } - } - pop @$modname_bits; - return; - };; - - local $_; - $recursor->($startdir, ''); - - undef $recursor; # allow it to be GC'd - - return; -} - - -#========================================================================== - -sub run { - # A function, useful in one-liners - - my $self = __PACKAGE__->new; - $self->limit_glob($ARGV[0]) if @ARGV; - $self->callback( sub { - my($file, $name) = @_; - my $version = ''; - - # Yes, I know we won't catch the version in like a File/Thing.pm - # if we see File/Thing.pod first. That's just the way the - # cookie crumbles. -- SMB - - if($file =~ m/\.pod$/i) { - # Don't bother looking for $VERSION in .pod files - DEBUG and print "Not looking for \$VERSION in .pod $file\n"; - } elsif( !open(INPOD, $file) ) { - DEBUG and print "Couldn't open $file: $!\n"; - close(INPOD); - } else { - # Sane case: file is readable - my $lines = 0; - while(<INPOD>) { - last if $lines++ > $MAX_VERSION_WITHIN; # some degree of sanity - if( s/^\s*\$VERSION\s*=\s*//s and m/\d/ ) { - DEBUG and print "Found version line (#$lines): $_"; - s/\s*\#.*//s; - s/\;\s*$//s; - s/\s+$//s; - s/\t+/ /s; # nix tabs - # Optimize the most common cases: - $_ = "v$1" - if m{^v?["']?([0-9_]+(\.[0-9_]+)*)["']?$}s - # like in $VERSION = "3.14159"; - or m{\$Revision:\s*([0-9_]+(?:\.[0-9_]+)*)\s*\$}s - # like in sprintf("%d.%02d", q$Revision: 4.13 $ =~ /(\d+)\.(\d+)/); - ; - - # Like in sprintf("%d.%s", map {s/_//g; $_} q$Name: release-0_55-public $ =~ /-(\d+)_([\d_]+)/) - $_ = sprintf("v%d.%s", - map {s/_//g; $_} - $1 =~ m/-(\d+)_([\d_]+)/) # snare just the numeric part - if m{\$Name:\s*([^\$]+)\$}s - ; - $version = $_; - DEBUG and print "Noting $version as version\n"; - last; - } - } - close(INPOD); - } - print "$name\t$version\t$file\n"; - return; - # End of callback! - }); - - $self->survey; -} - -#========================================================================== - -sub simplify_name { - my($self, $str) = @_; - - # Remove all path components - # XXX Why not just use basename()? -- SMB - - if ($^O eq 'MacOS') { $str =~ s{^.*:+}{}s } - else { $str =~ s{^.*/+}{}s } - - $self->_simplify_base($str); - return $str; -} - -#========================================================================== - -sub _simplify_base { # Internal method only - - # strip Perl's own extensions - $_[1] =~ s/\.(pod|pm|plx?)\z//i; - - # strip meaningless extensions on Win32 and OS/2 - $_[1] =~ s/\.(bat|exe|cmd)\z//i if $^O =~ /mswin|os2/i; - - # strip meaningless extensions on VMS - $_[1] =~ s/\.(com)\z//i if $^O eq 'VMS'; - - return; -} - -#========================================================================== - -sub _expand_inc { - my($self, $search_dirs) = @_; - - return unless $self->{'inc'}; - - if ($^O eq 'MacOS') { - push @$search_dirs, - grep $_ ne File::Spec->curdir, $self->_mac_whammy(@INC); - # Any other OSs need custom handling here? - } else { - push @$search_dirs, grep $_ ne File::Spec->curdir, @INC; - } - - $self->{'laborious'} = 0; # Since inc said to use INC - return; -} - -#========================================================================== - -sub _mac_whammy { # Tolerate '.', './some_dir' and '(../)+some_dir' on Mac OS - my @them; - (undef,@them) = @_; - for $_ (@them) { - if ( $_ eq '.' ) { - $_ = ':'; - } elsif ( $_ =~ s|^((?:\.\./)+)|':' x (length($1)/3)|e ) { - $_ = ':'. $_; - } else { - $_ =~ s|^\./|:|; - } - } - return @them; -} - -#========================================================================== - -sub _limit_glob_to_limit_re { - my $self = $_[0]; - my $limit_glob = $self->{'limit_glob'} || return; - - my $limit_re = '^' . quotemeta($limit_glob) . '$'; - $limit_re =~ s/\\\?/./g; # glob "?" => "." - $limit_re =~ s/\\\*/.*?/g; # glob "*" => ".*?" - $limit_re =~ s/\.\*\?\$$//s; # final glob "*" => ".*?$" => "" - - $self->{'verbose'} and print "Turning limit_glob $limit_glob into re $limit_re\n"; - - # A common optimization: - if(!exists($self->{'dir_prefix'}) - and $limit_glob =~ m/^(?:\w+\:\:)+/s # like "File::*" or "File::Thing*" - # Optimize for sane and common cases (but not things like "*::File") - ) { - $self->{'dir_prefix'} = join "::", $limit_glob =~ m/^(?:\w+::)+/sg; - $self->{'verbose'} and print " and setting dir_prefix to $self->{'dir_prefix'}\n"; - } - - return $limit_re; -} - -#========================================================================== - -# contribution mostly from Tim Jenness <t.jenness@jach.hawaii.edu> - -sub find { - my($self, $pod, @search_dirs) = @_; - $self = $self->new unless ref $self; # tolerate being a class method - - # Check usage - Carp::carp 'Usage: \$self->find($podname, ...)' - unless defined $pod and length $pod; - - my $verbose = $self->verbose; - - # Split on :: and then join the name together using File::Spec - my @parts = split /::/, $pod; - $verbose and print "Chomping {$pod} => {@parts}\n"; - - #@search_dirs = File::Spec->curdir unless @search_dirs; - - if( $self->inc ) { - if( $^O eq 'MacOS' ) { - push @search_dirs, $self->_mac_whammy(@INC); - } else { - push @search_dirs, @INC; - } - - # Add location of pod documentation for perl man pages (eg perlfunc) - # This is a pod directory in the private install tree - #my $perlpoddir = File::Spec->catdir($Config::Config{'installprivlib'}, - # 'pod'); - #push (@search_dirs, $perlpoddir) - # if -d $perlpoddir; - - # Add location of binaries such as pod2text: - push @search_dirs, $Config::Config{'scriptdir'}; - # and if that's undef or q{} or nonexistent, we just ignore it later - } - - my %seen_dir; - Dir: - foreach my $dir ( @search_dirs ) { - next unless defined $dir and length $dir; - next if $seen_dir{$dir}; - $seen_dir{$dir} = 1; - unless(-d $dir) { - print "Directory $dir does not exist\n" if $verbose; - next Dir; - } - - print "Looking in directory $dir\n" if $verbose; - my $fullname = File::Spec->catfile( $dir, @parts ); - print "Filename is now $fullname\n" if $verbose; - - foreach my $ext ('', '.pod', '.pm', '.pl') { # possible extensions - my $fullext = $fullname . $ext; - if( -f $fullext and $self->contains_pod( $fullext ) ){ - print "FOUND: $fullext\n" if $verbose; - return $fullext; - } - } - my $subdir = File::Spec->catdir($dir,'pod'); - if(-d $subdir) { # slip in the ./pod dir too - $verbose and print "Noticing $subdir and stopping there...\n"; - $dir = $subdir; - redo Dir; - } - } - - return undef; -} - -#========================================================================== - -sub contains_pod { - my($self, $file) = @_; - my $verbose = $self->{'verbose'}; - - # check for one line of POD - $verbose > 1 and print " Scanning $file for pod...\n"; - unless( open(MAYBEPOD,"<$file") ) { - print "Error: $file is unreadable: $!\n"; - return undef; - } - - sleep($SLEEPY - 1) if $SLEEPY; - # avoid totally hogging the processor on OSs with poor process control - - local $_; - while( <MAYBEPOD> ) { - if(m/^=(head\d|pod|over|item)\b/s) { - close(MAYBEPOD) || die "Bizarre error closing $file: $!\nAborting"; - chomp; - $verbose > 1 and print " Found some pod ($_) in $file\n"; - return 1; - } - } - close(MAYBEPOD) || die "Bizarre error closing $file: $!\nAborting"; - $verbose > 1 and print " No POD in $file, skipping.\n"; - return 0; -} - -#========================================================================== - -sub _accessorize { # A simple-minded method-maker - shift; - no strict 'refs'; - foreach my $attrname (@_) { - *{caller() . '::' . $attrname} = sub { - use strict; - $Carp::CarpLevel = 1, Carp::croak( - "Accessor usage: \$obj->$attrname() or \$obj->$attrname(\$new_value)" - ) unless (@_ == 1 or @_ == 2) and ref $_[0]; - - # Read access: - return $_[0]->{$attrname} if @_ == 1; - - # Write access: - $_[0]->{$attrname} = $_[1]; - return $_[0]; # RETURNS MYSELF! - }; - } - # Ya know, they say accessories make the ensemble! - return; -} - -#========================================================================== -sub _state_as_string { - my $self = $_[0]; - return '' unless ref $self; - my @out = "{\n # State of $self ...\n"; - foreach my $k (sort keys %$self) { - push @out, " ", _esc($k), " => ", _esc($self->{$k}), ",\n"; - } - push @out, "}\n"; - my $x = join '', @out; - $x =~ s/^/#/mg; - return $x; -} - -sub _esc { - my $in = $_[0]; - return 'undef' unless defined $in; - $in =~ - s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])> - <'\\x'.(unpack("H2",$1))>eg; - return qq{"$in"}; -} - -#========================================================================== - -run() unless caller; # run if "perl whatever/Search.pm" - -1; - -#========================================================================== - -__END__ - - -=head1 NAME - -Pod::Simple::Search - find POD documents in directory trees - -=head1 SYNOPSIS - - use Pod::Simple::Search; - my $name2path = Pod::Simple::Search->new->limit_glob('LWP::*')->survey; - print "Looky see what I found: ", - join(' ', sort keys %$name2path), "\n"; - - print "LWPUA docs = ", - Pod::Simple::Search->new->find('LWP::UserAgent') || "?", - "\n"; - -=head1 DESCRIPTION - -B<Pod::Simple::Search> is a class that you use for running searches -for Pod files. An object of this class has several attributes -(mostly options for controlling search options), and some methods -for searching based on those attributes. - -The way to use this class is to make a new object of this class, -set any options, and then call one of the search options -(probably C<survey> or C<find>). The sections below discuss the -syntaxes for doing all that. - - -=head1 CONSTRUCTOR - -This class provides the one constructor, called C<new>. -It takes no parameters: - - use Pod::Simple::Search; - my $search = Pod::Simple::Search->new; - -=head1 ACCESSORS - -This class defines several methods for setting (and, occasionally, -reading) the contents of an object. With two exceptions (discussed at -the end of this section), these attributes are just for controlling the -way searches are carried out. - -Note that each of these return C<$self> when you call them as -C<< $self->I<whatever(value)> >>. That's so that you can chain -together set-attribute calls like this: - - my $name2path = - Pod::Simple::Search->new - -> inc(0) -> verbose(1) -> callback(\&blab) - ->survey(@there); - -...which works exactly as if you'd done this: - - my $search = Pod::Simple::Search->new; - $search->inc(0); - $search->verbose(1); - $search->callback(\&blab); - my $name2path = $search->survey(@there); - -=over - -=item $search->inc( I<true-or-false> ); - -This attribute, if set to a true value, means that searches should -implicitly add perl's I<@INC> paths. This -automatically considers paths specified in the C<PERL5LIB> environment -as this is prepended to I<@INC> by the Perl interpreter itself. -This attribute's default value is B<TRUE>. If you want to search -only specific directories, set $self->inc(0) before calling -$inc->survey or $inc->find. - - -=item $search->verbose( I<nonnegative-number> ); - -This attribute, if set to a nonzero positive value, will make searches output -(via C<warn>) notes about what they're doing as they do it. -This option may be useful for debugging a pod-related module. -This attribute's default value is zero, meaning that no C<warn> messages -are produced. (Setting verbose to 1 turns on some messages, and setting -it to 2 turns on even more messages, i.e., makes the following search(es) -even more verbose than 1 would make them.) - - -=item $search->limit_glob( I<some-glob-string> ); - -This option means that you want to limit the results just to items whose -podnames match the given glob/wildcard expression. For example, you -might limit your search to just "LWP::*", to search only for modules -starting with "LWP::*" (but not including the module "LWP" itself); or -you might limit your search to "LW*" to see only modules whose (full) -names begin with "LW"; or you might search for "*Find*" to search for -all modules with "Find" somewhere in their full name. (You can also use -"?" in a glob expression; so "DB?" will match "DBI" and "DBD".) - - -=item $search->callback( I<\&some_routine> ); - -This attribute means that every time this search sees a matching -Pod file, it should call this callback routine. The routine is called -with two parameters: the current file's filespec, and its pod name. -(For example: C<("/etc/perljunk/File/Crunk.pm", "File::Crunk")> would -be in C<@_>.) - -The callback routine's return value is not used for anything. - -This attribute's default value is false, meaning that no callback -is called. - -=item $search->laborious( I<true-or-false> ); - -Unless you set this attribute to a true value, Pod::Search will -apply Perl-specific heuristics to find the correct module PODs quickly. -This attribute's default value is false. You won't normally need -to set this to true. - -Specifically: Turning on this option will disable the heuristics for -seeing only files with Perl-like extensions, omitting subdirectories -that are numeric but do I<not> match the current Perl interpreter's -version ID, suppressing F<site_perl> as a module hierarchy name, etc. - - -=item $search->shadows( I<true-or-false> ); - -Unless you set this attribute to a true value, Pod::Simple::Search will -consider only the first file of a given modulename as it looks thru the -specified directories; that is, with this option off, if -Pod::Simple::Search has seen a C<somepathdir/Foo/Bar.pm> already in this -search, then it won't bother looking at a C<somelaterpathdir/Foo/Bar.pm> -later on in that search, because that file is merely a "shadow". But if -you turn on C<< $self->shadows(1) >>, then these "shadow" files are -inspected too, and are noted in the pathname2podname return hash. - -This attribute's default value is false; and normally you won't -need to turn it on. - - -=item $search->limit_re( I<some-regxp> ); - -Setting this attribute (to a value that's a regexp) means that you want -to limit the results just to items whose podnames match the given -regexp. Normally this option is not needed, and the more efficient -C<limit_glob> attribute is used instead. - - -=item $search->dir_prefix( I<some-string-value> ); - -Setting this attribute to a string value means that the searches should -begin in the specified subdirectory name (like "Pod" or "File::Find", -also expressable as "File/Find"). For example, the search option -C<< $search->limit_glob("File::Find::R*") >> -is the same as the combination of the search options -C<< $search->limit_re("^File::Find::R") -> dir_prefix("File::Find") >>. - -Normally you don't need to know about the C<dir_prefix> option, but I -include it in case it might prove useful for someone somewhere. - -(Implementationally, searching with limit_glob ends up setting limit_re -and usually dir_prefix.) - - -=item $search->progress( I<some-progress-object> ); - -If you set a value for this attribute, the value is expected -to be an object (probably of a class that you define) that has a -C<reach> method and a C<done> method. This is meant for reporting -progress during the search, if you don't want to use a simple -callback. - -Normally you don't need to know about the C<progress> option, but I -include it in case it might prove useful for someone somewhere. - -While a search is in progress, the progress object's C<reach> and -C<done> methods are called like this: - - # Every time a file is being scanned for pod: - $progress->reach($count, "Scanning $file"); ++$count; - - # And then at the end of the search: - $progress->done("Noted $count Pod files total"); - -Internally, we often set this to an object of class -Pod::Simple::Progress. That class is probably undocumented, -but you may wish to look at its source. - - -=item $name2path = $self->name2path; - -This attribute is not a search parameter, but is used to report the -result of C<survey> method, as discussed in the next section. - -=item $path2name = $self->path2name; - -This attribute is not a search parameter, but is used to report the -result of C<survey> method, as discussed in the next section. - -=back - -=head1 MAIN SEARCH METHODS - -Once you've actually set any options you want (if any), you can go -ahead and use the following methods to search for Pod files -in particular ways. - - -=head2 C<< $search->survey( @directories ) >> - -The method C<survey> searches for POD documents in a given set of -files and/or directories. This runs the search according to the various -options set by the accessors above. (For example, if the C<inc> attribute -is on, as it is by default, then the perl @INC directories are implicitly -added to the list of directories (if any) that you specify.) - -The return value of C<survey> is two hashes: - -=over - -=item C<name2path> - -A hash that maps from each pod-name to the filespec (like -"Stuff::Thing" => "/whatever/plib/Stuff/Thing.pm") - -=item C<path2name> - -A hash that maps from each Pod filespec to its pod-name (like -"/whatever/plib/Stuff/Thing.pm" => "Stuff::Thing") - -=back - -Besides saving these hashes as the hashref attributes -C<name2path> and C<path2name>, calling this function also returns -these hashrefs. In list context, the return value of -C<< $search->survey >> is the list C<(\%name2path, \%path2name)>. -In scalar context, the return value is C<\%name2path>. -Or you can just call this in void context. - -Regardless of calling context, calling C<survey> saves -its results in its C<name2path> and C<path2name> attributes. - -E.g., when searching in F<$HOME/perl5lib>, the file -F<$HOME/perl5lib/MyModule.pm> would get the POD name I<MyModule>, -whereas F<$HOME/perl5lib/Myclass/Subclass.pm> would be -I<Myclass::Subclass>. The name information can be used for POD -translators. - -Only text files containing at least one valid POD command are found. - -In verbose mode, a warning is printed if shadows are found (i.e., more -than one POD file with the same POD name is found, e.g. F<CPAN.pm> in -different directories). This usually indicates duplicate occurrences of -modules in the I<@INC> search path, which is occasionally inadvertent -(but is often simply a case of a user's path dir having a more recent -version than the system's general path dirs in general.) - -The options to this argument is a list of either directories that are -searched recursively, or files. (Usually you wouldn't specify files, -but just dirs.) Or you can just specify an empty-list, as in -$name2path; with the -C<inc> option on, as it is by default, teh - -The POD names of files are the plain basenames with any Perl-like -extension (.pm, .pl, .pod) stripped, and path separators replaced by -C<::>'s. - -Calling Pod::Simple::Search->search(...) is short for -Pod::Simple::Search->new->search(...). That is, a throwaway object -with default attribute values is used. - - -=head2 C<< $search->simplify_name( $str ) >> - -The method B<simplify_name> is equivalent to B<basename>, but also -strips Perl-like extensions (.pm, .pl, .pod) and extensions like -F<.bat>, F<.cmd> on Win32 and OS/2, or F<.com> on VMS, respectively. - - -=head2 C<< $search->find( $pod ) >> - -=head2 C<< $search->find( $pod, @search_dirs ) >> - -Returns the location of a Pod file, given a Pod/module/script name -(like "Foo::Bar" or "perlvar" or "perldoc"), and an idea of -what files/directories to look in. -It searches according to the various options set by the accessors above. -(For example, if the C<inc> attribute is on, as it is by default, then -the perl @INC directories are implicitly added to the list of -directories (if any) that you specify.) - -This returns the full path of the first occurrence to the file. -Package names (eg 'A::B') are automatically converted to directory -names in the selected directory. Additionally, '.pm', '.pl' and '.pod' -are automatically appended to the search as required. -(So, for example, under Unix, "A::B" is converted to "somedir/A/B.pm", -"somedir/A/B.pod", or "somedir/A/B.pl", as appropriate.) - -If no such Pod file is found, this method returns undef. - -If any of the given search directories contains a F<pod/> subdirectory, -then it is searched. (That's how we manage to find F<perlfunc>, -for example, which is usually in F<pod/perlfunc> in most Perl dists.) - -The C<verbose> and C<inc> attributes influence the behavior of this -search; notably, C<inc>, if true, adds @INC I<and also -$Config::Config{'scriptdir'}> to the list of directories to search. - -It is common to simply say C<< $filename = Pod::Simple::Search-> new -->find("perlvar") >> so that just the @INC (well, and scriptdir) -directories are searched. (This happens because the C<inc> -attribute is true by default.) - -Calling Pod::Simple::Search->find(...) is short for -Pod::Simple::Search->new->find(...). That is, a throwaway object -with default attribute values is used. - - -=head2 C<< $self->contains_pod( $file ) >> - -Returns true if the supplied filename (not POD module) contains some Pod -documentation. - - -=head1 AUTHOR - -Sean M. Burke E<lt>sburke@cpan.orgE<gt> -borrowed code from -Marek Rouchal's Pod::Find, which in turn -heavily borrowed code from Nick Ing-Simmons' PodToHtml. - -Tim Jenness E<lt>t.jenness@jach.hawaii.eduE<gt> provided -C<find> and C<contains_pod> to Pod::Find. - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Perldoc> - -=cut - diff --git a/web/bin/lib/Pod/Simple/SimpleTree.pm b/web/bin/lib/Pod/Simple/SimpleTree.pm deleted file mode 100644 index 64dd155..0000000 --- a/web/bin/lib/Pod/Simple/SimpleTree.pm +++ /dev/null @@ -1,155 +0,0 @@ - - -require 5; -package Pod::Simple::SimpleTree; -use strict; -use Carp (); -use Pod::Simple (); -use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '2.02'; -BEGIN { - @ISA = ('Pod::Simple'); - *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; -} - -__PACKAGE__->_accessorize( - 'root', # root of the tree -); - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub _handle_element_start { # self, tagname, attrhash - DEBUG > 2 and print "Handling $_[1] start-event\n"; - my $x = [$_[1], $_[2]]; - if($_[0]{'_currpos'}) { - push @{ $_[0]{'_currpos'}[0] }, $x; # insert in parent's child-list - unshift @{ $_[0]{'_currpos'} }, $x; # prefix to stack - } else { - DEBUG and print " And oo, it gets to be root!\n"; - $_[0]{'_currpos'} = [ $_[0]{'root'} = $x ]; - # first event! set to stack, and set as root. - } - DEBUG > 3 and print "Stack is now: ", - join(">", map $_->[0], @{$_[0]{'_currpos'}}), "\n"; - return; -} - -sub _handle_element_end { # self, tagname - DEBUG > 2 and print "Handling $_[1] end-event\n"; - shift @{$_[0]{'_currpos'}}; - DEBUG > 3 and print "Stack is now: ", - join(">", map $_->[0], @{$_[0]{'_currpos'}}), "\n"; - return; -} - -sub _handle_text { # self, text - DEBUG > 2 and print "Handling $_[1] text-event\n"; - push @{ $_[0]{'_currpos'}[0] }, $_[1]; - return; -} - - -# A bit of evil from the black box... please avert your eyes, kind souls. -sub _traverse_treelet_bit { - DEBUG > 2 and print "Handling $_[1] paragraph event\n"; - my $self = shift; - push @{ $self->{'_currpos'}[0] }, [@_]; - return; -} -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1; -__END__ - -=head1 NAME - -Pod::Simple::SimpleTree -- parse Pod into a simple parse tree - -=head1 SYNOPSIS - - % cat ptest.pod - - =head1 PIE - - I like B<pie>! - - % perl -MPod::Simple::SimpleTree -MData::Dumper -e \ - "print Dumper(Pod::Simple::SimpleTree->new->parse_file(shift)->root)" \ - ptest.pod - - $VAR1 = [ - 'Document', - { 'start_line' => 1 }, - [ - 'head1', - { 'start_line' => 1 }, - 'PIE' - ], - [ - 'Para', - { 'start_line' => 3 }, - 'I like ', - [ - 'B', - {}, - 'pie' - ], - '!' - ] - ]; - -=head1 DESCRIPTION - -This class is of interest to people writing a Pod processor/formatter. - -This class takes Pod and parses it, returning a parse tree made just -of arrayrefs, and hashrefs, and strings. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -This class is inspired by XML::Parser's "Tree" parsing-style, although -it doesn't use exactly the same LoL format. - -=head1 METHODS - -At the end of the parse, call C<< $parser->root >> to get the -tree's top node. - -=head1 Tree Contents - -Every element node in the parse tree is represented by an arrayref of -the form: C<[ I<elementname>, \%attributes, I<...subnodes...> ]>. -See the example tree dump in the Synopsis, above. - -Every text node in the tree is represented by a simple (non-ref) -string scalar. So you can test C<ref($node)> to see whather you have -an element node or just a text node. - -The top node in the tree is C<[ 'Document', \%attributes, -I<...subnodes...> ]> - - -=head1 SEE ALSO - -L<Pod::Simple> - -L<perllol> - -L<The "Tree" subsubsection in XML::Parser|XML::Parser/"Tree"> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/Subclassing.pod b/web/bin/lib/Pod/Simple/Subclassing.pod deleted file mode 100644 index d4ee694..0000000 --- a/web/bin/lib/Pod/Simple/Subclassing.pod +++ /dev/null @@ -1,922 +0,0 @@ - -=head1 NAME - -Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass - -=head1 SYNOPSIS - - package Pod::SomeFormatter; - use Pod::Simple; - @ISA = qw(Pod::Simple); - $VERSION = '1.01'; - use strict; - - sub _handle_element_start { - my($parser, $element_name, $attr_hash_r) = @_; - ... - } - - sub _handle_element_end { - my($parser, $element_name) = @_; - ... - } - - sub _handle_text { - my($parser, $text) = @_; - ... - } - 1; - -=head1 DESCRIPTION - -This document is about using Pod::Simple to write a Pod processor, -generally a Pod formatter. If you just want to know about using an -existing Pod formatter, instead see its documentation and see also the -docs in L<Pod::Simple>. - -The zeroeth step in writing a Pod formatter is to make sure that there -isn't already a decent one in CPAN. See L<http://search.cpan.org/>, and -run a search on the name of the format you want to render to. Also -consider joining the Pod People list -L<http://lists.perl.org/showlist.cgi?name=pod-people> and asking whether -anyone has a formatter for that format -- maybe someone cobbled one -together but just hasn't released it. - -The first step in writing a Pod processor is to read L<perlpodspec>, -which contains notes information on writing a Pod parser (which has been -largely taken care of by Pod::Simple), but also a lot of requirements -and recommendations for writing a formatter. - -The second step is to actually learn the format you're planning to -format to -- or at least as much as you need to know to represent Pod, -which probably isn't much. - -The third step is to pick which of Pod::Simple's interfaces you want to -use -- the basic interface via Pod::Simple or L<Pod::Simple::Methody> is -event-based, sort of like L<HTML::Parser>'s interface, or sort of like -L<XML::Parser>'s "Handlers" interface), but L<Pod::Simple::PullParser> -provides a token-stream interface, sort of like L<HTML::TokeParser>'s -interface; L<Pod::Simple::SimpleTree> provides a simple tree interface, -rather like XML::Parser's "Tree" interface. Users familiar with -XML-handling will find one of these styles relatively familiar; but if -you would be even more at home with XML, there are classes that produce -an XML representation of the Pod stream, notably -L<Pod::Simple::XMLOutStream>; you can feed the output of such a class to -whatever XML parsing system you are most at home with. - -The last step is to write your code based on how the events (or tokens, -or tree-nodes, or the XML, or however you're parsing) will map to -constructs in the output format. Also sure to consider how to escape -text nodes containing arbitrary text, and also what to do with text -nodes that represent preformatted text (from verbatim sections). - - - -=head1 Events - -TODO intro... mention that events are supplied for implicits, like for -missing >'s - - -In the following section, we use XML to represent the event structure -associated with a particular construct. That is, TODO - -=over - -=item C<< $parser->_handle_element_start( I<element_name>, I<attr_hashref> ) >> - -=item C<< $parser->_handle_element_end( I<element_name> ) >> - -=item C<< $parser->_handle_text( I<text_string> ) >> - -=back - -TODO describe - - -=over - -=item events with an element_name of Document - -Parsing a document produces this event structure: - - <Document start_line="543"> - ...all events... - </Document> - -The value of the I<start_line> attribute will be the line number of the first -Pod directive in the document. - -If there is no Pod in the given document, then the -event structure will be this: - - <Document contentless="1" start_line="543"> - </Document> - -In that case, the value of the I<start_line> attribute will not be meaningful; -under current implementations, it will probably be the line number of the -last line in the file. - -=item events with an element_name of Para - -Parsing a plain (non-verbatim, non-directive, non-data) paragraph in -a Pod document produces this event structure: - - <Para start_line="543"> - ...all events in this paragraph... - </Para> - -The value of the I<start_line> attribute will be the line number of the start -of the paragraph. - -For example, parsing this paragraph of Pod: - - The value of the I<start_line> attribute will be the - line number of the start of the paragraph. - -produces this event structure: - - <Para start_line="129"> - The value of the - <I> - start_line - </I> - attribute will be the line number of the first Pod directive - in the document. - </Para> - -=item events with an element_name of B, C, F, or I. - -Parsing a BE<lt>...E<gt> formatting code (or of course any of its -semantically identical syntactic variants -S<BE<lt>E<lt> ... E<gt>E<gt>>, -or S<BE<lt>E<lt>E<lt>E<lt> ... E<gt>E<gt>E<gt>E<gt>>, etc.) -produces this event structure: - - <B> - ...stuff... - </B> - -Currently, there are no attributes conveyed. - -Parsing C, F, or I codes produce the same structure, with only a -different element name. - -If your parser object has been set to accept other formatting codes, -then they will be presented like these B/C/F/I codes -- i.e., without -any attributes. - -=item events with an element_name of S - -Normally, parsing an SE<lt>...E<gt> sequence produces this event -structure, just as if it were a B/C/F/I code: - - <S> - ...stuff... - </S> - -However, Pod::Simple (and presumably all derived parsers) offers the -C<nbsp_for_S> option which, if enabled, will suppress all S events, and -instead change all spaces in the content to non-breaking spaces. This is -intended for formatters that output to a format that has no code that -means the same as SE<lt>...E<gt>, but which has a code/character that -means non-breaking space. - -=item events with an element_name of X - -Normally, parsing an XE<lt>...E<gt> sequence produces this event -structure, just as if it were a B/C/F/I code: - - <X> - ...stuff... - </X> - -However, Pod::Simple (and presumably all derived parsers) offers the -C<nix_X_codes> option which, if enabled, will suppress all X events -and ignore their content. For formatters/processors that don't use -X events, this is presumably quite useful. - - -=item events with an element_name of L - -Because the LE<lt>...E<gt> is the most complex construct in the -language, it should not surprise you that the events it generates are -the most complex in the language. Most of complexity is hidden away in -the attribute values, so for those of you writing a Pod formatter that -produces a non-hypertextual format, you can just ignore the attributes -and treat an L event structure like a formatting element that -(presumably) doesn't actually produce a change in formatting. That is, -the content of the L event structure (as opposed to its -attributes) is always what text should be displayed. - -There are, at first glance, three kinds of L links: URL, man, and pod. - -When a LE<lt>I<some_url>E<gt> code is parsed, it produces this event -structure: - - <L content-implicit="yes" to="that_url" type="url"> - that_url - </L> - -The C<type="url"> attribute is always specified for this type of -L code. - -For example, this Pod source: - - L<http://www.perl.com/CPAN/authors/> - -produces this event structure: - - <L content-implicit="yes" to="http://www.perl.com/CPAN/authors/" type="url"> - http://www.perl.com/CPAN/authors/ - </L> - -When a LE<lt>I<manpage(section)>E<gt> code is parsed (and these are -fairly rare and not terribly useful), it produces this event structure: - - <L content-implicit="yes" to="manpage(section)" type="man"> - manpage(section) - </L> - -The C<type="man"> attribute is always specified for this type of -L code. - -For example, this Pod source: - - L<crontab(5)> - -produces this event structure: - - <L content-implicit="yes" to="crontab(5)" type="man"> - crontab(5) - </L> - -In the rare cases where a man page link has a specified, that text appears -in a I<section> attribute. For example, this Pod source: - - L<crontab(5)/"ENVIRONMENT"> - -will produce this event structure: - - <L content-implicit="yes" section="ENVIRONMENT" to="crontab(5)" type="man"> - "ENVIRONMENT" in crontab(5) - </L> - -In the rare case where the Pod document has code like -LE<lt>I<sometext>|I<manpage(section)>E<gt>, then the I<sometext> will appear -as the content of the element, the I<manpage(section)> text will appear -only as the value of the I<to> attribute, and there will be no -C<content-implicit="yes"> attribute (whose presence means that the Pod parser -had to infer what text should appear as the link text -- as opposed to -cases where that attribute is absent, which means that the Pod parser did -I<not> have to infer the link text, because that L code explicitly specified -some link text.) - -For example, this Pod source: - - L<hell itself!|crontab(5)> - -will produce this event structure: - - <L to="crontab(5)" type="man"> - hell itself! - </L> - -The last type of L structure is for links to/within Pod documents. It is -the most complex because it can have a I<to> attribute, I<or> a -I<section> attribute, or both. The C<type="pod"> attribute is always -specified for this type of L code. - -In the most common case, the simple case of a LE<lt>podpageE<gt> code -produces this event structure: - - <L content-implicit="yes" to="Net::Ping" type="pod"> - podpage - </L> - -For example, this Pod source: - - L<Net::Ping> - -produces this event structure: - - <L content-implicit="yes" to="Net::Ping" type="pod"> - Net::Ping - </L> - -In cases where there is link-text explicitly specified, it -is to be found in the content of the element (and not the -attributes), just as with the LE<lt>I<sometext>|I<manpage(section)>E<gt> -case discussed above. For example, this Pod source: - - L<Perl Error Messages|perldiag> - -produces this event structure: - - <L to="perldiag" type="pod"> - Perl Error Messages - </L> - -In cases of links to a section in the current Pod document, -there is a I<section> attribute instead of a I<to> attribute. -For example, this Pod source: - - L</"Member Data"> - -produces this event structure: - - <L content-implicit="yes" section="Member Data" type="pod"> - "Member Data" - </L> - -As another example, this Pod source: - - L<the various attributes|/"Member Data"> - -produces this event structure: - - <L section="Member Data" type="pod"> - the various attributes - </L> - -In cases of links to a section in a different Pod document, -there are both a I<section> attribute and a L<to> attribute. -For example, this Pod source: - - L<perlsyn/"Basic BLOCKs and Switch Statements"> - -produces this event structure: - - <L content-implicit="yes" section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod"> - "Basic BLOCKs and Switch Statements" in perlsyn - </L> - -As another example, this Pod source: - - L<SWITCH statements|perlsyn/"Basic BLOCKs and Switch Statements"> - -produces this event structure: - - <L section="Basic BLOCKs and Switch Statements" to="perlsyn" type="pod"> - SWITCH statements - </L> - -Incidentally, note that we do not distinguish between these syntaxes: - - L</"Member Data"> - L<"Member Data"> - L</Member Data> - L<Member Data> [deprecated syntax] - -That is, they all produce the same event structure, namely: - - <L content-implicit="yes" section="Member Data" type="pod"> - "Member Data" - </L> - -=item events with an element_name of E or Z - -While there are Pod codes EE<lt>...E<gt> and ZE<lt>E<gt>, these -I<do not> produce any E or Z events -- that is, there are no such -events as E or Z. - -=item events with an element_name of Verbatim - -When a Pod verbatim paragraph (AKA "codeblock") is parsed, it -produces this event structure: - - <Verbatim start_line="543" xml:space="preserve"> - ...text... - </Verbatim> - -The value of the I<start_line> attribute will be the line number of the -first line of this verbatim block. The I<xml:space> attribute is always -present, and always has the value "preserve". - -The text content will have tabs already expanded. - - -=item events with an element_name of head1 .. head4 - -When a "=head1 ..." directive is parsed, it produces this event -structure: - - <head1> - ...stuff... - </head1> - -For example, a directive consisting of this: - - =head1 Options to C<new> et al. - -will produce this event structure: - - <head1 start_line="543"> - Options to - <C> - new - </C> - et al. - </head1> - -"=head2" thru "=head4" directives are the same, except for the element -names in the event structure. - -=item events with an element_name of over-bullet - -When an "=over ... Z<>=back" block is parsed where the items are -a bulletted list, it will produce this event structure: - - <over-bullet indent="4" start_line="543"> - <item-bullet start_line="545"> - ...Stuff... - </item-bullet> - ...more item-bullets... - </over-bullet> - -The value of the I<indent> attribute is whatever value is after the -"=over" directive, as in "=over 8". If no such value is specified -in the directive, then the I<indent> attribute has the value "4". - -For example, this Pod source: - - =over - - =item * - - Stuff - - =item * - - Bar I<baz>! - - =back - -produces this event structure: - - <over-bullet indent="4" start_line="10"> - <item-bullet start_line="12"> - Stuff - </item-bullet> - <item-bullet start_line="14"> - Bar <I>baz</I>! - </item-bullet> - </over-bullet> - -=item events with an element_name of over-number - -When an "=over ... Z<>=back" block is parsed where the items are -a numbered list, it will produce this event structure: - - <over-number indent="4" start_line="543"> - <item-number number="1" start_line="545"> - ...Stuff... - </item-number> - ...more item-number... - </over-bullet> - -This is like the "over-bullet" event structure; but note that the contents -are "item-number" instead of "item-bullet", and note that they will have -a "number" attribute, which some formatters/processors may ignore -(since, for example, there's no need for it in HTML when producing -an "<UL><LI>...</LI>...</UL>" structure), but which any processor may use. - -Note that the values for the I<number> attributes of "item-number" -elements in a given "over-number" area I<will> start at 1 and go up by -one each time. If the Pod source doesn't follow that order (even though -it really should should!), whatever numbers it has will be ignored (with -the correct values being put in the I<number> attributes), and an error -message might be issued to the user. - -=item events with an element_name of over-text - -These events are are somewhat unlike the other over-* -structures, as far as what their contents are. When -an "=over ... Z<>=back" block is parsed where the items are -a list of text "subheadings", it will produce this event structure: - - <over-text indent="4" start_line="543"> - <item-text> - ...stuff... - </item-text> - ...stuff (generally Para or Verbatim elements)... - <item-text> - ...more item-text and/or stuff... - </over-text> - -The I<indent> attribute is as with the other over-* events. - -For example, this Pod source: - - =over - - =item Foo - - Stuff - - =item Bar I<baz>! - - Quux - - =back - -produces this event structure: - - <over-text indent="4" start_line="20"> - <item-text start_line="22"> - Foo - </item-text> - <Para start_line="24"> - Stuff - </Para> - <item-text start_line="26"> - Bar - <I> - baz - </I> - ! - </item-text> - <Para start_line="28"> - Quux - </Para> - </over-text> - - - -=item events with an element_name of over-block - -These events are are somewhat unlike the other over-* -structures, as far as what their contents are. When -an "=over ... Z<>=back" block is parsed where there are no items, -it will produce this event structure: - - <over-block indent="4" start_line="543"> - ...stuff (generally Para or Verbatim elements)... - </over-block> - -The I<indent> attribute is as with the other over-* events. - -For example, this Pod source: - - =over - - For cutting off our trade with all parts of the world - - For transporting us beyond seas to be tried for pretended offenses - - He is at this time transporting large armies of foreign mercenaries to - complete the works of death, desolation and tyranny, already begun with - circumstances of cruelty and perfidy scarcely paralleled in the most - barbarous ages, and totally unworthy the head of a civilized nation. - - =cut - -will produce this event structure: - - <over-block indent="4" start_line="2"> - <Para start_line="4"> - For cutting off our trade with all parts of the world - </Para> - <Para start_line="6"> - For transporting us beyond seas to be tried for pretended offenses - </Para> - <Para start_line="8"> - He is at this time transporting large armies of [...more text...] - </Para> - </over-block> - -=item events with an element_name of item-bullet - -See L</"events with an element_name of over-bullet">, above. - -=item events with an element_name of item-number - -See L</"events with an element_name of over-number">, above. - -=item events with an element_name of item-text - -See L</"events with an element_name of over-text">, above. - -=item events with an element_name of for - -TODO... - -=item events with an element_name of Data - -TODO... - -=back - - - -=head1 More Pod::Simple Methods - -Pod::Simple provides a lot of methods that aren't generally interesting -to the end user of an existing Pod formatter, but some of which you -might find useful in writing a Pod formatter. They are listed below. The -first several methods (the accept_* methods) are for declaring the -capabilites of your parser, notably what C<=for I<targetname>> sections -it's interested in, what extra NE<lt>...E<gt> codes it accepts beyond -the ones described in the I<perlpod>. - -=over - -=item C<< $parser->accept_targets( I<SOMEVALUE> ) >> - -As the parser sees sections like: - - =for html <img src="fig1.jpg"> - -or - - =begin html - - <img src="fig1.jpg"> - - =end html - -...the parser will ignore these sections unless your subclass has -specified that it wants to see sections targetted to "html" (or whatever -the formatter name is). - -If you want to process all sections, even if they're not targetted for you, -call this before you start parsing: - - $parser->accept_targets('*'); - -=item C<< $parser->accept_targets_as_text( I<SOMEVALUE> ) >> - -This is like accept_targets, except that it specifies also that the -content of sections for this target should be treated as Pod text even -if the target name in "=for I<targetname>" doesn't start with a ":". - -At time of writing, I don't think you'll need to use this. - - -=item C<< $parser->accept_codes( I<Codename>, I<Codename>... ) >> - -This tells the parser that you accept additional formatting codes, -beyond just the standard ones (I B C L F S X, plus the two weird ones -you don't actually see in the parse tree, Z and E). For example, to also -accept codes "N", "R", and "W": - - $parser->accept_codes( qw( N R W ) ); - -B<TODO: document how this interacts with =extend, and long element names> - - -=item C<< $parser->accept_directive_as_data( I<directive_name> ) >> - -=item C<< $parser->accept_directive_as_verbatim( I<directive_name> ) >> - -=item C<< $parser->accept_directive_as_processed( I<directive_name> ) >> - -In the unlikely situation that you need to tell the parser that you will -accept additional directives ("=foo" things), you need to first set the -parset to treat its content as data (i.e., not really processed at -all), or as verbatim (mostly just expanding tabs), or as processed text -(parsing formatting codes like BE<lt>...E<gt>). - -For example, to accept a new directive "=method", you'd presumably -use: - - $parser->accept_directive_as_processed("method"); - -so that you could have Pod lines like: - - =method I<$whatever> thing B<um> - -Making up your own directives breaks compatibility with other Pod -formatters, in a way that using "=for I<target> ..." lines doesn't; -however, you may find this useful if you're making a Pod superset -format where you don't need to worry about compatibility. - - -=item C<< $parser->nbsp_for_S( I<BOOLEAN> ); >> - -Setting this attribute to a true value (and by default it is false) will -turn "SE<lt>...E<gt>" sequences into sequences of words separated by -C<\xA0> (non-breaking space) characters. For example, it will take this: - - I like S<Dutch apple pie>, don't you? - -and treat it as if it were: - - I like DutchE<nbsp>appleE<nbsp>pie, don't you? - -This is handy for output formats that don't have anything quite like an -"SE<lt>...E<gt>" code, but which do have a code for non-breaking space. - -There is currently no method for going the other way; but I can -probably provide one upon request. - - -=item C<< $parser->version_report() >> - -This returns a string reporting the $VERSION value from your module (and -its classname) as well as the $VERSION value of Pod::Simple. Note that -L<perlpodspec> requires output formats (wherever possible) to note -this detail in a comment in the output format. For example, for -some kind of SGML output format: - - print OUT "<!-- \n", $parser->version_report, "\n -->"; - - -=item C<< $parser->pod_para_count() >> - -This returns the count of Pod paragraphs seen so far. - - -=item C<< $parser->line_count() >> - -This is the current line number being parsed. But you might find the -"line_number" event attribute more accurate, when it is present. - - -=item C<< $parser->nix_X_codes( I<SOMEVALUE> ) >> - -This attribute, when set to a true value (and it is false by default) -ignores any "XE<lt>...E<gt>" sequences in the document being parsed. -Many formats don't actually use the content of these codes, so have -no reason to process them. - - -=item C<< $parser->merge_text( I<SOMEVALUE> ) >> - -This attribute, when set to a true value (and it is false by default) -makes sure that only one event (or token, or node) will be created -for any single contiguous sequence of text. For example, consider -this somewhat contrived example: - - I just LOVE Z<>hotE<32>apple pie! - -When that is parsed and events are about to be called on it, it may -actually seem to be four different text events, one right after another: -one event for "I just LOVE ", one for "hot", one for " ", and one for -"apple pie!". But if you have merge_text on, then you're guaranteed -that it will be fired as one text event: "I just LOVE hot apple pie!". - - -=item C<< $parser->code_handler( I<CODE_REF> ) >> - -This specifies code that should be called when a code line is seen -(i.e., a line outside of the Pod). Normally this is undef, meaning -that no code should be called. If you provide a routine, it should -start out like this: - - sub get_code_line { # or whatever you'll call it - my($line, $line_number, $parser) = @_; - ... - } - -Note, however, that sometimes the Pod events aren't processed in exactly -the same order as the code lines are -- i.e., if you have a file with -Pod, then code, then more Pod, sometimes the code will be processed (via -whatever you have code_handler call) before the all of the preceding Pod -has been processed. - - -=item C<< $parser->cut_handler( I<CODE_REF> ) >> - -This is just like the code_handler attribute, except that it's for -"=cut" lines, not code lines. The same caveats apply. "=cut" lines are -unlikely to be interesting, but this is included for completeness. - - -=item C<< $parser->whine( I<linenumber>, I<complaint string> ) >> - -This notes a problem in the Pod, which will be reported to in the "Pod -Errors" section of the document and/or send to STDERR, depending on the -values of the attributes C<no_whining>, C<no_errata_section>, and -C<complain_stderr>. - -=item C<< $parser->scream( I<linenumber>, I<complaint string> ) >> - -This notes an error like C<whine> does, except that it is not -suppressable with C<no_whining>. This should be used only for very -serious errors. - - -=item C<< $parser->source_dead(1) >> - -This aborts parsing of the current document, by switching on the flag -that indicates that EOF has been seen. In particularly drastic cases, -you might want to do this. It's rather nicer than just calling -C<die>! - -=item C<< $parser->hide_line_numbers( I<SOMEVALUE> ) >> - -Some subclasses that indescriminately dump event attributes (well, -except for ones beginning with "~") can use this object attribute for -refraining to dump the "start_line" attribute. - -=item C<< $parser->no_whining( I<SOMEVALUE> ) >> - -This attribute, if set to true, will suppress reports of non-fatal -error messages. The default value is false, meaning that complaints -I<are> reported. How they get reported depends on the values of -the attributes C<no_errata_section> and C<complain_stderr>. - -=item C<< $parser->no_errata_section( I<SOMEVALUE> ) >> - -This attribute, if set to true, will suppress generation of an errata -section. The default value is false -- i.e., an errata section will be -generated. - -=item C<< $parser->complain_stderr( I<SOMEVALUE> ) >> - -This attribute, if set to true will send complaints to STDERR. The -default value is false -- i.e., complaints do not go to STDERR. - -=item C<< $parser->bare_output( I<SOMEVALUE> ) >> - -Some formatter subclasses use this as a flag for whether output should -have prologue and epilogue code omitted. For example, setting this to -true for an HTML formatter class should omit the -"<html><head><title>...</title><body>..." prologue and the -"</body></html>" epilogue. - -If you want to set this to true, you should probably also set -C<no_whining> or at least C<no_errata_section> to true. - -=item C<< $parser->preserve_whitespace( I<SOMEVALUE> ) >> - -If you set this attribute to a true value, the parser will try to -preserve whitespace in the output. This means that such formatting -conventions as two spaces after periods will be preserved by the parser. -This is primarily useful for output formats that treat whitespace as -significant (such as text or *roff, but not HTML). - -=back - - -=head1 SEE ALSO - -L<Pod::Simple> -- event-based Pod-parsing framework - -L<Pod::Simple::Methody> -- like Pod::Simple, but each sort of event -calls its own method (like C<start_head3>) - -L<Pod::Simple::PullParser> -- a Pod-parsing framework like Pod::Simple, -but with a token-stream interface - -L<Pod::Simple::SimpleTree> -- a Pod-parsing framework like Pod::Simple, -but with a tree interface - -L<Pod::Simple::Checker> -- a simple Pod::Simple subclass that reads -documents, and then makes a plaintext report of any errors found in the -document - -L<Pod::Simple::DumpAsXML> -- for dumping Pod documents as tidily -indented XML, showing each event on its own line - -L<Pod::Simple::XMLOutStream> -- dumps a Pod document as XML (without -introducing extra whitespace as Pod::Simple::DumpAsXML does). - -L<Pod::Simple::DumpAsText> -- for dumping Pod documents as tidily -indented text, showing each event on its own line - -L<Pod::Simple::LinkSection> -- class for objects representing the values -of the TODO and TODO attributes of LE<lt>...E<gt> elements - -L<Pod::Escapes> -- the module the Pod::Simple uses for evaluating -EE<lt>...E<gt> content - -L<Pod::Simple::Text> -- a simple plaintext formatter for Pod - -L<Pod::Simple::TextContent> -- like Pod::Simple::Text, but -makes no effort for indent or wrap the text being formatted - -L<perlpod|perlpod> - -L<perlpodspec|perlpodspec> - -L<perldoc> - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - - -=for notes -Hm, my old podchecker version (1.2) says: - *** WARNING: node 'http://search.cpan.org/' contains non-escaped | or / at line 38 in file Subclassing.pod - *** WARNING: node 'http://lists.perl.org/showlist.cgi?name=pod-people' contains non-escaped | or / at line 41 in file Subclassing.pod -Yes, L<...> is hard. - - -=cut - - diff --git a/web/bin/lib/Pod/Simple/Text.pm b/web/bin/lib/Pod/Simple/Text.pm deleted file mode 100644 index df82c07..0000000 --- a/web/bin/lib/Pod/Simple/Text.pm +++ /dev/null @@ -1,152 +0,0 @@ - -require 5; -package Pod::Simple::Text; -use strict; -use Carp (); -use Pod::Simple::Methody (); -use Pod::Simple (); -use vars qw( @ISA $VERSION $FREAKYMODE); -$VERSION = '2.02'; -@ISA = ('Pod::Simple::Methody'); -BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG) - ? \&Pod::Simple::DEBUG - : sub() {0} - } - -use Text::Wrap 98.112902 (); -$Text::Wrap::wrap = 'overflow'; -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - $new->accept_target_as_text(qw( text plaintext plain )); - $new->nix_X_codes(1); - $new->nbsp_for_S(1); - $new->{'Thispara'} = ''; - $new->{'Indent'} = 0; - $new->{'Indentstring'} = ' '; - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub handle_text { $_[0]{'Thispara'} .= $_[1] } - -sub start_Para { $_[0]{'Thispara'} = '' } -sub start_head1 { $_[0]{'Thispara'} = '' } -sub start_head2 { $_[0]{'Thispara'} = '' } -sub start_head3 { $_[0]{'Thispara'} = '' } -sub start_head4 { $_[0]{'Thispara'} = '' } - -sub start_Verbatim { $_[0]{'Thispara'} = '' } -sub start_item_bullet { $_[0]{'Thispara'} = $FREAKYMODE ? '' : '* ' } -sub start_item_number { $_[0]{'Thispara'} = $FREAKYMODE ? '' : "$_[1]{'number'}. " } -sub start_item_text { $_[0]{'Thispara'} = '' } - -sub start_over_bullet { ++$_[0]{'Indent'} } -sub start_over_number { ++$_[0]{'Indent'} } -sub start_over_text { ++$_[0]{'Indent'} } -sub start_over_block { ++$_[0]{'Indent'} } - -sub end_over_bullet { --$_[0]{'Indent'} } -sub end_over_number { --$_[0]{'Indent'} } -sub end_over_text { --$_[0]{'Indent'} } -sub end_over_block { --$_[0]{'Indent'} } - - -# . . . . . Now the actual formatters: - -sub end_head1 { $_[0]->emit_par(-4) } -sub end_head2 { $_[0]->emit_par(-3) } -sub end_head3 { $_[0]->emit_par(-2) } -sub end_head4 { $_[0]->emit_par(-1) } -sub end_Para { $_[0]->emit_par( 0) } -sub end_item_bullet { $_[0]->emit_par( 0) } -sub end_item_number { $_[0]->emit_par( 0) } -sub end_item_text { $_[0]->emit_par(-2) } - -sub emit_par { - my($self, $tweak_indent) = splice(@_,0,2); - my $indent = ' ' x ( 2 * $self->{'Indent'} + 4 + ($tweak_indent||0) ); - # Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0 - - $self->{'Thispara'} =~ tr{\xAD}{}d if Pod::Simple::ASCII; - my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n"); - $out =~ tr{\xA0}{ } if Pod::Simple::ASCII; - print {$self->{'output_fh'}} $out, "\n"; - $self->{'Thispara'} = ''; - - return; -} - -# . . . . . . . . . . And then off by its lonesome: - -sub end_Verbatim { - my $self = shift; - if(Pod::Simple::ASCII) { - $self->{'Thispara'} =~ tr{\xA0}{ }; - $self->{'Thispara'} =~ tr{\xAD}{}d; - } - - my $i = ' ' x ( 2 * $self->{'Indent'} + 4); - #my $i = ' ' x (4 + $self->{'Indent'}); - - $self->{'Thispara'} =~ s/^/$i/mg; - - print { $self->{'output_fh'} } '', - $self->{'Thispara'}, - "\n\n" - ; - $self->{'Thispara'} = ''; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - - -__END__ - -=head1 NAME - -Pod::Simple::Text -- format Pod as plaintext - -=head1 SYNOPSIS - - perl -MPod::Simple::Text -e \ - "exit Pod::Simple::Text->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -This class is a formatter that takes Pod and renders it as -wrapped plaintext. - -Its wrapping is done by L<Text::Wrap>, so you can change -C<$Text::Wrap::columns> as you like. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::TextContent>, L<Pod::Text> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/TextContent.pm b/web/bin/lib/Pod/Simple/TextContent.pm deleted file mode 100644 index 3675b00..0000000 --- a/web/bin/lib/Pod/Simple/TextContent.pm +++ /dev/null @@ -1,87 +0,0 @@ - - -require 5; -package Pod::Simple::TextContent; -use strict; -use Carp (); -use Pod::Simple (); -use vars qw( @ISA $VERSION ); -$VERSION = '2.02'; -@ISA = ('Pod::Simple'); - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - $new->nix_X_codes(1); - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub _handle_element_start { - print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s; - return; -} - -sub _handle_text { - if( chr(65) eq 'A' ) { # in ASCIIworld - $_[1] =~ tr/\xAD//d; - $_[1] =~ tr/\xA0/ /; - } - print {$_[0]{'output_fh'}} $_[1]; - return; -} - -sub _handle_element_end { - print {$_[0]{'output_fh'}} "\n" unless $_[1] =~ m/^[A-Z]$/s; - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - - -__END__ - -=head1 NAME - -Pod::Simple::TextContent -- get the text content of Pod - -=head1 SYNOPSIS - - TODO - - perl -MPod::Simple::TextContent -e \ - "exit Pod::Simple::TextContent->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -This class is that parses Pod and dumps just the text content. It is -mainly meant for use by the Pod::Simple test suite, but you may find -some other use for it. - -This is a subclass of L<Pod::Simple> and inherits all its methods. - -=head1 SEE ALSO - -L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell> - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Simple/TiedOutFH.pm b/web/bin/lib/Pod/Simple/TiedOutFH.pm deleted file mode 100644 index b031fe5..0000000 --- a/web/bin/lib/Pod/Simple/TiedOutFH.pm +++ /dev/null @@ -1,103 +0,0 @@ - -use strict; -package Pod::Simple::TiedOutFH; -use Symbol ('gensym'); -use Carp (); - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub handle_on { # some horrible frightening things are encapsulated in here - my $class = shift; - $class = ref($class) || $class; - - Carp::croak "Usage: ${class}->handle_on(\$somescalar)" unless @_; - - my $x = (defined($_[0]) and ref($_[0])) - ? $_[0] - : ( \( $_[0] ) )[0] - ; - $$x = '' unless defined $$x; - - #Pod::Simple::DEBUG and print "New $class handle on $x = \"$$x\"\n"; - - my $new = gensym(); - tie *$new, $class, $x; - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub TIEHANDLE { # Ties to just a scalar ref - my($class, $scalar_ref) = @_; - $$scalar_ref = '' unless defined $$scalar_ref; - return bless \$scalar_ref, ref($class) || $class; -} - -sub PRINT { - my $it = shift; - foreach my $x (@_) { $$$it .= $x } - - #Pod::Simple::DEBUG > 10 and print " appended to $$it = \"$$$it\"\n"; - - return 1; -} - -sub FETCH { - return ${$_[0]}; -} - -sub PRINTF { - my $it = shift; - my $format = shift; - $$$it .= sprintf $format, @_; - return 1; -} - -sub FILENO { ${ $_[0] } + 100 } # just to produce SOME number - -sub CLOSE { 1 } - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1; -__END__ - -Chole - - * 1 large red onion - * 2 tomatillos - * 4 or 5 roma tomatoes (optionally with the pulp discarded) - * 1 tablespoons chopped ginger root (or more, to taste) - * 2 tablespoons canola oil (or vegetable oil) - - * 1 tablespoon garam masala - * 1/2 teaspoon red chili powder, or to taste - * Salt, to taste (probably quite a bit) - * 2 (15-ounce) cans chick peas or garbanzo beans, drained and rinsed - * juice of one smallish lime - * a dash of balsamic vinegar (to taste) - * cooked rice, preferably long-grain white rice (whether plain, - basmati rice, jasmine rice, or even a mild pilaf) - -In a blender or food processor, puree the onions, tomatoes, tomatillos, -and ginger root. You can even do it with a Braun hand "mixer", if you -chop things finer to start with, and work at it. - -In a saucepan set over moderate heat, warm the oil until hot. - -Add the puree and the balsamic vinegar, and cook, stirring occasionally, -for 20 to 40 minutes. (Cooking it longer will make it sweeter.) - -Add the Garam Masala, chili powder, and cook, stirring occasionally, for -5 minutes. - -Add the salt and chick peas and cook, stirring, until heated through. - -Stir in the lime juice, and optionally one or two teaspoons of tahini. -You can let it simmer longer, depending on how much softer you want the -garbanzos to get. - -Serve over rice, like a curry. - -Yields 5 to 7 servings. - - diff --git a/web/bin/lib/Pod/Simple/Transcode.pm b/web/bin/lib/Pod/Simple/Transcode.pm deleted file mode 100644 index 434f963..0000000 --- a/web/bin/lib/Pod/Simple/Transcode.pm +++ /dev/null @@ -1,33 +0,0 @@ - -require 5; -package Pod::Simple::Transcode; - -BEGIN { - if(defined &DEBUG) {;} # Okay - elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG; } - else { *DEBUG = sub () {0}; } -} - -foreach my $class ( - 'Pod::Simple::TranscodeSmart', - 'Pod::Simple::TranscodeDumb', - '', -) { - $class or die "Couldn't load any encoding classes"; - DEBUG and print "About to try loading $class...\n"; - eval "require $class;"; - if($@) { - DEBUG and print "Couldn't load $class: $@\n"; - } else { - DEBUG and print "OK, loaded $class.\n"; - @ISA = ($class); - last; - } -} - -sub _blorp { return; } # just to avoid any "empty class" warning - -1; -__END__ - - diff --git a/web/bin/lib/Pod/Simple/TranscodeDumb.pm b/web/bin/lib/Pod/Simple/TranscodeDumb.pm deleted file mode 100644 index d5eb7e5..0000000 --- a/web/bin/lib/Pod/Simple/TranscodeDumb.pm +++ /dev/null @@ -1,63 +0,0 @@ - -require 5; -## This module is to be use()'d only by Pod::Simple::Transcode - -package Pod::Simple::TranscodeDumb; -use strict; -use vars qw($VERSION %Supported); -$VERSION = '2.02'; -# This module basically pretends it knows how to transcode, except -# only for null-transcodings! We use this when Encode isn't -# available. - -%Supported = ( - 'ascii' => 1, - 'ascii-ctrl' => 1, - 'iso-8859-1' => 1, - 'null' => 1, - 'latin1' => 1, - 'latin-1' => 1, - %Supported, -); - -sub is_dumb {1} -sub is_smart {0} - -sub all_encodings { - return sort keys %Supported; -} - -sub encoding_is_available { - return exists $Supported{lc $_[1]}; -} - -sub encmodver { - return __PACKAGE__ . " v" .($VERSION || '?'); -} - -sub make_transcoder { - my($e) = $_[1]; - die "WHAT ENCODING!?!?" unless $e; - my $x; - return sub {; - #foreach $x (@_) { - # if(Pod::Simple::ASCII and !Pod::Simple::UNICODE and $] > 5.005) { - # # We're in horrible gimp territory, so we need to knock out - # # all the highbit things - # $x = - # pack 'C*', - # map {; ($_ < 128) ? $_ : 0x7e } - # unpack "C*", - # $x - # ; - # } - #} - # - #return; - }; -} - - -1; - - diff --git a/web/bin/lib/Pod/Simple/TranscodeSmart.pm b/web/bin/lib/Pod/Simple/TranscodeSmart.pm deleted file mode 100644 index 3fc26a4..0000000 --- a/web/bin/lib/Pod/Simple/TranscodeSmart.pm +++ /dev/null @@ -1,42 +0,0 @@ - -require 5; -use 5.008; -## Anything before 5.8.0 is GIMPY! -## This module is to be use()'d only by Pod::Simple::Transcode - -package Pod::Simple::TranscodeSmart; -use strict; -use Pod::Simple; -require Encode; - -sub is_dumb {0} -sub is_smart {1} - -sub all_encodings { - return Encode::->encodings(':all'); -} - -sub encoding_is_available { - return Encode::resolve_alias($_[1]); -} - -sub encmodver { - return "Encode.pm v" .($Encode::VERSION || '?'); -} - -sub make_transcoder { - my($e) = $_[1]; - die "WHAT ENCODING!?!?" unless $e; - my $x; - return sub { - foreach $x (@_) { - $x = Encode::decode($e, $x); - } - return; - }; -} - - -1; - - diff --git a/web/bin/lib/Pod/Simple/XMLOutStream.pm b/web/bin/lib/Pod/Simple/XMLOutStream.pm deleted file mode 100644 index 1e7ec15..0000000 --- a/web/bin/lib/Pod/Simple/XMLOutStream.pm +++ /dev/null @@ -1,157 +0,0 @@ - -require 5; -package Pod::Simple::XMLOutStream; -use strict; -use Carp (); -use Pod::Simple (); -use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS); -$VERSION = '2.02'; -BEGIN { - @ISA = ('Pod::Simple'); - *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG; -} - -$ATTR_PAD = "\n" unless defined $ATTR_PAD; - # Don't mess with this unless you know what you're doing. - -$SORT_ATTRS = 0 unless defined $SORT_ATTRS; - -sub new { - my $self = shift; - my $new = $self->SUPER::new(@_); - $new->{'output_fh'} ||= *STDOUT{IO}; - #$new->accept_codes('VerbatimFormatted'); - return $new; -} - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -sub _handle_element_start { - # ($self, $element_name, $attr_hash_r) - my $fh = $_[0]{'output_fh'}; - my($key, $value); - DEBUG and print "++ $_[1]\n"; - print $fh "<", $_[1]; - if($SORT_ATTRS) { - foreach my $key (sort keys %{$_[2]}) { - unless($key =~ m/^~/s) { - next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; - _xml_escape($value = $_[2]{$key}); - print $fh $ATTR_PAD, $key, '="', $value, '"'; - } - } - } else { # faster - while(($key,$value) = each %{$_[2]}) { - unless($key =~ m/^~/s) { - next if $key eq 'start_line' and $_[0]{'hide_line_numbers'}; - _xml_escape($value); - print $fh $ATTR_PAD, $key, '="', $value, '"'; - } - } - } - print $fh ">"; - return; -} - -sub _handle_text { - DEBUG and print "== \"$_[1]\"\n"; - if(length $_[1]) { - my $text = $_[1]; - _xml_escape($text); - print {$_[0]{'output_fh'}} $text; - } - return; -} - -sub _handle_element_end { - DEBUG and print "-- $_[1]\n"; - print {$_[0]{'output_fh'}} "</", $_[1], ">"; - return; -} - -# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -sub _xml_escape { - foreach my $x (@_) { - # Escape things very cautiously: - $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg; - # Yes, stipulate the list without a range, so that this can work right on - # all charsets that this module happens to run under. - # Altho, hmm, what about that ord? Presumably that won't work right - # under non-ASCII charsets. Something should be done about that. - } - return; -} - -#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -1; - -__END__ - -=head1 NAME - -Pod::Simple::XMLOutStream -- turn Pod into XML - -=head1 SYNOPSIS - - perl -MPod::Simple::XMLOutStream -e \ - "exit Pod::Simple::XMLOutStream->filter(shift)->any_errata_seen" \ - thingy.pod - -=head1 DESCRIPTION - -Pod::Simple::XMLOutStream is a subclass of L<Pod::Simple> that parses -Pod and turns it into XML. - -Pod::Simple::XMLOutStream inherits methods from -L<Pod::Simple>. - - -=head1 SEE ALSO - -L<Pod::Simple::DumpAsXML> is rather like this class; see its -documentation for a discussion of the differences. - -L<Pod::Simple>, L<Pod::Simple::DumpAsXML>, L<Pod::SAX> - -L<Pod::Simple::Subclassing> - -The older (and possibly obsolete) libraries L<Pod::PXML>, L<Pod::XML> - - -=head1 ABOUT EXTENDING POD - -TODO: An example or two of =extend, then point to Pod::Simple::Subclassing - - -=head1 ASK ME! - -If you actually want to use Pod as a format that you want to render to -XML (particularly if to an XML instance with more elements than normal -Pod has), please email me (C<sburke@cpan.org>) and I'll probably have -some recommendations. - -For reasons of concision and energetic laziness, some methods and -options in this module (and the dozen modules it depends on) are -undocumented; but one of those undocumented bits might be just what -you're looking for. - - -=head1 COPYRIGHT AND DISCLAIMERS - -Copyright (c) 2002-4 Sean M. Burke. All rights reserved. - -This library is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -This program is distributed in the hope that it will be useful, but -without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. - -=head1 AUTHOR - -Sean M. Burke C<sburke@cpan.org> - -=cut - diff --git a/web/bin/lib/Pod/Xhtml.pm b/web/bin/lib/Pod/Xhtml.pm deleted file mode 100644 index d83cc24..0000000 --- a/web/bin/lib/Pod/Xhtml.pm +++ /dev/null @@ -1,908 +0,0 @@ -# $Id: Xhtml.pm,v 1.59 2007/08/02 12:24:15 andreww Exp $ -package Pod::Xhtml; - -use strict; -use Pod::Parser; -use Pod::ParseUtils; -use Carp; -use vars qw/@ISA %COMMANDS %SEQ $VERSION $FirstAnchorId $ContentSuffix/; -use constant P2X_REGION => qr/(?:pod2)?xhtml/; - -$FirstAnchorId = "TOP"; -$ContentSuffix = "-CONTENT"; - -@ISA = qw(Pod::Parser); -($VERSION) = ('$Revision: 1.59 $' =~ m/([\d\.]+)/); - -# recognized commands -%COMMANDS = map { $_ => 1 } qw(pod head1 head2 head3 head4 item over back for begin end); - -# recognized special sequences -%SEQ = ( - B => \&seqB, - C => \&seqC, - E => \&seqE, - F => \&seqF, - I => \&seqI, - L => \&seqL, - S => \&seqS, - X => \&seqX, - Z => \&seqZ, -); - - -########## New PUBLIC methods for this class -sub asString { my $self = shift; return $self->{buffer}; } -sub asStringRef { my $self = shift; return \$self->{buffer}; } -sub addHeadText { my $self = shift; $self->{HeadText} .= shift; } -sub addBodyOpenText { my $self = shift; $self->{BodyOpenText} .= shift; } -sub addBodyCloseText { my $self = shift; $self->{BodyCloseText} .= shift; } - -########## Override methods in Pod::Parser -########## PUBLIC INTERFACE -sub parse_from_file { - my $self = shift; - $self->resetMe; - $self->SUPER::parse_from_file(@_); -} - -sub parse_from_filehandle { - my $self = shift; - $self->resetMe; - $self->SUPER::parse_from_filehandle(@_); -} - -########## INTERNALS -sub initialize { - my $self = shift; - - $self->{TopLinks} = qq(<p><a href="#<<<G?$FirstAnchorId>>>" class="toplink">Top</a></p>) unless defined $self->{TopLinks}; - $self->{MakeIndex} = 1 unless defined $self->{MakeIndex}; - $self->{MakeMeta} = 1 unless defined $self->{MakeMeta}; - $self->{FragmentOnly} = 0 unless defined $self->{FragmentOnly}; - $self->{HeadText} = $self->{BodyOpenText} = $self->{BodyCloseText} = ''; - $self->{LinkParser} ||= new Pod::Hyperlink; - $self->{TopHeading} ||= 1; - $self->{TopHeading} = int $self->{TopHeading}; # heading level must be an integer - croak "TopHeading must be greater than zero" if $self->{TopHeading} < 1; # (prevent negative heading levels) - $self->SUPER::initialize(); -} - -sub command { - my ($parser, $command, $paragraph, $line_num, $pod_para) = @_; - my $ptree = $parser->parse_text( $paragraph, $line_num ); - $pod_para->parse_tree( $ptree ); - $parser->parse_tree->append( $pod_para ); -} - -sub verbatim { - my ($parser, $paragraph, $line_num, $pod_para) = @_; - $parser->parse_tree->append( $pod_para ); -} - -sub textblock { - my ($parser, $paragraph, $line_num, $pod_para) = @_; - my $ptree = $parser->parse_text( $paragraph, $line_num ); - $pod_para->parse_tree( $ptree ); - $parser->parse_tree->append( $pod_para ); -} - -sub end_pod { - my $self = shift; - my $ptree = $self->parse_tree; - - # clean up tree ready for parse - foreach my $para (@$ptree) { - if ($para->{'-prefix'} eq '=') { - $para->{'TYPE'} = 'COMMAND'; - } elsif (! @{$para->{'-ptree'}}) { - $para->{'-ptree'}->[0] = $para->{'-text'}; - $para->{'TYPE'} = 'VERBATIM'; - } else { - $para->{'TYPE'} = 'TEXT'; - } - foreach (@{$para->{'-ptree'}}) { - unless (ref $_) { s/\n\s+$//; } - } - } - - # now loop over each para and expand any html escapes or sequences - $self->_paraExpand( $_ ) foreach (@$ptree); - - $self->{buffer} =~ s/(\n?)<\/pre>\s*<pre>/$1/sg; # concatenate 'pre' blocks - 1 while $self->{buffer} =~ s/<pre>(\s+)<\/pre>/$1/sg; - $self->{buffer} = $self->_makeIndex . $self->{buffer} if $self->{MakeIndex}; - $self->{buffer} =~ s/<<<G\?($FirstAnchorId)>>>/$1/ge; - $self->{buffer} = join "\n", qq[<div class="pod">], $self->{buffer}, - ( @{ $self->{sections} } > 1 && "</div>" ), "</div>"; - - # Expand internal L<> links to the correct sections - $self->{buffer} =~ s/#<<<(.*?)>>>/'#' . $self->_findSection($1)/eg; - die "gotcha" if $self->{buffer} =~ /#<<</; - - my $headblock = sprintf "%s\n%s\n%s\n\t<title>%s</title>\n", - qq(<?xml version="1.0" encoding="UTF-8"?>), - qq(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">), - qq(<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\n<head>), - _htmlEscape( $self->{doctitle} ); - $headblock .= $self->_makeMeta if $self->{MakeMeta}; - - unless ($self->{FragmentOnly}) { - $self->{buffer} = $headblock . $self->{HeadText} . "</head>\n<body>\n" . $self->{BodyOpenText} . $self->{buffer}; - $self->{buffer} .= $self->{BodyCloseText} . "</body>\n</html>\n"; - } - - # in stringmode we only accumulate the XHTML else we print it to the - # filehandle - unless ($self->{StringMode}) { - my $out_fh = $self->output_handle; - print $out_fh $self->{buffer}; - } -} - -########## Everything else is PRIVATE -sub resetMe { - my $self = shift; - $self->{'-ptree'} = new Pod::ParseTree; - $self->{'sections'} = []; - $self->{'listKind'} = []; - $self->{'listHasItems'} = []; - $self->{'dataSections'} = []; - $self->{'section_names'} = {}; - $self->{'section_ids'} = {}; - $self->{'tagStack'} = []; - - foreach (qw(inList titleflag )) { $self->{$_} = 0; } - foreach (qw(buffer doctitle)) { $self->{$_} = ''; } - - # add the "$FirstAnchor" section into the sections - $self->_addSection ( '', $FirstAnchorId ); -} - -sub parse_tree { return $_[0]->{'-ptree'}; } - -sub _paraExpand { - my $self = shift; - my $para = shift; - - # skip data region unless its ident matches P2X_REGION (eg xhtml) - my $in_dsection = !!(@{$self->{dataSections}}); - my $p2x_region = $in_dsection && $self->{dataSections}->[-1] =~ P2X_REGION; - my $skip_region = $in_dsection && !$p2x_region; - - # collapse interior sequences and strings - # escape html unless it's a html data region - foreach ( @{$para->{'-ptree'}} ) { - $_ = (ref $_) ? $self->_handleSequence($_, $p2x_region) : - $p2x_region ? $_ : _htmlEscape($_); - } - # the parse tree has now been collapsed into a list of strings - my $string = join('', @{$para->{'-ptree'}}); - - if ($para->{TYPE} eq 'TEXT') { - return if $skip_region; - $self->_addTextblock($string, $p2x_region); - } elsif ($para->{TYPE} eq 'VERBATIM') { - return if $skip_region; - my $paragraph = "<pre>$string\n\n</pre>"; - $self->_addTextblock( $paragraph, 1 ); # no wrap - if ($self->{titleflag} != 0) { - $self->_setTitle( $paragraph ); - warn "NAME followed by verbatim paragraph"; - } - } elsif ($para->{TYPE} eq 'COMMAND') { - $self->_addCommand($para->{'-name'}, $string, $para->{'-text'}, $para->{'-line'} ) - } else { - warn "Unrecognized paragraph type $para->{TYPE} found at $self->{_INFILE} line $para->{'-line'}\n"; - } -} - -sub _addCommand { - my $self = shift; - my ($command, $paragraph, $raw_para, $line) = @_; - my $anchor; - - unless (exists $COMMANDS{$command}) { - warn "Unrecognized command '$command' skipped at $self->{_INFILE} line $line\n"; - return; - } - - for ($command) { - my $data_para = @{$self->{dataSections}}; # inside a data paragraph? - /^head1/ && !$data_para && do { - my $top_heading = 'h'. $self->{TopHeading}; - $top_heading = 'h1' if !$self->{FragmentOnly}; # ignore TopHeading when not in fragment mode - - # if ANY sections are open then close the previously opened div - $self->{buffer} .= "\n</div>\n" unless ( @{ $self->{sections} } == 1 ); - - $anchor = $self->_addSection( 'head1', $paragraph ); - my $anchorContent = $self->_addSection( '', $paragraph . $ContentSuffix); - - $self->{buffer} .= qq(<$top_heading id="$anchor">$paragraph</$top_heading>) - .($self->{TopLinks} ? $self->{TopLinks} : '')."\n" - ."<div id=\"$anchorContent\">\n"; - - if ($anchor eq 'NAME') { $self->{titleflag} = 1; } - last; - }; - /^head([234])/ && !$data_para && do { - my $head_level = $1; - if($self->{FragmentOnly}){ - $head_level += ($self->{TopHeading} - 1); - $head_level = 6 if $head_level > 6; - } - # if ANY sections are open then close the previously opened div - $self->{buffer} .= "\n</div>\n" unless ( @{ $self->{sections} } == 1 ); - - $anchor = $self->_addSection( "head${head_level}", $paragraph ); - my $anchorContent = $self->_addSection( '', $paragraph . $ContentSuffix); - - $self->{buffer} .= "<h${head_level} id=\"$anchor\">$paragraph</h${head_level}>\n" . "<div id=\"$anchorContent\">\n"; - last; - }; - /^item/ && !$data_para && do { - unless ($self->{inList}) { - warn "Not in list at $self->{_INFILE} line $line\n"; - last; - } - - $self->{listHasItems}[-1]++; - $self->{listCurrentParas}[-1] = 0; - - # is this the first item in the list? - if (@{$self->{listKind}} && $self->{listKind}[-1] == 0) { - my $parent_list = $self->{listKind}[-2]; # this is a sub-list - if ($parent_list && $parent_list == 1) { - # <ul> sub lists must be in an <li> [BEGIN] - $self->{buffer} .= $self->_tagLevel () . "<li>\n"; - push @{$self->{tagStack}}, "li"; - } elsif ($parent_list && $parent_list == 2) { - # <dl> sub lists must be in a <p> [BEGIN] - $self->{buffer} .= $self->_tagLevel () . "<p>\n"; - push @{$self->{tagStack}}, "p"; - } - - if ($paragraph eq '*') { - $self->{listKind}[-1] = 1; - $self->{buffer} .= $self->_tagLevel () . "<ul>\n"; - push @{$self->{tagStack}}, "ul"; - } else { - $self->{listKind}[-1] = 2; - $self->{buffer} .= $self->_tagLevel () . "<dl>\n"; - push @{$self->{tagStack}}, "dl"; - } - } else { - # close last list item's tag# - if ($self->{listKind}[-1] == 1) { - my $o = pop @{$self->{tagStack}}; - warn "expected 'li' to be on the tag stack but got '$o'\n" - if $o ne 'li'; - $self->{buffer} .= $self->_tagLevel () . "</li>\n"; - } - } - if (@{$self->{listKind}} && $self->{listKind}[-1] == 2) { - if (@{$self->{tagStack}} && $self->{tagStack}[-1] eq "dd") { - my $o = pop @{$self->{tagStack}}; - warn "expected 'dd' to be on the tag stack but got '$o'\n" - if $o ne 'dd'; - $self->{buffer} .= $self->_tagLevel () . "</dd>\n"; - } - $self->{buffer} .= $self->_tagLevel () . qq(<dt); - push @{$self->{tagStack}}, "dt"; - if ($self->{MakeIndex} >= 2) { - $anchor = $self->_addSection( 'item', $paragraph ); - $self->{buffer} .= qq( id="$anchor"); - } - $self->{buffer} .= ">"; - $self->{buffer} .= qq($paragraph</dt>\n); - my $o = pop @{$self->{tagStack}}; - warn "expected 'dt' to be on the tag stack but got '$o'\n" - if $o ne 'dt'; - } - last; - }; - /^over/ && !$data_para && do { - $self->{inList}++; - push @{$self->{listKind}}, 0; - push @{$self->{listHasItems}}, 0; - push @{$self->{sections}}, 'over' if $self->{MakeIndex} >= 2; - push @{$self->{listCurrentParas}}, 0; - }; - /^back/ && !$data_para && do { - my $listItems = pop @{$self->{listHasItems}}; - if (--$self->{inList} < 0) { - warn "=back commands don't balance =overs at $self->{_INFILE} line $line\n"; - last; - } elsif ($listItems == 0) { - warn "empty list at $self->{_INFILE} line $line\n"; - last; - } elsif (@{$self->{listKind}} && $self->{listKind}[-1] == 1) { - my $o = pop @{$self->{tagStack}}; - warn "expected 'li' to be on the tag stack but got '$o'\n" - if $o ne 'li'; - $o = pop @{$self->{tagStack}}; - warn "expected 'ul' to be on the tag stack but got '$o'\n" - if $o ne 'ul'; - $self->{buffer} .= "</li>\n</ul>\n\n"; - } else { - while (@{$self->{tagStack}} && $self->{tagStack}[-1] eq "dd") { - pop @{$self->{tagStack}}; - $self->{buffer} .=$self->_tagLevel () . "</dd>\n"; - } - my $o = pop @{$self->{tagStack}}; - warn "expected 'dl' to be on the tag stack but got '$o'\n" - if $o ne 'dl'; - $self->{buffer} .= $self->_tagLevel () . "</dl>\n"; - } - - my $parent_list = $self->{listKind}[-2]; # this is a sub-list - if ($parent_list && $parent_list == 1) { - my $o = pop @{$self->{tagStack}}; - warn "expected 'li' to be on the tag stack but got '$o'\n" - if $o ne 'li'; - # <ul> sub lists must be in an <li> [END] - $self->{buffer} .= $self->_tagLevel () . "</li>\n"; - } - if ($parent_list && $parent_list == 2) { - my $o = pop @{$self->{tagStack}}; - warn "expected 'p' to be on the tag stack but got '$o'\n" - if $o ne 'p'; - # <dl> sub lists must be in a <p> [END] - $self->{buffer} .= $self->_tagLevel () . "</p>\n"; - } - - if ( $self->{MakeIndex} >= 2 ) { - if ( ! ref $self->{sections}->[ -1 ] ) { - if ( $self->{sections}->[ -1 ] =~ /^over$/i ) { - pop @{ $self->{sections} }; - } - } else { - if ( $self->{sections}->[ -1 ] [ 0 ] =~ /^item$/i ) { - push @{ $self->{sections} }, 'back'; - } - } - } - - pop @{$self->{listKind}}; - pop @{$self->{listCurrentParas}}; - last; - }; - /^for/ && !$data_para && do { - my($ident, $html) = $raw_para =~ /^\s*(\S+)\s+(.*)/; - $html = undef unless $ident =~ P2X_REGION; - $self->{buffer} .= $html if $html; - }; - /^begin/ && !$data_para && do { - my ($ident) = $paragraph =~ /(\S+)/; - push @{$self->{dataSections}}, $ident; - last; - }; - /^end/ && do { - my ($ident) = $paragraph =~ /(\S+)/; - unless (@{$self->{dataSections}}) { - warn "no corresponding '=begin $ident' marker at $self->{_INFILE} line $line\n"; - last; - } - my $current_section = $self->{dataSections}[-1]; - unless ($current_section eq $ident) { - warn "'=end $ident' doesn't match '=begin $current_section' at $self->{_INFILE} line $line\n"; - last; - } - pop @{$self->{dataSections}}; - last; - }; - } -} - -sub _addTextblock { - my $self = shift; - my($paragraph, $no_wrap) = @_; - - if ($self->{titleflag} != 0) { $self->_setTitle( $paragraph ); } - - # DON'T wrap a paragraph in a <p> if it's a <pre>! - $no_wrap = 1 if $paragraph =~ m/^\s*<pre>/im; - - if (! @{$self->{listKind}} || $self->{listKind}[-1] == 0) { - if (!$no_wrap) { - $self->{buffer} .= $self->_tagLevel () . "<p>$paragraph</p>\n"; - } else { - $self->{buffer} .= "$paragraph\n"; - } - } elsif (@{$self->{listKind}} && $self->{listKind}[-1] == 1) { - if ($self->{listCurrentParas}[-1]++ == 0) { - # should this list item be closed? - push @{$self->{tagStack}}, "li"; - $self->{buffer} .= $self->_tagLevel () . "<li>$paragraph"; - } else { - $self->{buffer} .= "\n<br /><br />$paragraph"; - } - } else { - if ($self->{listCurrentParas}[-1]++ == 0) { - $self->{buffer} .= $self->_tagLevel () . "<dd>\n"; - push @{$self->{tagStack}}, "dd"; - } - - if (!$no_wrap) { - $self->{buffer} .= $self->_tagLevel () . "<p>$paragraph</p>\n"; - } else { - $self->{buffer} .= "$paragraph\n"; - } - } -} - -sub _tagLevel { - my $self = shift; - return ( "\t" x scalar @{$self->{tagStack}} ); -} - -# expand interior sequences recursively, bottom up -sub _handleSequence { - my $self = shift; - my($seq, $no_escape) = @_; - my $buffer = ''; - - foreach (@{$seq->{'-ptree'}}) { - if (ref $_) { - $buffer .= $self->_handleSequence($_); - } else { - $buffer .= $no_escape ? $_ : _htmlEscape($_); - } - } - - unless (exists $SEQ{$seq->{'-name'}}) { - warn "Unrecognized special sequence '$seq->{'-name'}' skipped at $self->{_INFILE} line $seq->{'-line'}\n"; - return $buffer; - } - return $SEQ{$seq->{'-name'}}->($self, $buffer); -} - -sub _makeIndexId { - my $arg = shift; - - $arg =~ s/\W+/_/g; - $arg =~ s/^_+|_+$//g; - $arg =~ s/__+/_/g; - $arg = substr($arg, 0, 36); - return $arg; -} - -sub _addSection { - my $self = shift; - my ($type, $htmlarg) = @_; - return unless defined $htmlarg; - - my $index_id; - if ($self->{section_names}{$htmlarg}) { - $index_id = $self->{section_names}{$htmlarg}; - } else { - $index_id = _makeIndexId($htmlarg); - } - - if ($self->{section_ids}{$index_id}++) { - $index_id .= "-" . $self->{section_ids}{$index_id}; - } - - # if {section_names}{$htmlarg} is already set then this is a duplicate 'id', - # so keep the reference to the first one - $self->{section_names}{$htmlarg} = $index_id - unless exists $self->{section_names}{$htmlarg}; - - push( @{$self->{sections}}, [$type, $index_id, $htmlarg]); - return $index_id; -} - -sub _findSection { - my $self = shift; - my ($htmlarg) = @_; - - my $index_id; - if ($index_id = $self->{section_names}{$htmlarg}) { - return $index_id; - } else { - return _makeIndexId($htmlarg); - } -} - -sub _get_elem_level { - my $elem = shift; - if (ref($elem)) { - my $type = $elem->[0]; - if ($type =~ /^head(\d+)$/) { - return $1; - } else { - return 0; - } - } else { - return 0; - } -} - -sub _makeTabbing { - my $level = shift || 0; - - return "\n" . ( "\t" x $level ); -} - -sub _makeIndex { - my $self = shift; - - my $string = "<!-- INDEX START -->\n<h3 id=\"$FirstAnchorId\">Index</h3>\n"; - - my $previous_level = 0; - my $previous_section = ''; - - SECTION: foreach my $section ( @{ $self->{sections} } ) - { - my $this_level = 0; - - if ( ! ref $section ) - { - for ( $section ) - { - if ( $section =~ m/^over$/i ) - { - $previous_level++; - $string .= ( $previous_section ne 'over' && "</li>\n" ) . - "<li>\n<ul>\n"; - } - elsif ( $section =~ m/^back$/i ) - { - $previous_level--; - $string .= "\n</li>\n</ul>"; - } - } - - $previous_section = $section; - } - else - { - my ( $type, $href, $name ) = @$section; - - if ( $section->[ 0 ] =~ m/^item$/i ) - { - $this_level = $previous_level; - } - else - { - $this_level = _get_elem_level ( $section ); - } - - next SECTION if $this_level == 0; - - if ( $this_level > $previous_level ) - { - # open new list(s) - $string .= "\n<ul>" . - ( "\n<li>\n<ul>" ) x ( $this_level - $previous_level - 1 ); - } - elsif ( $this_level < $previous_level ) - { - # close list(s) - $string .= "</li>\n" . - ( "</ul>\n</li>\n" ) x ( $previous_level - $this_level ); - } - else - { - $string .= "</li>\n" unless $previous_section =~ /^over$/i; - } - - $string .= '<li><a href="#' . $href . '">' . $name . '</a>'; - - $previous_level = $this_level; - - $previous_section = ( ref $section ? $section->[ 0 ] : $section ); - } - } - - $string .= ( "\n</li>\n</ul>" x $previous_level ); - $string .= "<hr />\n<!-- INDEX END -->\n\n"; - - return $string; -} - -sub _makeMeta { - my $self = shift; - return - qq(\t<meta name="description" content="Pod documentation for ) . _htmlEscape( $self->{doctitle} ) . qq(" />\n) - . qq(\t<meta name="inputfile" content=") . _htmlEscape( $self->input_file ) . qq(" />\n) - . qq(\t<meta name="outputfile" content=") . _htmlEscape( $self->output_file ) . qq(" />\n) - . qq(\t<meta name="created" content=") . _htmlEscape( scalar(localtime) ) . qq(" />\n) - . qq(\t<meta name="generator" content="Pod::Xhtml $VERSION" />\n); -} - -sub _setTitle { - my $self = shift; - my $paragraph = shift; - - if ($paragraph =~ m/^(.+?) - /) { - $self->{doctitle} = $1; - } elsif ($paragraph =~ m/^(.+?): /) { - $self->{doctitle} = $1; - } elsif ($paragraph =~ m/^(.+?)\.pm/) { - $self->{doctitle} = $1; - } else { - $self->{doctitle} = substr($paragraph, 0, 80); - } - $self->{titleflag} = 0; -} - -sub _htmlEscape { - my $txt = shift; - $txt =~ s/&/&/g; - $txt =~ s/</</g; - $txt =~ s/>/>/g; - $txt =~ s/\"/"/g; - return $txt; -} - -########## Sequence handlers -sub seqI { return '<i>' . $_[1] . '</i>'; } -sub seqB { return '<strong>' . $_[1] . '</strong>'; } -sub seqC { return '<code>' . $_[1] . '</code>'; } -sub seqF { return '<cite>' . $_[1] . '</cite>'; } -sub seqZ { return ''; } - -sub seqL { - my ($self, $link) = @_; - $self->{LinkParser}->parse( $link ); - - my $page = $self->{LinkParser}->page; - my $kind = $self->{LinkParser}->type; - my $string = ''; - - if ($kind eq 'hyperlink') { #easy, a hyperlink - my $targ = $self->{LinkParser}->node; - my $text = $self->{LinkParser}->text; - $string = qq(<a href="$targ">$text</a>); - } elsif ($kind =~ m/^bounceurl:(.+)$/) { - # Our link-parser has decided that the link should be handled by a particular URL - my $url = $1; - $url = _htmlEscape( $url ); # since the URL may contain ampersands - $string = $self->{LinkParser}->markup; - if ($string =~ m/P<.+>/) { # when there's no alternative text we get P, and maybe Q - $string =~ s|Q<(.+?)>|<strong class="pod_xhtml_bounce_url_text">$1</strong>|; - $string =~ s|P<(.+?)>|<a class="pod_xhtml_bounce_url" href="$url">$1</a>|; - } else { - $string =~ s|Q<(.+?)>|<a class="pod_xhtml_bounce_url" href="$url">$1</a>|; - } - } elsif ($page eq '') { # a link to this page - # Post-process these links so we can things up to the correct sections - my $targ = $self->{LinkParser}->node; - $string = $self->{LinkParser}->markup; - $string =~ s|Q<(.+?)>|<a href="#<<<$targ>>>">$1</a>|; - } elsif ($link !~ /\|/) { # a link off-page with _no_ alt text - $string = $self->{LinkParser}->markup; - $string =~ s|Q<(.+?)>|<b>$1</b>|; - $string =~ s|P<(.+?)>|<cite>$1</cite>|; - } else { # a link off-page with alt text - my $text = _htmlEscape( $self->{LinkParser}->text ); - my $targ = _htmlEscape( $self->{LinkParser}->node ); - $string = "<b>$text</b> ("; - $string .= "<b>$targ</b> in " if $targ; - $string .= "<cite>$page</cite>)"; - } - return $string; -} - -sub seqS { - my $text = $_[1]; - $text =~ s/\s/ /g; - return $text; -} - -sub seqX { - my $self = shift; - my $arg = shift; - my $anchor = $self->_addSection( 'head1', $arg ); - return qq[<span id="$anchor">$arg</span>]; -} - -sub seqE { - my $self = shift; - my $arg = shift; - my $rv; - - if ($arg eq 'sol') { - $rv = '/'; - } elsif ($arg eq 'verbar') { - $rv = '|'; - } elsif ($arg =~ /^\d$/) { - $rv = "&#$arg;"; - } elsif ($arg =~ /^0?x(\d+)$/) { - $rv = $1; - } else { - $rv = "&$arg;"; - } - return $rv; -} -1; -__END__ - -=head1 NAME - -Pod::Xhtml - Generate well-formed XHTML documents from POD format documentation - -=head1 SYNOPSIS - -This module inherits from Pod::Parser, hence you can use this familiar -interface: - - use Pod::Xhtml; - my $parser = new Pod::Xhtml; - $parser->parse_from_file( $infile, $outfile ); - - # or use filehandles instead - $parser->parse_from_filehandle($in_fh, $out_fh); - - # or get the XHTML as a scalar - my $parsertoo = new Pod::Xhtml( StringMode => 1 ); - $parsertoo->parse_from_file( $infile, $outfile ); - my $xhtml = $parsertoo->asString; - - # or get a reference to the XHTML string - my $xhtmlref = $parsertoo->asStringRef; - - # to parse some other pod file to another output file all you need to do is... - $parser->parse_from_file( $anotherinfile, $anotheroutfile ); - -There are options specific to Pod::Xhtml that you can pass in at construction -time, e.g.: - - my $parser = new Pod::Xhtml(StringMode => 1, MakeIndex => 0); - -See L<"OPTIONS">. For more information also see L<Pod::Parser> which this -module inherits from. - -=head1 DESCRIPTION - -=over 4 - -=item new Pod::Xhtml( [ OPTIONS ] ) - -Create a new object. Optionally pass in some options in the form -C<'new Pod::Xhtml( StringMode =E<gt> 1);'> - -=item $parser->parse_from_file( INPUTFILE, [OUTPUTFILE] ) - -Read POD from the input file, output to the output file (or STDOUT if no -file is given). See Pod::Parser docs for more. -Note that you can parse multiple files with the same object. All your options -will be preserved, as will any text you added with the add*Text methods. - -=item $parser->parse_from_filehandle( [INPUTFILEHANDLE, [OUTPUTFILEHANDLE]] ) - -Read POD from the input filehandle, output to the output filehandle -(STDIN/STDOUT if no filehandle(s) given). See Pod::Parser docs for more. Note -that you can parse multiple files with the same object. All your options will -be preserved, as will any text you added with the add*Text methods. - -=item $parser->asString - -Get the XHTML as a scalar. You'll probably want to use this with the -StringMode option. - -=item $parser->asStringRef - -As above, but you get a reference to the string, not the string itself. - -=item $parser->addHeadText( $text ) - -Inserts some text just before the closing head tag. For example you can add a -link to a stylesheet. May be called many times to add lots of text. Note: you -need to call this some time B<before> any output is done, e.g. straight after -new(). Make sure that you only insert valid XHTML fragments. - -=item $parser->addBodyOpenText( $text ) / $parser->addBodyCloseText( $text ) - -Inserts some text right at the beginning (or ending) of the body element. For -example you can add a navigation header and footer. May be called many times -to add lots of text. Note: you need to call this some time B<before> any output -is done, e.g. straight after new(). Make sure that you only insert valid XHTML -fragments. - -=back - -=head1 OPTIONS - -=over 4 - -=item StringMode - -Default: 0. If set to 1 this does no output at all, even if filenames/handles -are supplied. Use asString or asStringRef to access the text if you set this -option. - -=item MakeIndex - -Default: 1. If set to 1 then an index of sections is created at the top of the -body. If set to 2 then the index includes non-bulleted list items - -=item MakeMeta - -Default: 1. If set to 1 then some meta tags are created, recording things like -input file, description, etc. - -=item FragmentOnly - -Default: 0. If 1, we only produce an XHTML fragment (suitable for use as a -server-side include etc). There is no HEAD element nor any BODY or HTML -tags. Any text added with the add*Text methods will B<not> be output. - - -=item TopHeading - -Allows you to set the starting heading level when in fragment mode. -For example, if your document already has h1 tags and you want the -generated POD to nest inside the outline, you can specify - - TopHeading => 2 - -and C<=head1> will be tagged with h2 tags, C<=head3> with h3, and so -on. - -Note that XHTML doesn't allow for heading tags past h6, so h7 and up -will be translated to h6 as necessary. - -=item TopLinks - -At each section head this text is added to provide a link back to the top. -Set to 0 or '' to inhibit links, or define your own. - - Default: <p><a href="#TOP" class="toplink">Top</a></p> - -=item LinkParser - -An object that parses links in the POD document. By default, this is a regular -Pod::Hyperlink object. Any user-supplied link parser must conform the the -Pod::Hyperlink API. - -This module works with a L<Pod::Hyperlink::BounceURL> link parser and generates -hyperlinks as 'a' elements with a class of 'pod_xhtml_bounce_url'. The optional -text giving the "node" is enclosed in a 'strong' element with a class of 'pod_xhtml_bounce_url_text' - -=back - -=head1 RATIONALE - -There's Pod::PXML and Pod::XML, so why do we need Pod::Xhtml? You need an XSLT -to transform XML into XHTML and many people don't have the time or inclination -to do this. But they want to make sure that the pages they put on their web -site are well-formed, they want those pages to use stylesheets easily, and -possibly they want to squirt the XHTML through some kind of filter for more -processing. - -By generating well-formed XHTML straight away we allow anyone to just use the -output files as-is. For those who want to use XML tools or transformations they -can use the XHTML as a source, because it's a well-formed XML document. - -=head1 CAVEATS - -This module outputs well-formed XHTML if the POD is well-formed. To check this -you can use something like: - - use Pod::Checker; - my $syn = podchecker($defaultIn); - -If $syn is 0 there are no syntax errors. If it's -1 then no POD was found. Any -positive number indicates that that number of errors were found. If the input -POD has errors then the output XHTML I<should> be well-formed but will probably -omit information, and in addition Pod::Xhtml will emit warnings. Note that -Pod::Parser seems to be sensitive to the current setting of $/ so ensure it's -the end-of-line character when the parsing is done. - -=head1 AUTHOR - -P Kent E<amp> Simon Flack E<lt>cpan _at_ bbc _dot_ co _dot_ ukE<gt> - -=head1 COPYRIGHT - -(c) BBC 2004, 2005. This program is free software; you can redistribute it -and/or modify it under the GNU GPL. - -See the file COPYING in this distribution, or http://www.gnu.org/licenses/gpl.txt - -=cut - -# vim:noet diff --git a/web/bin/lib/auto/Pod/Escapes/.exists b/web/bin/lib/auto/Pod/Escapes/.exists deleted file mode 100644 index e69de29..0000000 --- a/web/bin/lib/auto/Pod/Escapes/.exists +++ /dev/null diff --git a/web/bin/lib/auto/Pod/Simple/.exists b/web/bin/lib/auto/Pod/Simple/.exists deleted file mode 100644 index e69de29..0000000 --- a/web/bin/lib/auto/Pod/Simple/.exists +++ /dev/null diff --git a/web/bin/lib/perlpod.pod b/web/bin/lib/perlpod.pod deleted file mode 100644 index 80c9ba1..0000000 --- a/web/bin/lib/perlpod.pod +++ /dev/null @@ -1,685 +0,0 @@ - -=for comment -This document is in Pod format. To read this, use a Pod formatter, -like "perldoc perlpod". - -=head1 NAME - -perlpod - the Plain Old Documentation format - -=head1 DESCRIPTION - -Pod is a simple-to-use markup language used for writing documentation -for Perl, Perl programs, and Perl modules. - -Translators are available for converting Pod to various formats -like plain text, HTML, man pages, and more. - -Pod markup consists of three basic kinds of paragraphs: -L<ordinary|/"Ordinary Paragraph">, -L<verbatim|/"Verbatim Paragraph">, and -L<command|/"Command Paragraph">. - - -=head2 Ordinary Paragraph - -Most paragraphs in your documentation will be ordinary blocks -of text, like this one. You can simply type in your text without -any markup whatsoever, and with just a blank line before and -after. When it gets formatted, it will undergo minimal formatting, -like being rewrapped, probably put into a proportionally spaced -font, and maybe even justified. - -You can use formatting codes in ordinary paragraphs, for B<bold>, -I<italic>, C<code-style>, L<hyperlinks|perlfaq>, and more. Such -codes are explained in the "L<Formatting Codes|/"Formatting Codes">" -section, below. - - -=head2 Verbatim Paragraph - -Verbatim paragraphs are usually used for presenting a codeblock or -other text which does not require any special parsing or formatting, -and which shouldn't be wrapped. - -A verbatim paragraph is distinguished by having its first character -be a space or a tab. (And commonly, all its lines begin with spaces -and/or tabs.) It should be reproduced exactly, with tabs assumed to -be on 8-column boundaries. There are no special formatting codes, -so you can't italicize or anything like that. A \ means \, and -nothing else. - - -=head2 Command Paragraph - -A command paragraph is used for special treatment of whole chunks -of text, usually as headings or parts of lists. - -All command paragraphs (which are typically only one line long) start -with "=", followed by an identifier, followed by arbitrary text that -the command can use however it pleases. Currently recognized commands -are - - =head1 Heading Text - =head2 Heading Text - =head3 Heading Text - =head4 Heading Text - =over indentlevel - =item stuff - =back - =cut - =pod - =begin format - =end format - =for format text... - -To explain them each in detail: - -=over - -=item C<=head1 I<Heading Text>> - -=item C<=head2 I<Heading Text>> - -=item C<=head3 I<Heading Text>> - -=item C<=head4 I<Heading Text>> - -Head1 through head4 produce headings, head1 being the highest -level. The text in the rest of this paragraph is the content of the -heading. For example: - - =head2 Object Attributes - -The text "Object Attributes" comprises the heading there. (Note that -head3 and head4 are recent additions, not supported in older Pod -translators.) The text in these heading commands can use -formatting codes, as seen here: - - =head2 Possible Values for C<$/> - -Such commands are explained in the -"L<Formatting Codes|/"Formatting Codes">" section, below. - -=item C<=over I<indentlevel>> - -=item C<=item I<stuff...>> - -=item C<=back> - -Item, over, and back require a little more explanation: "=over" starts -a region specifically for the generation of a list using "=item" -commands, or for indenting (groups of) normal paragraphs. At the end -of your list, use "=back" to end it. The I<indentlevel> option to -"=over" indicates how far over to indent, generally in ems (where -one em is the width of an "M" in the document's base font) or roughly -comparable units; if there is no I<indentlevel> option, it defaults -to four. (And some formatters may just ignore whatever I<indentlevel> -you provide.) In the I<stuff> in C<=item I<stuff...>>, you may -use formatting codes, as seen here: - - =item Using C<$|> to Control Buffering - -Such commands are explained in the -"L<Formatting Codes|/"Formatting Codes">" section, below. - -Note also that there are some basic rules to using "=over" ... -"=back" regions: - -=over - -=item * - -Don't use "=item"s outside of an "=over" ... "=back" region. - -=item * - -The first thing after the "=over" command should be an "=item", unless -there aren't going to be any items at all in this "=over" ... "=back" -region. - -=item * - -Don't put "=headI<n>" commands inside an "=over" ... "=back" region. - -=item * - -And perhaps most importantly, keep the items consistent: either use -"=item *" for all of them, to produce bullets; or use "=item 1.", -"=item 2.", etc., to produce numbered lists; or use "=item foo", -"=item bar", etc. -- namely, things that look nothing like bullets or -numbers. - -If you start with bullets or numbers, stick with them, as -formatters use the first "=item" type to decide how to format the -list. - -=back - -=item C<=cut> - -To end a Pod block, use a blank line, -then a line beginning with "=cut", and a blank -line after it. This lets Perl (and the Pod formatter) know that -this is where Perl code is resuming. (The blank line before the "=cut" -is not technically necessary, but many older Pod processors require it.) - -=item C<=pod> - -The "=pod" command by itself doesn't do much of anything, but it -signals to Perl (and Pod formatters) that a Pod block starts here. A -Pod block starts with I<any> command paragraph, so a "=pod" command is -usually used just when you want to start a Pod block with an ordinary -paragraph or a verbatim paragraph. For example: - - =item stuff() - - This function does stuff. - - =cut - - sub stuff { - ... - } - - =pod - - Remember to check its return value, as in: - - stuff() || die "Couldn't do stuff!"; - - =cut - -=item C<=begin I<formatname>> - -=item C<=end I<formatname>> - -=item C<=for I<formatname> I<text...>> - -For, begin, and end will let you have regions of text/code/data that -are not generally interpreted as normal Pod text, but are passed -directly to particular formatters, or are otherwise special. A -formatter that can use that format will use the region, otherwise it -will be completely ignored. - -A command "=begin I<formatname>", some paragraphs, and a -command "=end I<formatname>", mean that the text/data inbetween -is meant for formatters that understand the special format -called I<formatname>. For example, - - =begin html - - <hr> <img src="thang.png"> - <p> This is a raw HTML paragraph </p> - - =end html - -The command "=for I<formatname> I<text...>" -specifies that the remainder of just this paragraph (starting -right after I<formatname>) is in that special format. - - =for html <hr> <img src="thang.png"> - <p> This is a raw HTML paragraph </p> - -This means the same thing as the above "=begin html" ... "=end html" -region. - -That is, with "=for", you can have only one paragraph's worth -of text (i.e., the text in "=foo targetname text..."), but with -"=begin targetname" ... "=end targetname", you can have any amount -of stuff inbetween. (Note that there still must be a blank line -after the "=begin" command and a blank line before the "=end" -command. - -Here are some examples of how to use these: - - =begin html - - <br>Figure 1.<br><IMG SRC="figure1.png"><br> - - =end html - - =begin text - - --------------- - | foo | - | bar | - --------------- - - ^^^^ Figure 1. ^^^^ - - =end text - -Some format names that formatters currently are known to accept -include "roff", "man", "latex", "tex", "text", and "html". (Some -formatters will treat some of these as synonyms.) - -A format name of "comment" is common for just making notes (presumably -to yourself) that won't appear in any formatted version of the Pod -document: - - =for comment - Make sure that all the available options are documented! - -Some I<formatnames> will require a leading colon (as in -C<"=for :formatname">, or -C<"=begin :formatname" ... "=end :formatname">), -to signal that the text is not raw data, but instead I<is> Pod text -(i.e., possibly containing formatting codes) that's just not for -normal formatting (e.g., may not be a normal-use paragraph, but might -be for formatting as a footnote). - -=back - -And don't forget, when using any command, that the command lasts up -until the end of its I<paragraph>, not its line. So in the -examples below, you can see that every command needs the blank -line after it, to end its paragraph. - -Some examples of lists include: - - =over - - =item * - - First item - - =item * - - Second item - - =back - - =over - - =item Foo() - - Description of Foo function - - =item Bar() - - Description of Bar function - - =back - - -=head2 Formatting Codes - -In ordinary paragraphs and in some command paragraphs, various -formatting codes (a.k.a. "interior sequences") can be used: - -=for comment - "interior sequences" is such an opaque term. - Prefer "formatting codes" instead. - -=over - -=item C<IE<lt>textE<gt>> -- italic text - -Used for emphasis ("C<be IE<lt>careful!E<gt>>") and parameters -("C<redo IE<lt>LABELE<gt>>") - -=item C<BE<lt>textE<gt>> -- bold text - -Used for switches ("C<perl's BE<lt>-nE<gt> switch>"), programs -("C<some systems provide a BE<lt>chfnE<gt> for that>"), -emphasis ("C<be BE<lt>careful!E<gt>>"), and so on -("C<and that feature is known as BE<lt>autovivificationE<gt>>"). - -=item C<CE<lt>codeE<gt>> -- code text - -Renders code in a typewriter font, or gives some other indication that -this represents program text ("C<CE<lt>gmtime($^T)E<gt>>") or some other -form of computerese ("C<CE<lt>drwxr-xr-xE<gt>>"). - -=item C<LE<lt>nameE<gt>> -- a hyperlink - -There are various syntaxes, listed below. In the syntaxes given, -C<text>, C<name>, and C<section> cannot contain the characters -'/' and '|'; and any '<' or '>' should be matched. - -=over - -=item * - -C<LE<lt>nameE<gt>> - -Link to a Perl manual page (e.g., C<LE<lt>Net::PingE<gt>>). Note -that C<name> should not contain spaces. This syntax -is also occasionally used for references to UNIX man pages, as in -C<LE<lt>crontab(5)E<gt>>. - -=item * - -C<LE<lt>name/"sec"E<gt>> or C<LE<lt>name/secE<gt>> - -Link to a section in other manual page. E.g., -C<LE<lt>perlsyn/"For Loops"E<gt>> - -=item * - -C<LE<lt>/"sec"E<gt>> or C<LE<lt>/secE<gt>> or C<LE<lt>"sec"E<gt>> - -Link to a section in this manual page. E.g., -C<LE<lt>/"Object Methods"E<gt>> - -=back - -A section is started by the named heading or item. For -example, C<LE<lt>perlvar/$.E<gt>> or C<LE<lt>perlvar/"$."E<gt>> both -link to the section started by "C<=item $.>" in perlvar. And -C<LE<lt>perlsyn/For LoopsE<gt>> or C<LE<lt>perlsyn/"For Loops"E<gt>> -both link to the section started by "C<=head2 For Loops>" -in perlsyn. - -To control what text is used for display, you -use "C<LE<lt>text|...E<gt>>", as in: - -=over - -=item * - -C<LE<lt>text|nameE<gt>> - -Link this text to that manual page. E.g., -C<LE<lt>Perl Error Messages|perldiagE<gt>> - -=item * - -C<LE<lt>text|name/"sec"E<gt>> or C<LE<lt>text|name/secE<gt>> - -Link this text to that section in that manual page. E.g., -C<LE<lt>SWITCH statements|perlsyn/"Basic BLOCKs and Switch -Statements"E<gt>> - -=item * - -C<LE<lt>text|/"sec"E<gt>> or C<LE<lt>text|/secE<gt>> -or C<LE<lt>text|"sec"E<gt>> - -Link this text to that section in this manual page. E.g., -C<LE<lt>the various attributes|/"Member Data"E<gt>> - -=back - -Or you can link to a web page: - -=over - -=item * - -C<LE<lt>scheme:...E<gt>> - -Links to an absolute URL. For example, -C<LE<lt>http://www.perl.org/E<gt>>. But note -that there is no corresponding C<LE<lt>text|scheme:...E<gt>> syntax, for -various reasons. - -=back - -=item C<EE<lt>escapeE<gt>> -- a character escape - -Very similar to HTML/XML C<&I<foo>;> "entity references": - -=over - -=item * - -C<EE<lt>ltE<gt>> -- a literal E<lt> (less than) - -=item * - -C<EE<lt>gtE<gt>> -- a literal E<gt> (greater than) - -=item * - -C<EE<lt>verbarE<gt>> -- a literal | (I<ver>tical I<bar>) - -=item * - -C<EE<lt>solE<gt>> = a literal / (I<sol>idus) - -The above four are optional except in other formatting codes, -notably C<LE<lt>...E<gt>>, and when preceded by a -capital letter. - -=item * - -C<EE<lt>htmlnameE<gt>> - -Some non-numeric HTML entity name, such as C<EE<lt>eacuteE<gt>>, -meaning the same thing as C<é> in HTML -- i.e., a lowercase -e with an acute (/-shaped) accent. - -=item * - -C<EE<lt>numberE<gt>> - -The ASCII/Latin-1/Unicode character with that number. A -leading "0x" means that I<number> is hex, as in -C<EE<lt>0x201EE<gt>>. A leading "0" means that I<number> is octal, -as in C<EE<lt>075E<gt>>. Otherwise I<number> is interpreted as being -in decimal, as in C<EE<lt>181E<gt>>. - -Note that older Pod formatters might not recognize octal or -hex numeric escapes, and that many formatters cannot reliably -render characters above 255. (Some formatters may even have -to use compromised renderings of Latin-1 characters, like -rendering C<EE<lt>eacuteE<gt>> as just a plain "e".) - -=back - -=item C<FE<lt>filenameE<gt>> -- used for filenames - -Typically displayed in italics. Example: "C<FE<lt>.cshrcE<gt>>" - -=item C<SE<lt>textE<gt>> -- text contains non-breaking spaces - -This means that the words in I<text> should not be broken -across lines. Example: S<C<SE<lt>$x ? $y : $zE<gt>>>. - -=item C<XE<lt>topic nameE<gt>> -- an index entry - -This is ignored by most formatters, but some may use it for building -indexes. It always renders as empty-string. -Example: C<XE<lt>absolutizing relative URLsE<gt>> - -=item C<ZE<lt>E<gt>> -- a null (zero-effect) formatting code - -This is rarely used. It's one way to get around using an -EE<lt>...E<gt> code sometimes. For example, instead of -"C<NEE<lt>ltE<gt>3>" (for "NE<lt>3") you could write -"C<NZE<lt>E<gt>E<lt>3>" (the "ZE<lt>E<gt>" breaks up the "N" and -the "E<lt>" so they can't be considered -the part of a (fictitious) "NE<lt>...E<gt>" code. - -=for comment - This was formerly explained as a "zero-width character". But it in - most parser models, it parses to nothing at all, as opposed to parsing - as if it were a E<zwnj> or E<zwj>, which are REAL zero-width characters. - So "width" and "character" are exactly the wrong words. - -=back - -Most of the time, you will need only a single set of angle brackets to -delimit the beginning and end of formatting codes. However, -sometimes you will want to put a real right angle bracket (a -greater-than sign, '>') inside of a formatting code. This is particularly -common when using a formatting code to provide a different font-type for a -snippet of code. As with all things in Perl, there is more than -one way to do it. One way is to simply escape the closing bracket -using an C<E> code: - - C<$a E<lt>=E<gt> $b> - -This will produce: "C<$a E<lt>=E<gt> $b>" - -A more readable, and perhaps more "plain" way is to use an alternate -set of delimiters that doesn't require a single ">" to be escaped. With -the Pod formatters that are standard starting with perl5.5.660, doubled -angle brackets ("<<" and ">>") may be used I<if and only if there is -whitespace right after the opening delimiter and whitespace right -before the closing delimiter!> For example, the following will -do the trick: - - C<< $a <=> $b >> - -In fact, you can use as many repeated angle-brackets as you like so -long as you have the same number of them in the opening and closing -delimiters, and make sure that whitespace immediately follows the last -'<' of the opening delimiter, and immediately precedes the first '>' -of the closing delimiter. (The whitespace is ignored.) So the -following will also work: - - C<<< $a <=> $b >>> - C<<<< $a <=> $b >>>> - -And they all mean exactly the same as this: - - C<$a E<lt>=E<gt> $b> - -As a further example, this means that if you wanted to put these bits of -code in C<C> (code) style: - - open(X, ">>thing.dat") || die $! - $foo->bar(); - -you could do it like so: - - C<<< open(X, ">>thing.dat") || die $! >>> - C<< $foo->bar(); >> - -which is presumably easier to read than the old way: - - C<open(X, "E<gt>E<gt>thing.dat") || die $!> - C<$foo-E<gt>bar(); >> - -This is currently supported by pod2text (Pod::Text), pod2man (Pod::Man), -and any other pod2xxx or Pod::Xxxx translators that use -Pod::Parser 1.093 or later, or Pod::Tree 1.02 or later. - -=head2 The Intent - -The intent is simplicity of use, not power of expression. Paragraphs -look like paragraphs (block format), so that they stand out -visually, and so that I could run them through C<fmt> easily to reformat -them (that's F7 in my version of B<vi>, or Esc Q in my version of -B<emacs>). I wanted the translator to always leave the C<'> and C<`> and -C<"> quotes alone, in verbatim mode, so I could slurp in a -working program, shift it over four spaces, and have it print out, er, -verbatim. And presumably in a monospace font. - -The Pod format is not necessarily sufficient for writing a book. Pod -is just meant to be an idiot-proof common source for nroff, HTML, -TeX, and other markup languages, as used for online -documentation. Translators exist for B<pod2text>, B<pod2html>, -B<pod2man> (that's for nroff(1) and troff(1)), B<pod2latex>, and -B<pod2fm>. Various others are available in CPAN. - - -=head2 Embedding Pods in Perl Modules - -You can embed Pod documentation in your Perl modules and scripts. -Start your documentation with an empty line, a "=head1" command at the -beginning, and end it with a "=cut" command and an empty line. Perl -will ignore the Pod text. See any of the supplied library modules for -examples. If you're going to put your Pod at the end of the file, and -you're using an __END__ or __DATA__ cut mark, make sure to put an -empty line there before the first Pod command. - - __END__ - - =head1 NAME - - Time::Local - efficiently compute time from local and GMT time - -Without that empty line before the "=head1", many translators wouldn't -have recognized the "=head1" as starting a Pod block. - -=head2 Hints for Writing Pod - -=over - -=item * - -The B<podchecker> command is provided for checking Pod syntax for errors -and warnings. For example, it checks for completely blank lines in -Pod blocks and for unknown commands and formatting codes. You should -still also pass your document through one or more translators and proofread -the result, or print out the result and proofread that. Some of the -problems found may be bugs in the translators, which you may or may not -wish to work around. - -=item * - -If you're more familiar with writing in HTML than with writing in Pod, you -can try your hand at writing documentation in simple HTML, and converting -it to Pod with the experimental L<Pod::HTML2Pod|Pod::HTML2Pod> module, -(available in CPAN), and looking at the resulting code. The experimental -L<Pod::PXML|Pod::PXML> module in CPAN might also be useful. - -=item * - -Many older Pod translators require the lines before every Pod -command and after every Pod command (including "=cut"!) to be a blank -line. Having something like this: - - # - - - - - - - - - - - - - =item $firecracker->boom() - - This noisily detonates the firecracker object. - =cut - sub boom { - ... - -...will make such Pod translators completely fail to see the Pod block -at all. - -Instead, have it like this: - - # - - - - - - - - - - - - - - =item $firecracker->boom() - - This noisily detonates the firecracker object. - - =cut - - sub boom { - ... - -=item * - -Some older Pod translators require paragraphs (including command -paragraphs like "=head2 Functions") to be separated by I<completely> -empty lines. If you have an apparently empty line with some spaces -on it, this might not count as a separator for those translators, and -that could cause odd formatting. - -=item * - -Older translators might add wording around an LE<lt>E<gt> link, so that -C<LE<lt>Foo::BarE<gt>> may become "the Foo::Bar manpage", for example. -So you shouldn't write things like C<the LE<lt>fooE<gt> -documentation>, if you want the translated document to read sensibly --- instead write C<the LE<lt>Foo::Bar|Foo::BarE<gt> documentation> or -C<LE<lt>the Foo::Bar documentation|Foo::BarE<gt>>, to control how the -link comes out. - -=item * - -Going past the 70th column in a verbatim block might be ungracefully -wrapped by some formatters. - -=back - -=head1 SEE ALSO - -L<perlpodspec>, L<perlsyn/"PODs: Embedded Documentation">, -L<perlnewmod>, L<perldoc>, L<pod2html>, L<pod2man>, L<podchecker>. - -=head1 AUTHOR - -Larry Wall, Sean M. Burke - -=cut diff --git a/web/bin/lib/perlpodspec.pod b/web/bin/lib/perlpodspec.pod deleted file mode 100644 index 7387258..0000000 --- a/web/bin/lib/perlpodspec.pod +++ /dev/null @@ -1,1876 +0,0 @@ - -=head1 NAME - -perlpodspec - Plain Old Documentation: format specification and notes - -=head1 DESCRIPTION - -This document is detailed notes on the Pod markup language. Most -people will only have to read L<perlpod|perlpod> to know how to write -in Pod, but this document may answer some incidental questions to do -with parsing and rendering Pod. - -In this document, "must" / "must not", "should" / -"should not", and "may" have their conventional (cf. RFC 2119) -meanings: "X must do Y" means that if X doesn't do Y, it's against -this specification, and should really be fixed. "X should do Y" -means that it's recommended, but X may fail to do Y, if there's a -good reason. "X may do Y" is merely a note that X can do Y at -will (although it is up to the reader to detect any connotation of -"and I think it would be I<nice> if X did Y" versus "it wouldn't -really I<bother> me if X did Y"). - -Notably, when I say "the parser should do Y", the -parser may fail to do Y, if the calling application explicitly -requests that the parser I<not> do Y. I often phrase this as -"the parser should, by default, do Y." This doesn't I<require> -the parser to provide an option for turning off whatever -feature Y is (like expanding tabs in verbatim paragraphs), although -it implicates that such an option I<may> be provided. - -=head1 Pod Definitions - -Pod is embedded in files, typically Perl source files -- although you -can write a file that's nothing but Pod. - -A B<line> in a file consists of zero or more non-newline characters, -terminated by either a newline or the end of the file. - -A B<newline sequence> is usually a platform-dependent concept, but -Pod parsers should understand it to mean any of CR (ASCII 13), LF -(ASCII 10), or a CRLF (ASCII 13 followed immediately by ASCII 10), in -addition to any other system-specific meaning. The first CR/CRLF/LF -sequence in the file may be used as the basis for identifying the -newline sequence for parsing the rest of the file. - -A B<blank line> is a line consisting entirely of zero or more spaces -(ASCII 32) or tabs (ASCII 9), and terminated by a newline or end-of-file. -A B<non-blank line> is a line containing one or more characters other -than space or tab (and terminated by a newline or end-of-file). - -(I<Note:> Many older Pod parsers did not accept a line consisting of -spaces/tabs and then a newline as a blank line -- the only lines they -considered blank were lines consisting of I<no characters at all>, -terminated by a newline.) - -B<Whitespace> is used in this document as a blanket term for spaces, -tabs, and newline sequences. (By itself, this term usually refers -to literal whitespace. That is, sequences of whitespace characters -in Pod source, as opposed to "EE<lt>32>", which is a formatting -code that I<denotes> a whitespace character.) - -A B<Pod parser> is a module meant for parsing Pod (regardless of -whether this involves calling callbacks or building a parse tree or -directly formatting it). A B<Pod formatter> (or B<Pod translator>) -is a module or program that converts Pod to some other format (HTML, -plaintext, TeX, PostScript, RTF). A B<Pod processor> might be a -formatter or translator, or might be a program that does something -else with the Pod (like wordcounting it, scanning for index points, -etc.). - -Pod content is contained in B<Pod blocks>. A Pod block starts with a -line that matches <m/\A=[a-zA-Z]/>, and continues up to the next line -that matches C<m/\A=cut/> -- or up to the end of the file, if there is -no C<m/\A=cut/> line. - -=for comment - The current perlsyn says: - [beginquote] - Note that pod translators should look at only paragraphs beginning - with a pod directive (it makes parsing easier), whereas the compiler - actually knows to look for pod escapes even in the middle of a - paragraph. This means that the following secret stuff will be ignored - by both the compiler and the translators. - $a=3; - =secret stuff - warn "Neither POD nor CODE!?" - =cut back - print "got $a\n"; - You probably shouldn't rely upon the warn() being podded out forever. - Not all pod translators are well-behaved in this regard, and perhaps - the compiler will become pickier. - [endquote] - I think that those paragraphs should just be removed; paragraph-based - parsing seems to have been largely abandoned, because of the hassle - with non-empty blank lines messing up what people meant by "paragraph". - Even if the "it makes parsing easier" bit were especially true, - it wouldn't be worth the confusion of having perl and pod2whatever - actually disagree on what can constitute a Pod block. - -Within a Pod block, there are B<Pod paragraphs>. A Pod paragraph -consists of non-blank lines of text, separated by one or more blank -lines. - -For purposes of Pod processing, there are four types of paragraphs in -a Pod block: - -=over - -=item * - -A command paragraph (also called a "directive"). The first line of -this paragraph must match C<m/\A=[a-zA-Z]/>. Command paragraphs are -typically one line, as in: - - =head1 NOTES - - =item * - -But they may span several (non-blank) lines: - - =for comment - Hm, I wonder what it would look like if - you tried to write a BNF for Pod from this. - - =head3 Dr. Strangelove, or: How I Learned to - Stop Worrying and Love the Bomb - -I<Some> command paragraphs allow formatting codes in their content -(i.e., after the part that matches C<m/\A=[a-zA-Z]\S*\s*/>), as in: - - =head1 Did You Remember to C<use strict;>? - -In other words, the Pod processing handler for "head1" will apply the -same processing to "Did You Remember to CE<lt>use strict;>?" that it -would to an ordinary paragraph -- i.e., formatting codes (like -"CE<lt>...>") are parsed and presumably formatted appropriately, and -whitespace in the form of literal spaces and/or tabs is not -significant. - -=item * - -A B<verbatim paragraph>. The first line of this paragraph must be a -literal space or tab, and this paragraph must not be inside a "=begin -I<identifier>", ... "=end I<identifier>" sequence unless -"I<identifier>" begins with a colon (":"). That is, if a paragraph -starts with a literal space or tab, but I<is> inside a -"=begin I<identifier>", ... "=end I<identifier>" region, then it's -a data paragraph, unless "I<identifier>" begins with a colon. - -Whitespace I<is> significant in verbatim paragraphs (although, in -processing, tabs are probably expanded). - -=item * - -An B<ordinary paragraph>. A paragraph is an ordinary paragraph -if its first line matches neither C<m/\A=[a-zA-Z]/> nor -C<m/\A[ \t]/>, I<and> if it's not inside a "=begin I<identifier>", -... "=end I<identifier>" sequence unless "I<identifier>" begins with -a colon (":"). - -=item * - -A B<data paragraph>. This is a paragraph that I<is> inside a "=begin -I<identifier>" ... "=end I<identifier>" sequence where -"I<identifier>" does I<not> begin with a literal colon (":"). In -some sense, a data paragraph is not part of Pod at all (i.e., -effectively it's "out-of-band"), since it's not subject to most kinds -of Pod parsing; but it is specified here, since Pod -parsers need to be able to call an event for it, or store it in some -form in a parse tree, or at least just parse I<around> it. - -=back - -For example: consider the following paragraphs: - - # <- that's the 0th column - - =head1 Foo - - Stuff - - $foo->bar - - =cut - -Here, "=head1 Foo" and "=cut" are command paragraphs because the first -line of each matches C<m/\A=[a-zA-Z]/>. "I<[space][space]>$foo->bar" -is a verbatim paragraph, because its first line starts with a literal -whitespace character (and there's no "=begin"..."=end" region around). - -The "=begin I<identifier>" ... "=end I<identifier>" commands stop -paragraphs that they surround from being parsed as data or verbatim -paragraphs, if I<identifier> doesn't begin with a colon. This -is discussed in detail in the section -L</About Data Paragraphs and "=beginE<sol>=end" Regions>. - -=head1 Pod Commands - -This section is intended to supplement and clarify the discussion in -L<perlpod/"Command Paragraph">. These are the currently recognized -Pod commands: - -=over - -=item "=head1", "=head2", "=head3", "=head4" - -This command indicates that the text in the remainder of the paragraph -is a heading. That text may contain formatting codes. Examples: - - =head1 Object Attributes - - =head3 What B<Not> to Do! - -=item "=pod" - -This command indicates that this paragraph begins a Pod block. (If we -are already in the middle of a Pod block, this command has no effect at -all.) If there is any text in this command paragraph after "=pod", -it must be ignored. Examples: - - =pod - - This is a plain Pod paragraph. - - =pod This text is ignored. - -=item "=cut" - -This command indicates that this line is the end of this previously -started Pod block. If there is any text after "=cut" on the line, it must be -ignored. Examples: - - =cut - - =cut The documentation ends here. - - =cut - # This is the first line of program text. - sub foo { # This is the second. - -It is an error to try to I<start> a Pod black with a "=cut" command. In -that case, the Pod processor must halt parsing of the input file, and -must by default emit a warning. - -=item "=over" - -This command indicates that this is the start of a list/indent -region. If there is any text following the "=over", it must consist -of only a nonzero positive numeral. The semantics of this numeral is -explained in the L</"About =over...=back Regions"> section, further -below. Formatting codes are not expanded. Examples: - - =over 3 - - =over 3.5 - - =over - -=item "=item" - -This command indicates that an item in a list begins here. Formatting -codes are processed. The semantics of the (optional) text in the -remainder of this paragraph are -explained in the L</"About =over...=back Regions"> section, further -below. Examples: - - =item - - =item * - - =item * - - =item 14 - - =item 3. - - =item C<< $thing->stuff(I<dodad>) >> - - =item For transporting us beyond seas to be tried for pretended - offenses - - =item He is at this time transporting large armies of foreign - mercenaries to complete the works of death, desolation and - tyranny, already begun with circumstances of cruelty and perfidy - scarcely paralleled in the most barbarous ages, and totally - unworthy the head of a civilized nation. - -=item "=back" - -This command indicates that this is the end of the region begun -by the most recent "=over" command. It permits no text after the -"=back" command. - -=item "=begin formatname" - -This marks the following paragraphs (until the matching "=end -formatname") as being for some special kind of processing. Unless -"formatname" begins with a colon, the contained non-command -paragraphs are data paragraphs. But if "formatname" I<does> begin -with a colon, then non-command paragraphs are ordinary paragraphs -or data paragraphs. This is discussed in detail in the section -L</About Data Paragraphs and "=beginE<sol>=end" Regions>. - -It is advised that formatnames match the regexp -C<m/\A:?[-a-zA-Z0-9_]+\z/>. Implementors should anticipate future -expansion in the semantics and syntax of the first parameter -to "=begin"/"=end"/"=for". - -=item "=end formatname" - -This marks the end of the region opened by the matching -"=begin formatname" region. If "formatname" is not the formatname -of the most recent open "=begin formatname" region, then this -is an error, and must generate an error message. This -is discussed in detail in the section -L</About Data Paragraphs and "=beginE<sol>=end" Regions>. - -=item "=for formatname text..." - -This is synonymous with: - - =begin formatname - - text... - - =end formatname - -That is, it creates a region consisting of a single paragraph; that -paragraph is to be treated as a normal paragraph if "formatname" -begins with a ":"; if "formatname" I<doesn't> begin with a colon, -then "text..." will constitute a data paragraph. There is no way -to use "=for formatname text..." to express "text..." as a verbatim -paragraph. - -=back - -If a Pod processor sees any command other than the ones listed -above (like "=head", or "=haed1", or "=stuff", or "=cuttlefish", -or "=w123"), that processor must by default treat this as an -error. It must not process the paragraph beginning with that -command, must by default warn of this as an error, and may -abort the parse. A Pod parser may allow a way for particular -applications to add to the above list of known commands, and to -stipulate, for each additional command, whether formatting -codes should be processed. - -Future versions of this specification may add additional -commands. - - - -=head1 Pod Formatting Codes - -(Note that in previous drafts of this document and of perlpod, -formatting codes were referred to as "interior sequences", and -this term may still be found in the documentation for Pod parsers, -and in error messages from Pod processors.) - -There are two syntaxes for formatting codes: - -=over - -=item * - -A formatting code starts with a capital letter (just US-ASCII [A-Z]) -followed by a "<", any number of characters, and ending with the first -matching ">". Examples: - - That's what I<you> think! - - What's C<dump()> for? - - X<C<chmod> and C<unlink()> Under Different Operating Systems> - -=item * - -A formatting code starts with a capital letter (just US-ASCII [A-Z]) -followed by two or more "<"'s, one or more whitespace characters, -any number of characters, one or more whitespace characters, -and ending with the first matching sequence of two or more ">"'s, where -the number of ">"'s equals the number of "<"'s in the opening of this -formatting code. Examples: - - That's what I<< you >> think! - - C<<< open(X, ">>thing.dat") || die $! >>> - - B<< $foo->bar(); >> - -With this syntax, the whitespace character(s) after the "CE<lt><<" -and before the ">>" (or whatever letter) are I<not> renderable -- they -do not signify whitespace, are merely part of the formatting codes -themselves. That is, these are all synonymous: - - C<thing> - C<< thing >> - C<< thing >> - C<<< thing >>> - C<<<< - thing - >>>> - -and so on. - -=back - -In parsing Pod, a notably tricky part is the correct parsing of -(potentially nested!) formatting codes. Implementors should -consult the code in the C<parse_text> routine in Pod::Parser as an -example of a correct implementation. - -=over - -=item C<IE<lt>textE<gt>> -- italic text - -See the brief discussion in L<perlpod/"Formatting Codes">. - -=item C<BE<lt>textE<gt>> -- bold text - -See the brief discussion in L<perlpod/"Formatting Codes">. - -=item C<CE<lt>codeE<gt>> -- code text - -See the brief discussion in L<perlpod/"Formatting Codes">. - -=item C<FE<lt>filenameE<gt>> -- style for filenames - -See the brief discussion in L<perlpod/"Formatting Codes">. - -=item C<XE<lt>topic nameE<gt>> -- an index entry - -See the brief discussion in L<perlpod/"Formatting Codes">. - -This code is unusual in that most formatters completely discard -this code and its content. Other formatters will render it with -invisible codes that can be used in building an index of -the current document. - -=item C<ZE<lt>E<gt>> -- a null (zero-effect) formatting code - -Discussed briefly in L<perlpod/"Formatting Codes">. - -This code is unusual is that it should have no content. That is, -a processor may complain if it sees C<ZE<lt>potatoesE<gt>>. Whether -or not it complains, the I<potatoes> text should ignored. - -=item C<LE<lt>nameE<gt>> -- a hyperlink - -The complicated syntaxes of this code are discussed at length in -L<perlpod/"Formatting Codes">, and implementation details are -discussed below, in L</"About LE<lt>...E<gt> Codes">. Parsing the -contents of LE<lt>content> is tricky. Notably, the content has to be -checked for whether it looks like a URL, or whether it has to be split -on literal "|" and/or "/" (in the right order!), and so on, -I<before> EE<lt>...> codes are resolved. - -=item C<EE<lt>escapeE<gt>> -- a character escape - -See L<perlpod/"Formatting Codes">, and several points in -L</Notes on Implementing Pod Processors>. - -=item C<SE<lt>textE<gt>> -- text contains non-breaking spaces - -This formatting code is syntactically simple, but semantically -complex. What it means is that each space in the printable -content of this code signifies a nonbreaking space. - -Consider: - - C<$x ? $y : $z> - - S<C<$x ? $y : $z>> - -Both signify the monospace (c[ode] style) text consisting of -"$x", one space, "?", one space, ":", one space, "$z". The -difference is that in the latter, with the S code, those spaces -are not "normal" spaces, but instead are nonbreaking spaces. - -=back - - -If a Pod processor sees any formatting code other than the ones -listed above (as in "NE<lt>...>", or "QE<lt>...>", etc.), that -processor must by default treat this as an error. -A Pod parser may allow a way for particular -applications to add to the above list of known formatting codes; -a Pod parser might even allow a way to stipulate, for each additional -command, whether it requires some form of special processing, as -LE<lt>...> does. - -Future versions of this specification may add additional -formatting codes. - -Historical note: A few older Pod processors would not see a ">" as -closing a "CE<lt>" code, if the ">" was immediately preceded by -a "-". This was so that this: - - C<$foo->bar> - -would parse as equivalent to this: - - C<$foo-E<lt>bar> - -instead of as equivalent to a "C" formatting code containing -only "$foo-", and then a "bar>" outside the "C" formatting code. This -problem has since been solved by the addition of syntaxes like this: - - C<< $foo->bar >> - -Compliant parsers must not treat "->" as special. - -Formatting codes absolutely cannot span paragraphs. If a code is -opened in one paragraph, and no closing code is found by the end of -that paragraph, the Pod parser must close that formatting code, -and should complain (as in "Unterminated I code in the paragraph -starting at line 123: 'Time objects are not...'"). So these -two paragraphs: - - I<I told you not to do this! - - Don't make me say it again!> - -...must I<not> be parsed as two paragraphs in italics (with the I -code starting in one paragraph and starting in another.) Instead, -the first paragraph should generate a warning, but that aside, the -above code must parse as if it were: - - I<I told you not to do this!> - - Don't make me say it again!E<gt> - -(In SGMLish jargon, all Pod commands are like block-level -elements, whereas all Pod formatting codes are like inline-level -elements.) - - - -=head1 Notes on Implementing Pod Processors - -The following is a long section of miscellaneous requirements -and suggestions to do with Pod processing. - -=over - -=item * - -Pod formatters should tolerate lines in verbatim blocks that are of -any length, even if that means having to break them (possibly several -times, for very long lines) to avoid text running off the side of the -page. Pod formatters may warn of such line-breaking. Such warnings -are particularly appropriate for lines are over 100 characters long, which -are usually not intentional. - -=item * - -Pod parsers must recognize I<all> of the three well-known newline -formats: CR, LF, and CRLF. See L<perlport|perlport>. - -=item * - -Pod parsers should accept input lines that are of any length. - -=item * - -Since Perl recognizes a Unicode Byte Order Mark at the start of files -as signaling that the file is Unicode encoded as in UTF-16 (whether -big-endian or little-endian) or UTF-8, Pod parsers should do the -same. Otherwise, the character encoding should be understood as -being UTF-8 if the first highbit byte sequence in the file seems -valid as a UTF-8 sequence, or otherwise as Latin-1. - -Future versions of this specification may specify -how Pod can accept other encodings. Presumably treatment of other -encodings in Pod parsing would be as in XML parsing: whatever the -encoding declared by a particular Pod file, content is to be -stored in memory as Unicode characters. - -=item * - -The well known Unicode Byte Order Marks are as follows: if the -file begins with the two literal byte values 0xFE 0xFF, this is -the BOM for big-endian UTF-16. If the file begins with the two -literal byte value 0xFF 0xFE, this is the BOM for little-endian -UTF-16. If the file begins with the three literal byte values -0xEF 0xBB 0xBF, this is the BOM for UTF-8. - -=for comment - use bytes; print map sprintf(" 0x%02X", ord $_), split '', "\x{feff}"; - 0xEF 0xBB 0xBF - -=for comment - If toke.c is modified to support UTF32, add mention of those here. - -=item * - -A naive but sufficient heuristic for testing the first highbit -byte-sequence in a BOM-less file (whether in code or in Pod!), to see -whether that sequence is valid as UTF-8 (RFC 2279) is to check whether -that the first byte in the sequence is in the range 0xC0 - 0xFD -I<and> whether the next byte is in the range -0x80 - 0xBF. If so, the parser may conclude that this file is in -UTF-8, and all highbit sequences in the file should be assumed to -be UTF-8. Otherwise the parser should treat the file as being -in Latin-1. In the unlikely circumstance that the first highbit -sequence in a truly non-UTF-8 file happens to appear to be UTF-8, one -can cater to our heuristic (as well as any more intelligent heuristic) -by prefacing that line with a comment line containing a highbit -sequence that is clearly I<not> valid as UTF-8. A line consisting -of simply "#", an e-acute, and any non-highbit byte, -is sufficient to establish this file's encoding. - -=for comment - If/WHEN some brave soul makes these heuristics into a generic - text-file class (or PerlIO layer?), we can presumably delete - mention of these icky details from this file, and can instead - tell people to just use appropriate class/layer. - Auto-recognition of newline sequences would be another desirable - feature of such a class/layer. - HINT HINT HINT. - -=for comment - "The probability that a string of characters - in any other encoding appears as valid UTF-8 is low" - RFC2279 - -=item * - -This document's requirements and suggestions about encodings -do not apply to Pod processors running on non-ASCII platforms, -notably EBCDIC platforms. - -=item * - -Pod processors must treat a "=for [label] [content...]" paragraph as -meaning the same thing as a "=begin [label]" paragraph, content, and -an "=end [label]" paragraph. (The parser may conflate these two -constructs, or may leave them distinct, in the expectation that the -formatter will nevertheless treat them the same.) - -=item * - -When rendering Pod to a format that allows comments (i.e., to nearly -any format other than plaintext), a Pod formatter must insert comment -text identifying its name and version number, and the name and -version numbers of any modules it might be using to process the Pod. -Minimal examples: - - %% POD::Pod2PS v3.14159, using POD::Parser v1.92 - - <!-- Pod::HTML v3.14159, using POD::Parser v1.92 --> - - {\doccomm generated by Pod::Tree::RTF 3.14159 using Pod::Tree 1.08} - - .\" Pod::Man version 3.14159, using POD::Parser version 1.92 - -Formatters may also insert additional comments, including: the -release date of the Pod formatter program, the contact address for -the author(s) of the formatter, the current time, the name of input -file, the formatting options in effect, version of Perl used, etc. - -Formatters may also choose to note errors/warnings as comments, -besides or instead of emitting them otherwise (as in messages to -STDERR, or C<die>ing). - -=item * - -Pod parsers I<may> emit warnings or error messages ("Unknown E code -EE<lt>zslig>!") to STDERR (whether through printing to STDERR, or -C<warn>ing/C<carp>ing, or C<die>ing/C<croak>ing), but I<must> allow -suppressing all such STDERR output, and instead allow an option for -reporting errors/warnings -in some other way, whether by triggering a callback, or noting errors -in some attribute of the document object, or some similarly unobtrusive -mechanism -- or even by appending a "Pod Errors" section to the end of -the parsed form of the document. - -=item * - -In cases of exceptionally aberrant documents, Pod parsers may abort the -parse. Even then, using C<die>ing/C<croak>ing is to be avoided; where -possible, the parser library may simply close the input file -and add text like "*** Formatting Aborted ***" to the end of the -(partial) in-memory document. - -=item * - -In paragraphs where formatting codes (like EE<lt>...>, BE<lt>...>) -are understood (i.e., I<not> verbatim paragraphs, but I<including> -ordinary paragraphs, and command paragraphs that produce renderable -text, like "=head1"), literal whitespace should generally be considered -"insignificant", in that one literal space has the same meaning as any -(nonzero) number of literal spaces, literal newlines, and literal tabs -(as long as this produces no blank lines, since those would terminate -the paragraph). Pod parsers should compact literal whitespace in each -processed paragraph, but may provide an option for overriding this -(since some processing tasks do not require it), or may follow -additional special rules (for example, specially treating -period-space-space or period-newline sequences). - -=item * - -Pod parsers should not, by default, try to coerce apostrophe (') and -quote (") into smart quotes (little 9's, 66's, 99's, etc), nor try to -turn backtick (`) into anything else but a single backtick character -(distinct from an openquote character!), nor "--" into anything but -two minus signs. They I<must never> do any of those things to text -in CE<lt>...> formatting codes, and never I<ever> to text in verbatim -paragraphs. - -=item * - -When rendering Pod to a format that has two kinds of hyphens (-), one -that's a nonbreaking hyphen, and another that's a breakable hyphen -(as in "object-oriented", which can be split across lines as -"object-", newline, "oriented"), formatters are encouraged to -generally translate "-" to nonbreaking hyphen, but may apply -heuristics to convert some of these to breaking hyphens. - -=item * - -Pod formatters should make reasonable efforts to keep words of Perl -code from being broken across lines. For example, "Foo::Bar" in some -formatting systems is seen as eligible for being broken across lines -as "Foo::" newline "Bar" or even "Foo::-" newline "Bar". This should -be avoided where possible, either by disabling all line-breaking in -mid-word, or by wrapping particular words with internal punctuation -in "don't break this across lines" codes (which in some formats may -not be a single code, but might be a matter of inserting non-breaking -zero-width spaces between every pair of characters in a word.) - -=item * - -Pod parsers should, by default, expand tabs in verbatim paragraphs as -they are processed, before passing them to the formatter or other -processor. Parsers may also allow an option for overriding this. - -=item * - -Pod parsers should, by default, remove newlines from the end of -ordinary and verbatim paragraphs before passing them to the -formatter. For example, while the paragraph you're reading now -could be considered, in Pod source, to end with (and contain) -the newline(s) that end it, it should be processed as ending with -(and containing) the period character that ends this sentence. - -=item * - -Pod parsers, when reporting errors, should make some effort to report -an approximate line number ("Nested EE<lt>>'s in Paragraph #52, near -line 633 of Thing/Foo.pm!"), instead of merely noting the paragraph -number ("Nested EE<lt>>'s in Paragraph #52 of Thing/Foo.pm!"). Where -this is problematic, the paragraph number should at least be -accompanied by an excerpt from the paragraph ("Nested EE<lt>>'s in -Paragraph #52 of Thing/Foo.pm, which begins 'Read/write accessor for -the CE<lt>interest rate> attribute...'"). - -=item * - -Pod parsers, when processing a series of verbatim paragraphs one -after another, should consider them to be one large verbatim -paragraph that happens to contain blank lines. I.e., these two -lines, which have a blank line between them: - - use Foo; - - print Foo->VERSION - -should be unified into one paragraph ("\tuse Foo;\n\n\tprint -Foo->VERSION") before being passed to the formatter or other -processor. Parsers may also allow an option for overriding this. - -While this might be too cumbersome to implement in event-based Pod -parsers, it is straightforward for parsers that return parse trees. - -=item * - -Pod formatters, where feasible, are advised to avoid splitting short -verbatim paragraphs (under twelve lines, say) across pages. - -=item * - -Pod parsers must treat a line with only spaces and/or tabs on it as a -"blank line" such as separates paragraphs. (Some older parsers -recognized only two adjacent newlines as a "blank line" but would not -recognize a newline, a space, and a newline, as a blank line. This -is noncompliant behavior.) - -=item * - -Authors of Pod formatters/processors should make every effort to -avoid writing their own Pod parser. There are already several in -CPAN, with a wide range of interface styles -- and one of them, -Pod::Parser, comes with modern versions of Perl. - -=item * - -Characters in Pod documents may be conveyed either as literals, or by -number in EE<lt>n> codes, or by an equivalent mnemonic, as in -EE<lt>eacute> which is exactly equivalent to EE<lt>233>. - -Characters in the range 32-126 refer to those well known US-ASCII -characters (also defined there by Unicode, with the same meaning), -which all Pod formatters must render faithfully. Characters -in the ranges 0-31 and 127-159 should not be used (neither as -literals, nor as EE<lt>number> codes), except for the -literal byte-sequences for newline (13, 13 10, or 10), and tab (9). - -Characters in the range 160-255 refer to Latin-1 characters (also -defined there by Unicode, with the same meaning). Characters above -255 should be understood to refer to Unicode characters. - -=item * - -Be warned -that some formatters cannot reliably render characters outside 32-126; -and many are able to handle 32-126 and 160-255, but nothing above -255. - -=item * - -Besides the well-known "EE<lt>lt>" and "EE<lt>gt>" codes for -less-than and greater-than, Pod parsers must understand "EE<lt>sol>" -for "/" (solidus, slash), and "EE<lt>verbar>" for "|" (vertical bar, -pipe). Pod parsers should also understand "EE<lt>lchevron>" and -"EE<lt>rchevron>" as legacy codes for characters 171 and 187, i.e., -"left-pointing double angle quotation mark" = "left pointing -guillemet" and "right-pointing double angle quotation mark" = "right -pointing guillemet". (These look like little "<<" and ">>", and they -are now preferably expressed with the HTML/XHTML codes "EE<lt>laquo>" -and "EE<lt>raquo>".) - -=item * - -Pod parsers should understand all "EE<lt>html>" codes as defined -in the entity declarations in the most recent XHTML specification at -C<www.W3.org>. Pod parsers must understand at least the entities -that define characters in the range 160-255 (Latin-1). Pod parsers, -when faced with some unknown "EE<lt>I<identifier>>" code, -shouldn't simply replace it with nullstring (by default, at least), -but may pass it through as a string consisting of the literal characters -E, less-than, I<identifier>, greater-than. Or Pod parsers may offer the -alternative option of processing such unknown -"EE<lt>I<identifier>>" codes by firing an event especially -for such codes, or by adding a special node-type to the in-memory -document tree. Such "EE<lt>I<identifier>>" may have special meaning -to some processors, or some processors may choose to add them to -a special error report. - -=item * - -Pod parsers must also support the XHTML codes "EE<lt>quot>" for -character 34 (doublequote, "), "EE<lt>amp>" for character 38 -(ampersand, &), and "EE<lt>apos>" for character 39 (apostrophe, '). - -=item * - -Note that in all cases of "EE<lt>whatever>", I<whatever> (whether -an htmlname, or a number in any base) must consist only of -alphanumeric characters -- that is, I<whatever> must watch -C<m/\A\w+\z/>. So "EE<lt> 0 1 2 3 >" is invalid, because -it contains spaces, which aren't alphanumeric characters. This -presumably does not I<need> special treatment by a Pod processor; -" 0 1 2 3 " doesn't look like a number in any base, so it would -presumably be looked up in the table of HTML-like names. Since -there isn't (and cannot be) an HTML-like entity called " 0 1 2 3 ", -this will be treated as an error. However, Pod processors may -treat "EE<lt> 0 1 2 3 >" or "EE<lt>e-acute>" as I<syntactically> -invalid, potentially earning a different error message than the -error message (or warning, or event) generated by a merely unknown -(but theoretically valid) htmlname, as in "EE<lt>qacute>" -[sic]. However, Pod parsers are not required to make this -distinction. - -=item * - -Note that EE<lt>number> I<must not> be interpreted as simply -"codepoint I<number> in the current/native character set". It always -means only "the character represented by codepoint I<number> in -Unicode." (This is identical to the semantics of &#I<number>; in XML.) - -This will likely require many formatters to have tables mapping from -treatable Unicode codepoints (such as the "\xE9" for the e-acute -character) to the escape sequences or codes necessary for conveying -such sequences in the target output format. A converter to *roff -would, for example know that "\xE9" (whether conveyed literally, or via -a EE<lt>...> sequence) is to be conveyed as "e\\*'". -Similarly, a program rendering Pod in a Mac OS application window, would -presumably need to know that "\xE9" maps to codepoint 142 in MacRoman -encoding that (at time of writing) is native for Mac OS. Such -Unicode2whatever mappings are presumably already widely available for -common output formats. (Such mappings may be incomplete! Implementers -are not expected to bend over backwards in an attempt to render -Cherokee syllabics, Etruscan runes, Byzantine musical symbols, or any -of the other weird things that Unicode can encode.) And -if a Pod document uses a character not found in such a mapping, the -formatter should consider it an unrenderable character. - -=item * - -If, surprisingly, the implementor of a Pod formatter can't find a -satisfactory pre-existing table mapping from Unicode characters to -escapes in the target format (e.g., a decent table of Unicode -characters to *roff escapes), it will be necessary to build such a -table. If you are in this circumstance, you should begin with the -characters in the range 0x00A0 - 0x00FF, which is mostly the heavily -used accented characters. Then proceed (as patience permits and -fastidiousness compels) through the characters that the (X)HTML -standards groups judged important enough to merit mnemonics -for. These are declared in the (X)HTML specifications at the -www.W3.org site. At time of writing (September 2001), the most recent -entity declaration files are: - - http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent - http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent - http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent - -Then you can progress through any remaining notable Unicode characters -in the range 0x2000-0x204D (consult the character tables at -www.unicode.org), and whatever else strikes your fancy. For example, -in F<xhtml-symbol.ent>, there is the entry: - - <!ENTITY infin "∞"> <!-- infinity, U+221E ISOtech --> - -While the mapping "infin" to the character "\x{221E}" will (hopefully) -have been already handled by the Pod parser, the presence of the -character in this file means that it's reasonably important enough to -include in a formatter's table that maps from notable Unicode characters -to the codes necessary for rendering them. So for a Unicode-to-*roff -mapping, for example, this would merit the entry: - - "\x{221E}" => '\(in', - -It is eagerly hoped that in the future, increasing numbers of formats -(and formatters) will support Unicode characters directly (as (X)HTML -does with C<∞>, C<∞>, or C<∞>), reducing the need -for idiosyncratic mappings of Unicode-to-I<my_escapes>. - -=item * - -It is up to individual Pod formatter to display good judgment when -confronted with an unrenderable character (which is distinct from an -unknown EE<lt>thing> sequence that the parser couldn't resolve to -anything, renderable or not). It is good practice to map Latin letters -with diacritics (like "EE<lt>eacute>"/"EE<lt>233>") to the corresponding -unaccented US-ASCII letters (like a simple character 101, "e"), but -clearly this is often not feasible, and an unrenderable character may -be represented as "?", or the like. In attempting a sane fallback -(as from EE<lt>233> to "e"), Pod formatters may use the -%Latin1Code_to_fallback table in L<Pod::Escapes|Pod::Escapes>, or -L<Text::Unidecode|Text::Unidecode>, if available. - -For example, this Pod text: - - magic is enabled if you set C<$Currency> to 'E<euro>'. - -may be rendered as: -"magic is enabled if you set C<$Currency> to 'I<?>'" or as -"magic is enabled if you set C<$Currency> to 'B<[euro]>'", or as -"magic is enabled if you set C<$Currency> to '[x20AC]', etc. - -A Pod formatter may also note, in a comment or warning, a list of what -unrenderable characters were encountered. - -=item * - -EE<lt>...> may freely appear in any formatting code (other than -in another EE<lt>...> or in an ZE<lt>>). That is, "XE<lt>The -EE<lt>euro>1,000,000 Solution>" is valid, as is "LE<lt>The -EE<lt>euro>1,000,000 Solution|Million::Euros>". - -=item * - -Some Pod formatters output to formats that implement nonbreaking -spaces as an individual character (which I'll call "NBSP"), and -others output to formats that implement nonbreaking spaces just as -spaces wrapped in a "don't break this across lines" code. Note that -at the level of Pod, both sorts of codes can occur: Pod can contain a -NBSP character (whether as a literal, or as a "EE<lt>160>" or -"EE<lt>nbsp>" code); and Pod can contain "SE<lt>foo -IE<lt>barE<gt> baz>" codes, where "mere spaces" (character 32) in -such codes are taken to represent nonbreaking spaces. Pod -parsers should consider supporting the optional parsing of "SE<lt>foo -IE<lt>barE<gt> baz>" as if it were -"fooI<NBSP>IE<lt>barE<gt>I<NBSP>baz", and, going the other way, the -optional parsing of groups of words joined by NBSP's as if each group -were in a SE<lt>...> code, so that formatters may use the -representation that maps best to what the output format demands. - -=item * - -Some processors may find that the C<SE<lt>...E<gt>> code is easiest to -implement by replacing each space in the parse tree under the content -of the S, with an NBSP. But note: the replacement should apply I<not> to -spaces in I<all> text, but I<only> to spaces in I<printable> text. (This -distinction may or may not be evident in the particular tree/event -model implemented by the Pod parser.) For example, consider this -unusual case: - - S<L</Autoloaded Functions>> - -This means that the space in the middle of the visible link text must -not be broken across lines. In other words, it's the same as this: - - L<"AutoloadedE<160>Functions"/Autoloaded Functions> - -However, a misapplied space-to-NBSP replacement could (wrongly) -produce something equivalent to this: - - L<"AutoloadedE<160>Functions"/AutoloadedE<160>Functions> - -...which is almost definitely not going to work as a hyperlink (assuming -this formatter outputs a format supporting hypertext). - -Formatters may choose to just not support the S format code, -especially in cases where the output format simply has no NBSP -character/code and no code for "don't break this stuff across lines". - -=item * - -Besides the NBSP character discussed above, implementors are reminded -of the existence of the other "special" character in Latin-1, the -"soft hyphen" character, also known as "discretionary hyphen", -i.e. C<EE<lt>173E<gt>> = C<EE<lt>0xADE<gt>> = -C<EE<lt>shyE<gt>>). This character expresses an optional hyphenation -point. That is, it normally renders as nothing, but may render as a -"-" if a formatter breaks the word at that point. Pod formatters -should, as appropriate, do one of the following: 1) render this with -a code with the same meaning (e.g., "\-" in RTF), 2) pass it through -in the expectation that the formatter understands this character as -such, or 3) delete it. - -For example: - - sigE<shy>action - manuE<shy>script - JarkE<shy>ko HieE<shy>taE<shy>nieE<shy>mi - -These signal to a formatter that if it is to hyphenate "sigaction" -or "manuscript", then it should be done as -"sig-I<[linebreak]>action" or "manu-I<[linebreak]>script" -(and if it doesn't hyphenate it, then the C<EE<lt>shyE<gt>> doesn't -show up at all). And if it is -to hyphenate "Jarkko" and/or "Hietaniemi", it can do -so only at the points where there is a C<EE<lt>shyE<gt>> code. - -In practice, it is anticipated that this character will not be used -often, but formatters should either support it, or delete it. - -=item * - -If you think that you want to add a new command to Pod (like, say, a -"=biblio" command), consider whether you could get the same -effect with a for or begin/end sequence: "=for biblio ..." or "=begin -biblio" ... "=end biblio". Pod processors that don't understand -"=for biblio", etc, will simply ignore it, whereas they may complain -loudly if they see "=biblio". - -=item * - -Throughout this document, "Pod" has been the preferred spelling for -the name of the documentation format. One may also use "POD" or -"pod". For the documentation that is (typically) in the Pod -format, you may use "pod", or "Pod", or "POD". Understanding these -distinctions is useful; but obsessing over how to spell them, usually -is not. - -=back - - - - - -=head1 About LE<lt>...E<gt> Codes - -As you can tell from a glance at L<perlpod|perlpod>, the LE<lt>...> -code is the most complex of the Pod formatting codes. The points below -will hopefully clarify what it means and how processors should deal -with it. - -=over - -=item * - -In parsing an LE<lt>...> code, Pod parsers must distinguish at least -four attributes: - -=over - -=item First: - -The link-text. If there is none, this must be undef. (E.g., in -"LE<lt>Perl Functions|perlfunc>", the link-text is "Perl Functions". -In "LE<lt>Time::HiRes>" and even "LE<lt>|Time::HiRes>", there is no -link text. Note that link text may contain formatting.) - -=item Second: - -The possibly inferred link-text -- i.e., if there was no real link -text, then this is the text that we'll infer in its place. (E.g., for -"LE<lt>Getopt::Std>", the inferred link text is "Getopt::Std".) - -=item Third: - -The name or URL, or undef if none. (E.g., in "LE<lt>Perl -Functions|perlfunc>", the name -- also sometimes called the page -- -is "perlfunc". In "LE<lt>/CAVEATS>", the name is undef.) - -=item Fourth: - -The section (AKA "item" in older perlpods), or undef if none. E.g., -in L<Getopt::Std/DESCRIPTION>, "DESCRIPTION" is the section. (Note -that this is not the same as a manpage section like the "5" in "man 5 -crontab". "Section Foo" in the Pod sense means the part of the text -that's introduced by the heading or item whose text is "Foo".) - -=back - -Pod parsers may also note additional attributes including: - -=over - -=item Fifth: - -A flag for whether item 3 (if present) is a URL (like -"http://lists.perl.org" is), in which case there should be no section -attribute; a Pod name (like "perldoc" and "Getopt::Std" are); or -possibly a man page name (like "crontab(5)" is). - -=item Sixth: - -The raw original LE<lt>...> content, before text is split on -"|", "/", etc, and before EE<lt>...> codes are expanded. - -=back - -(The above were numbered only for concise reference below. It is not -a requirement that these be passed as an actual list or array.) - -For example: - - L<Foo::Bar> - => undef, # link text - "Foo::Bar", # possibly inferred link text - "Foo::Bar", # name - undef, # section - 'pod', # what sort of link - "Foo::Bar" # original content - - L<Perlport's section on NL's|perlport/Newlines> - => "Perlport's section on NL's", # link text - "Perlport's section on NL's", # possibly inferred link text - "perlport", # name - "Newlines", # section - 'pod', # what sort of link - "Perlport's section on NL's|perlport/Newlines" # orig. content - - L<perlport/Newlines> - => undef, # link text - '"Newlines" in perlport', # possibly inferred link text - "perlport", # name - "Newlines", # section - 'pod', # what sort of link - "perlport/Newlines" # original content - - L<crontab(5)/"DESCRIPTION"> - => undef, # link text - '"DESCRIPTION" in crontab(5)', # possibly inferred link text - "crontab(5)", # name - "DESCRIPTION", # section - 'man', # what sort of link - 'crontab(5)/"DESCRIPTION"' # original content - - L</Object Attributes> - => undef, # link text - '"Object Attributes"', # possibly inferred link text - undef, # name - "Object Attributes", # section - 'pod', # what sort of link - "/Object Attributes" # original content - - L<http://www.perl.org/> - => undef, # link text - "http://www.perl.org/", # possibly inferred link text - "http://www.perl.org/", # name - undef, # section - 'url', # what sort of link - "http://www.perl.org/" # original content - -Note that you can distinguish URL-links from anything else by the -fact that they match C<m/\A\w+:[^:\s]\S*\z/>. So -C<LE<lt>http://www.perl.comE<gt>> is a URL, but -C<LE<lt>HTTP::ResponseE<gt>> isn't. - -=item * - -In case of LE<lt>...> codes with no "text|" part in them, -older formatters have exhibited great variation in actually displaying -the link or cross reference. For example, LE<lt>crontab(5)> would render -as "the C<crontab(5)> manpage", or "in the C<crontab(5)> manpage" -or just "C<crontab(5)>". - -Pod processors must now treat "text|"-less links as follows: - - L<name> => L<name|name> - L</section> => L<"section"|/section> - L<name/section> => L<"section" in name|name/section> - -=item * - -Note that section names might contain markup. I.e., if a section -starts with: - - =head2 About the C<-M> Operator - -or with: - - =item About the C<-M> Operator - -then a link to it would look like this: - - L<somedoc/About the C<-M> Operator> - -Formatters may choose to ignore the markup for purposes of resolving -the link and use only the renderable characters in the section name, -as in: - - <h1><a name="About_the_-M_Operator">About the <code>-M</code> - Operator</h1> - - ... - - <a href="somedoc#About_the_-M_Operator">About the <code>-M</code> - Operator" in somedoc</a> - -=item * - -Previous versions of perlpod distinguished C<LE<lt>name/"section"E<gt>> -links from C<LE<lt>name/itemE<gt>> links (and their targets). These -have been merged syntactically and semantically in the current -specification, and I<section> can refer either to a "=headI<n> Heading -Content" command or to a "=item Item Content" command. This -specification does not specify what behavior should be in the case -of a given document having several things all seeming to produce the -same I<section> identifier (e.g., in HTML, several things all producing -the same I<anchorname> in <a name="I<anchorname>">...</a> -elements). Where Pod processors can control this behavior, they should -use the first such anchor. That is, C<LE<lt>Foo/BarE<gt>> refers to the -I<first> "Bar" section in Foo. - -But for some processors/formats this cannot be easily controlled; as -with the HTML example, the behavior of multiple ambiguous -<a name="I<anchorname>">...</a> is most easily just left up to -browsers to decide. - -=item * - -Authors wanting to link to a particular (absolute) URL, must do so -only with "LE<lt>scheme:...>" codes (like -LE<lt>http://www.perl.org>), and must not attempt "LE<lt>Some Site -Name|scheme:...>" codes. This restriction avoids many problems -in parsing and rendering LE<lt>...> codes. - -=item * - -In a C<LE<lt>text|...E<gt>> code, text may contain formatting codes -for formatting or for EE<lt>...> escapes, as in: - - L<B<ummE<234>stuff>|...> - -For C<LE<lt>...E<gt>> codes without a "name|" part, only -C<EE<lt>...E<gt>> and C<ZE<lt>E<gt>> codes may occur -- no -other formatting codes. That is, authors should not use -"C<LE<lt>BE<lt>Foo::BarE<gt>E<gt>>". - -Note, however, that formatting codes and ZE<lt>>'s can occur in any -and all parts of an LE<lt>...> (i.e., in I<name>, I<section>, I<text>, -and I<url>). - -Authors must not nest LE<lt>...> codes. For example, "LE<lt>The -LE<lt>Foo::Bar> man page>" should be treated as an error. - -=item * - -Note that Pod authors may use formatting codes inside the "text" -part of "LE<lt>text|name>" (and so on for LE<lt>text|/"sec">). - -In other words, this is valid: - - Go read L<the docs on C<$.>|perlvar/"$."> - -Some output formats that do allow rendering "LE<lt>...>" codes as -hypertext, might not allow the link-text to be formatted; in -that case, formatters will have to just ignore that formatting. - -=item * - -At time of writing, C<LE<lt>nameE<gt>> values are of two types: -either the name of a Pod page like C<LE<lt>Foo::BarE<gt>> (which -might be a real Perl module or program in an @INC / PATH -directory, or a .pod file in those places); or the name of a UNIX -man page, like C<LE<lt>crontab(5)E<gt>>. In theory, C<LE<lt>chmodE<gt>> -in ambiguous between a Pod page called "chmod", or the Unix man page -"chmod" (in whatever man-section). However, the presence of a string -in parens, as in "crontab(5)", is sufficient to signal that what -is being discussed is not a Pod page, and so is presumably a -UNIX man page. The distinction is of no importance to many -Pod processors, but some processors that render to hypertext formats -may need to distinguish them in order to know how to render a -given C<LE<lt>fooE<gt>> code. - -=item * - -Previous versions of perlpod allowed for a C<LE<lt>sectionE<gt>> syntax -(as in "C<LE<lt>Object AttributesE<gt>>"), which was not easily distinguishable -from C<LE<lt>nameE<gt>> syntax. This syntax is no longer in the -specification, and has been replaced by the C<LE<lt>"section"E<gt>> syntax -(where the quotes were formerly optional). Pod parsers should tolerate -the C<LE<lt>sectionE<gt>> syntax, for a while at least. The suggested -heuristic for distinguishing C<LE<lt>sectionE<gt>> from C<LE<lt>nameE<gt>> -is that if it contains any whitespace, it's a I<section>. Pod processors -may warn about this being deprecated syntax. - -=back - -=head1 About =over...=back Regions - -"=over"..."=back" regions are used for various kinds of list-like -structures. (I use the term "region" here simply as a collective -term for everything from the "=over" to the matching "=back".) - -=over - -=item * - -The non-zero numeric I<indentlevel> in "=over I<indentlevel>" ... -"=back" is used for giving the formatter a clue as to how many -"spaces" (ems, or roughly equivalent units) it should tab over, -although many formatters will have to convert this to an absolute -measurement that may not exactly match with the size of spaces (or M's) -in the document's base font. Other formatters may have to completely -ignore the number. The lack of any explicit I<indentlevel> parameter is -equivalent to an I<indentlevel> value of 4. Pod processors may -complain if I<indentlevel> is present but is not a positive number -matching C<m/\A(\d*\.)?\d+\z/>. - -=item * - -Authors of Pod formatters are reminded that "=over" ... "=back" may -map to several different constructs in your output format. For -example, in converting Pod to (X)HTML, it can map to any of -<ul>...</ul>, <ol>...</ol>, <dl>...</dl>, or -<blockquote>...</blockquote>. Similarly, "=item" can map to <li> or -<dt>. - -=item * - -Each "=over" ... "=back" region should be one of the following: - -=over - -=item * - -An "=over" ... "=back" region containing only "=item *" commands, -each followed by some number of ordinary/verbatim paragraphs, other -nested "=over" ... "=back" regions, "=for..." paragraphs, and -"=begin"..."=end" regions. - -(Pod processors must tolerate a bare "=item" as if it were "=item -*".) Whether "*" is rendered as a literal asterisk, an "o", or as -some kind of real bullet character, is left up to the Pod formatter, -and may depend on the level of nesting. - -=item * - -An "=over" ... "=back" region containing only -C<m/\A=item\s+\d+\.?\s*\z/> paragraphs, each one (or each group of them) -followed by some number of ordinary/verbatim paragraphs, other nested -"=over" ... "=back" regions, "=for..." paragraphs, and/or -"=begin"..."=end" codes. Note that the numbers must start at 1 -in each section, and must proceed in order and without skipping -numbers. - -(Pod processors must tolerate lines like "=item 1" as if they were -"=item 1.", with the period.) - -=item * - -An "=over" ... "=back" region containing only "=item [text]" -commands, each one (or each group of them) followed by some number of -ordinary/verbatim paragraphs, other nested "=over" ... "=back" -regions, or "=for..." paragraphs, and "=begin"..."=end" regions. - -The "=item [text]" paragraph should not match -C<m/\A=item\s+\d+\.?\s*\z/> or C<m/\A=item\s+\*\s*\z/>, nor should it -match just C<m/\A=item\s*\z/>. - -=item * - -An "=over" ... "=back" region containing no "=item" paragraphs at -all, and containing only some number of -ordinary/verbatim paragraphs, and possibly also some nested "=over" -... "=back" regions, "=for..." paragraphs, and "=begin"..."=end" -regions. Such an itemless "=over" ... "=back" region in Pod is -equivalent in meaning to a "<blockquote>...</blockquote>" element in -HTML. - -=back - -Note that with all the above cases, you can determine which type of -"=over" ... "=back" you have, by examining the first (non-"=cut", -non-"=pod") Pod paragraph after the "=over" command. - -=item * - -Pod formatters I<must> tolerate arbitrarily large amounts of text -in the "=item I<text...>" paragraph. In practice, most such -paragraphs are short, as in: - - =item For cutting off our trade with all parts of the world - -But they may be arbitrarily long: - - =item For transporting us beyond seas to be tried for pretended - offenses - - =item He is at this time transporting large armies of foreign - mercenaries to complete the works of death, desolation and - tyranny, already begun with circumstances of cruelty and perfidy - scarcely paralleled in the most barbarous ages, and totally - unworthy the head of a civilized nation. - -=item * - -Pod processors should tolerate "=item *" / "=item I<number>" commands -with no accompanying paragraph. The middle item is an example: - - =over - - =item 1 - - Pick up dry cleaning. - - =item 2 - - =item 3 - - Stop by the store. Get Abba Zabas, Stoli, and cheap lawn chairs. - - =back - -=item * - -No "=over" ... "=back" region can contain headings. Processors may -treat such a heading as an error. - -=item * - -Note that an "=over" ... "=back" region should have some -content. That is, authors should not have an empty region like this: - - =over - - =back - -Pod processors seeing such a contentless "=over" ... "=back" region, -may ignore it, or may report it as an error. - -=item * - -Processors must tolerate an "=over" list that goes off the end of the -document (i.e., which has no matching "=back"), but they may warn -about such a list. - -=item * - -Authors of Pod formatters should note that this construct: - - =item Neque - - =item Porro - - =item Quisquam Est - - Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci - velit, sed quia non numquam eius modi tempora incidunt ut - labore et dolore magnam aliquam quaerat voluptatem. - - =item Ut Enim - -is semantically ambiguous, in a way that makes formatting decisions -a bit difficult. On the one hand, it could be mention of an item -"Neque", mention of another item "Porro", and mention of another -item "Quisquam Est", with just the last one requiring the explanatory -paragraph "Qui dolorem ipsum quia dolor..."; and then an item -"Ut Enim". In that case, you'd want to format it like so: - - Neque - - Porro - - Quisquam Est - Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci - velit, sed quia non numquam eius modi tempora incidunt ut - labore et dolore magnam aliquam quaerat voluptatem. - - Ut Enim - -But it could equally well be a discussion of three (related or equivalent) -items, "Neque", "Porro", and "Quisquam Est", followed by a paragraph -explaining them all, and then a new item "Ut Enim". In that case, you'd -probably want to format it like so: - - Neque - Porro - Quisquam Est - Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci - velit, sed quia non numquam eius modi tempora incidunt ut - labore et dolore magnam aliquam quaerat voluptatem. - - Ut Enim - -But (for the forseeable future), Pod does not provide any way for Pod -authors to distinguish which grouping is meant by the above -"=item"-cluster structure. So formatters should format it like so: - - Neque - - Porro - - Quisquam Est - - Qui dolorem ipsum quia dolor sit amet, consectetur, adipisci - velit, sed quia non numquam eius modi tempora incidunt ut - labore et dolore magnam aliquam quaerat voluptatem. - - Ut Enim - -That is, there should be (at least roughly) equal spacing between -items as between paragraphs (although that spacing may well be less -than the full height of a line of text). This leaves it to the reader -to use (con)textual cues to figure out whether the "Qui dolorem -ipsum..." paragraph applies to the "Quisquam Est" item or to all three -items "Neque", "Porro", and "Quisquam Est". While not an ideal -situation, this is preferable to providing formatting cues that may -be actually contrary to the author's intent. - -=back - - - -=head1 About Data Paragraphs and "=begin/=end" Regions - -Data paragraphs are typically used for inlining non-Pod data that is -to be used (typically passed through) when rendering the document to -a specific format: - - =begin rtf - - \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par} - - =end rtf - -The exact same effect could, incidentally, be achieved with a single -"=for" paragraph: - - =for rtf \par{\pard\qr\sa4500{\i Printed\~\chdate\~\chtime}\par} - -(Although that is not formally a data paragraph, it has the same -meaning as one, and Pod parsers may parse it as one.) - -Another example of a data paragraph: - - =begin html - - I like <em>PIE</em>! - - <hr>Especially pecan pie! - - =end html - -If these were ordinary paragraphs, the Pod parser would try to -expand the "EE<lt>/em>" (in the first paragraph) as a formatting -code, just like "EE<lt>lt>" or "EE<lt>eacute>". But since this -is in a "=begin I<identifier>"..."=end I<identifier>" region I<and> -the identifier "html" doesn't begin have a ":" prefix, the contents -of this region are stored as data paragraphs, instead of being -processed as ordinary paragraphs (or if they began with a spaces -and/or tabs, as verbatim paragraphs). - -As a further example: At time of writing, no "biblio" identifier is -supported, but suppose some processor were written to recognize it as -a way of (say) denoting a bibliographic reference (necessarily -containing formatting codes in ordinary paragraphs). The fact that -"biblio" paragraphs were meant for ordinary processing would be -indicated by prefacing each "biblio" identifier with a colon: - - =begin :biblio - - Wirth, Niklaus. 1976. I<Algorithms + Data Structures = - Programs.> Prentice-Hall, Englewood Cliffs, NJ. - - =end :biblio - -This would signal to the parser that paragraphs in this begin...end -region are subject to normal handling as ordinary/verbatim paragraphs -(while still tagged as meant only for processors that understand the -"biblio" identifier). The same effect could be had with: - - =for :biblio - Wirth, Niklaus. 1976. I<Algorithms + Data Structures = - Programs.> Prentice-Hall, Englewood Cliffs, NJ. - -The ":" on these identifiers means simply "process this stuff -normally, even though the result will be for some special target". -I suggest that parser APIs report "biblio" as the target identifier, -but also report that it had a ":" prefix. (And similarly, with the -above "html", report "html" as the target identifier, and note the -I<lack> of a ":" prefix.) - -Note that a "=begin I<identifier>"..."=end I<identifier>" region where -I<identifier> begins with a colon, I<can> contain commands. For example: - - =begin :biblio - - Wirth's classic is available in several editions, including: - - =for comment - hm, check abebooks.com for how much used copies cost. - - =over - - =item - - Wirth, Niklaus. 1975. I<Algorithmen und Datenstrukturen.> - Teubner, Stuttgart. [Yes, it's in German.] - - =item - - Wirth, Niklaus. 1976. I<Algorithms + Data Structures = - Programs.> Prentice-Hall, Englewood Cliffs, NJ. - - =back - - =end :biblio - -Note, however, a "=begin I<identifier>"..."=end I<identifier>" -region where I<identifier> does I<not> begin with a colon, should not -directly contain "=head1" ... "=head4" commands, nor "=over", nor "=back", -nor "=item". For example, this may be considered invalid: - - =begin somedata - - This is a data paragraph. - - =head1 Don't do this! - - This is a data paragraph too. - - =end somedata - -A Pod processor may signal that the above (specifically the "=head1" -paragraph) is an error. Note, however, that the following should -I<not> be treated as an error: - - =begin somedata - - This is a data paragraph. - - =cut - - # Yup, this isn't Pod anymore. - sub excl { (rand() > .5) ? "hoo!" : "hah!" } - - =pod - - This is a data paragraph too. - - =end somedata - -And this too is valid: - - =begin someformat - - This is a data paragraph. - - And this is a data paragraph. - - =begin someotherformat - - This is a data paragraph too. - - And this is a data paragraph too. - - =begin :yetanotherformat - - =head2 This is a command paragraph! - - This is an ordinary paragraph! - - And this is a verbatim paragraph! - - =end :yetanotherformat - - =end someotherformat - - Another data paragraph! - - =end someformat - -The contents of the above "=begin :yetanotherformat" ... -"=end :yetanotherformat" region I<aren't> data paragraphs, because -the immediately containing region's identifier (":yetanotherformat") -begins with a colon. In practice, most regions that contain -data paragraphs will contain I<only> data paragraphs; however, -the above nesting is syntactically valid as Pod, even if it is -rare. However, the handlers for some formats, like "html", -will accept only data paragraphs, not nested regions; and they may -complain if they see (targeted for them) nested regions, or commands, -other than "=end", "=pod", and "=cut". - -Also consider this valid structure: - - =begin :biblio - - Wirth's classic is available in several editions, including: - - =over - - =item - - Wirth, Niklaus. 1975. I<Algorithmen und Datenstrukturen.> - Teubner, Stuttgart. [Yes, it's in German.] - - =item - - Wirth, Niklaus. 1976. I<Algorithms + Data Structures = - Programs.> Prentice-Hall, Englewood Cliffs, NJ. - - =back - - Buy buy buy! - - =begin html - - <img src='wirth_spokesmodeling_book.png'> - - <hr> - - =end html - - Now now now! - - =end :biblio - -There, the "=begin html"..."=end html" region is nested inside -the larger "=begin :biblio"..."=end :biblio" region. Note that the -content of the "=begin html"..."=end html" region is data -paragraph(s), because the immediately containing region's identifier -("html") I<doesn't> begin with a colon. - -Pod parsers, when processing a series of data paragraphs one -after another (within a single region), should consider them to -be one large data paragraph that happens to contain blank lines. So -the content of the above "=begin html"..."=end html" I<may> be stored -as two data paragraphs (one consisting of -"<img src='wirth_spokesmodeling_book.png'>\n" -and another consisting of "<hr>\n"), but I<should> be stored as -a single data paragraph (consisting of -"<img src='wirth_spokesmodeling_book.png'>\n\n<hr>\n"). - -Pod processors should tolerate empty -"=begin I<something>"..."=end I<something>" regions, -empty "=begin :I<something>"..."=end :I<something>" regions, and -contentless "=for I<something>" and "=for :I<something>" -paragraphs. I.e., these should be tolerated: - - =for html - - =begin html - - =end html - - =begin :biblio - - =end :biblio - -Incidentally, note that there's no easy way to express a data -paragraph starting with something that looks like a command. Consider: - - =begin stuff - - =shazbot - - =end stuff - -There, "=shazbot" will be parsed as a Pod command "shazbot", not as a data -paragraph "=shazbot\n". However, you can express a data paragraph consisting -of "=shazbot\n" using this code: - - =for stuff =shazbot - -The situation where this is necessary, is presumably quite rare. - -Note that =end commands must match the currently open =begin command. That -is, they must properly nest. For example, this is valid: - - =begin outer - - X - - =begin inner - - Y - - =end inner - - Z - - =end outer - -while this is invalid: - - =begin outer - - X - - =begin inner - - Y - - =end outer - - Z - - =end inner - -This latter is improper because when the "=end outer" command is seen, the -currently open region has the formatname "inner", not "outer". (It just -happens that "outer" is the format name of a higher-up region.) This is -an error. Processors must by default report this as an error, and may halt -processing the document containing that error. A corollary of this is that -regions cannot "overlap" -- i.e., the latter block above does not represent -a region called "outer" which contains X and Y, overlapping a region called -"inner" which contains Y and Z. But because it is invalid (as all -apparently overlapping regions would be), it doesn't represent that, or -anything at all. - -Similarly, this is invalid: - - =begin thing - - =end hting - -This is an error because the region is opened by "thing", and the "=end" -tries to close "hting" [sic]. - -This is also invalid: - - =begin thing - - =end - -This is invalid because every "=end" command must have a formatname -parameter. - -=head1 SEE ALSO - -L<perlpod>, L<perlsyn/"PODs: Embedded Documentation">, -L<podchecker> - -=head1 AUTHOR - -Sean M. Burke - -=cut - - diff --git a/web/bin/pod2wml.sh b/web/bin/pod2wml.sh deleted file mode 100755 index bb64d40..0000000 --- a/web/bin/pod2wml.sh +++ /dev/null @@ -1,61 +0,0 @@ -pod2wml (){ - base=$1 - [ -z "$descr" ] && descr=$base - [ -z "$menu" ] && menu=$descr - pod2html <$base.pod >$base.html -#Thing.pod Thing.html -# pod2html-5.8.8 --infile=$base.pod --outfile=$base.pre --noindex --htmlroot='$(ROOT)' --podroot=$SITEROOT --podpath=$PODPATH -# $SITEROOT/bin/fix-pod2html.pl $base.pre | $SITEROOT/bin/fix-hrefs.pl >$base.html - echo "<nav:but ${sect}_$base \"$menu\" $base/>" >>navbar.inc - printf "<dt><a href=\"$base.en.html\">" >>index.inc - grep -i $base $base.pod |fgrep ' - '|head -1|sed 's| - |</a></dt><dd>|' >>index.inc - echo "</dd>" >>index.inc - echo "<page page=\"${sect}_$base\"" > $base.wml - perl-5.8.8 -0777 -n -e 's|E<lt>|<|g;s|E<gt>|>|g;m|=head1 AUTHO\S+\s*(.+)| && do {$a=$1;$a =~ s/>.*/>/; $e="no\@address.nowhere";$a=~ s/\s*<(.+?)>\s*,?// and $e=$1; $e=~ s/\s\S+\s/\@/;print "author=\"$a <$e>\"/>\n"}' $base.pod >>$base.wml -true <<'XXXX' - perl-5.8.8 -0777 -n -e ' - s|.*?(<h1.+)</body>.*|$1|s; - for($i=5;$i>0;$i--){ - $j=$i-1; - s|(</?h)$j>|$1$i>|g - }; - s|<h2.*?>.*?NAME.*?</h2>.*?<p.*?>\s*(.+?)\s*- .*?</p>|<h1>$1</h1>|s; - s{<li></li>(.+?)(?=<li>|</?ul>|</?ol>)}{<li>$1</li>}sg; - s|<dt><strong>\s*(.*?)</strong>\s*<dd>|<dt>$1</dt>\n<dd>|sg; - s|<dd>\s*<p>\s*(.*?)\s*</p>\s*</dd>|<dd>$1</dd>|sg; - s|<li>\s*<p>([^<]+?)</p>\s*</li>|<li>$1</li>|sg; - s|<p>\s*</p>|\n|g; - s|\n\s|\n|g; - s|\s*</pre>\s*<pre>\s*|\n\n|g; - s|(\S)</pre>|$1\n</pre>|g; - s|<pre>(.+?)</pre>|<protect><pre>$1</pre></protect>|gs; -# s|<strong>\s*(.+?)\s*</strong><br />\s+</dt>|$1</dt>\n|g; - s|<hr />\s*(<h\d>)|$1|g; - s|<dd>\s*</dd>||gs; - s|<a href=".*?/website|<a href="\$(ROOT)|g; - s|(<h2><a.*?>)\s*(\S)(.+?)\s*(</a></h2>)|$1$2\L$3\E$4|g; - print - ' $base.html >>$base.wml -# rm $base.html - perl-5.8.8 -i~ -0777 -p -e 's|</dd>\s*<pre(.*?)</pre>\s*<dd>|</dd><dd><pre$1</pre></dd><dd>|sg' $base.wml -XXXX - perl-5.8.8 -0777 -n -e ' - s|<h2 id="NAME">.+?TENT">\s*<p>.*?\s-\s(.+?)</p>\s*</div>|<h1 id="NAME">$1</h1>|s; -# s|</p>\s*<dt>|</p></dd>\n<dt>|sg; -# s|</pre>\s*<dt>|</pre></dd>\n<dt>|sg; - s|<pre>(.+?)</pre>|<protect><pre>$1</pre></protect>|gs; -# s|.*?(<h1.+)</body>.*|$1|s; -# for($i=5;$i>0;$i--){ -# $j=$i-1; -# s|(</?h)$j>|$1$i>|g -# }; -# s{http://search.cpan.org/perldoc\?(cfgmaker|indexmaker|mrtg-.+?)"}{\$(ROOT)/doc/$1.en.html"}g; -# s|<h2.*?>.*?NAME.*?</h2>.*?<p.*?>\s*(.+?)\s*- .*?</p>|<h1>$1</h1>|s; - - print - ' $base.html >>$base.wml -# rm $base.html - rm $base.html -# $base.pre - descr="" -} diff --git a/web/build.sh b/web/build.sh deleted file mode 100755 index b533496..0000000 --- a/web/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -SITEROOT=`pwd` -PODPATH=`ls */build.sh | sed -e 's|/.*||g' | perl -0777 -e 'print join ":", map {"$_"} split /\n/, <>'` -export SITEROOT PODPATH -rm */pod*tmp -for x in `ls */build.sh | sed 's|/.*||g'`; do - echo '****' $x '****' - (cd $x;./build.sh) -done - - diff --git a/web/cast/build.sh b/web/cast/build.sh deleted file mode 100755 index 662e5a1..0000000 --- a/web/cast/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -perl -n -e 's/Tobi//;s/\s*[&+]\s*//;s/\s+and\s+//; /^From:\s*(\S+\s\S+)/i && do { $x=$1; $x =~ s/\s*<.+//;$x =~ s/"//g; $x=~ s/\s*location\s*$//; print "$x;\n"}' /home/oetiker/checkouts/mrtg/src/CHANGES | sort -u >contrib.inc diff --git a/web/cast/contrib.inc b/web/cast/contrib.inc deleted file mode 100644 index d545901..0000000 --- a/web/cast/contrib.inc +++ /dev/null @@ -1,379 +0,0 @@ -¶ÀªF¶©; -Adrian Minta; -Adrian Senn; -Adrian Turcu; -Akihiro Sagawa; -Albert Chin-A-Young; -Alberto Pasquale; -alex; -Alex; -Alexander V; -Alexandre BAUMEISTER; -Alexandre Steinberg; -Alexey Milevsky; -Alex Samorukov; -Alon Goldberg; -Al Payne; -Ambrose Li; -Amir Guindehi; -andre; -Andrea Rossi; -Andreas Papst; -Andreas Plesner; -Andrej Ota; -André Silveira; -Andres Kroonmaa; -Andrew A.; -Andrew Farrior; -Andrew Ivanov; -Anri Kopystyansky; -Anthony Fabian; -Anthony Howe; -Antonio Querubin; -Anton Voronin; -Artyom Adjemov; -Assakhof Bin; -Barry Rountree; -Barry van; -Bartosz Kwitniewski; -Ben; -Benjamin Despres; -Benjamin Gufler; -Benoit Artuso; -Bernard Martinet; -Bernd Drefs; -[big5] ¶ÀªF¶©; -bill shamam; -Bjorn Nordbo; -Blair Zajac; -blube; -Brad; -Brian Lube; -Brian Mudge; -Bruijn de,; -Butch Kemper; -calle olsen; -Calle Olsen; -Chad Mynhier; -CHOI Junho; -Chris Chiappa; -Chris Knipe; -chris.merrett melbourne.co.uk; -Chris Pepper; -Christian Birchinger; -Christian Rost; -Clas Mayer; -CmdrData; -Colin Horsington; -Colin Morey; -Cristian Caramida; -Curtis Doty; -Daisuke Aoyama; -Damien; -Dan Harkless; -Daniel Elvin; -Daniel Haun; -Daniel J; -Daniel Trinkle; -Dan Lukes; -Dan.McDonald austinenergy.com; -Dave Habben; -Dave Plonka; -David A.; -David Boone; -David Boyer; -David Corlette; -David Lee; -Davids, Ronald; -Dean, Mike; -Delev Zoran; -dima; -Dima Sivachenko; -Dimitar Kazakov; -Dimitar Pashev; -Dimitrios Stergiou; -Dinko Korunic; -Diogo Gomes; -Dmitry S.; -Dmitry Sivachenko; -Do Jong; -donlong; -Don Russell; -duncan_j_ferguson at; -Emilio Mena; -Erek Dyskant; -Eric Billeter; -Eric Einhorn; -Eric Murat; -Fabian Uebersax; -Fabrice Prigent; -Ferenc Toth; -Fernando Braghetto; -Fernando Nieto; -Francis VIVAT; -Francois Wolmarans; -Fred Korz; -Fuminori -Tany-; -Fuminori Uematsu; -Gellatly, Laurie; -Georgi Georgiev; -Gereon Ruetten; -Gerry Van; -Gianmarco Armellin; -Gill, Vern; -Gleydson Mazioli; -GOMEZ Henri; -Gordon Tetlow; -Gosselin, Gerry; -Graziano; -Graziano Sommariva; -Guenter Knauf; -Günter Knauf; -Hal Dell; -Halldor.Hognason; -Henning P; -Henry Steinhauer; -HERITIER Hervé; -Herold Heiko; -Hideyuki Suzuki; -Hleb Valoshka; -Hoorelbeke Rik; -Horak Daniel; -Hubert Figuiere; -Hui Zhang; -hw; -Ian Duplisse; -Ilja Pavkovic; -imacat; -Iulian Radu; -jackie; -Jaime Damiao; -Jakob Ilves; -Jamaludin Ahmad; -James Golovich; -James Overbeck; -Jan Kasprzak; -Jay Soffian; -Jef Considine; -Jeff Frost; -Jeff Liebermann; -Jeff Woolsey; -Jeremy Chadwick; -Jeremy Hinton; -Jeremy J.; -Jerzy Sobczyk; -Jessica Blackburn; -J. Nick; -Jodok Sutterluety; -Joe Pruett; -Johannes Demel; -John Begley; -john.belshaw cggveritas.com; -John Caruso; -John Dunning/NS/WSC; -John H.; -John Lange; -John Line; -John-Mark Gurney; -John Papandriopoulos; -John Van; -Jonathan Cohn; -Jon Barber; -Jones, Derek; -Jon Rifkin; -Joshua Nichols; -Jozsef Szilagyi; -jpturchi at; -Juergen Baier; -Juergen Obermann; -Juha Laine; -Jussi Siponen; -Justin McCann; -Justin Schoonover; -Justin Shore; -Kari.Hiitola; -Karl Friesen; -Karl M.; -Kenji; -Ken Stieers; -Kevin Benton; -Kevin Sartorelli; -Kit-pui Wong; -Klaus_Klein; -Klaus Schmidinger; -Klemens Kasemaa; -Kloberg Mac; -knut.groneng; -Krister Karlsson; -Ladislav Mihok; -Lars Christiansen; -Lech Szychowski; -Leitch, Roger; -Leonardo Reginin; -Leon Chang; -Levente Nagy; -LLuís Gras; -Lorenzo Colitti; -Lucas; -Lucas Nussbaum; -Luc Pauwels; -Luiz Encarnacao; -Luiz Felipe; -Lukasz Jokiel; -Mac Daddy; -Marc Baudoin; -Marcelo Roccasalva; -Mark D.; -Markley P.; -Markus Schlup; -Martin.Frys; -Martin Goebel; -Martin Opitz; -Martin Røsjorde; -MASUDA Takashi; -Mateusz; -Matija Grabnar; -Matthew Schumacher; -Matthias Cramer; -Mattias Lilliesköld; -Michael Bussmann; -Michael C.; -Michael Med; -Michael P.; -Michael_Soulier; -Michel; -Michele Michelotto; -Miguel Vitorino; -Mike Lawrie; -Mike Mitchel; -Mike Mitchell; -Mike Nealon; -Mike Tkatchouk; -Miloslav Trmac; -Miroslaw.Maczka; -Moose God; -MORI, Takahiro; -Morten Nielsen; -Morten S.; -Nathan Wiger; -Newman, Daniel; -Nick Ellson; -Nick Hilliard; -Nico Kadel-Garcia; -Norbert Klasen; -Norbert.Klasen; -Norm; -Norman Aronsen; -Norman Rasmussen; -NormW; -Oleg Krotoff; -Olexander Kunytsa; -oliver.haid; -Oliver Lehmann; -O'Shaughnessy Evans; -ozgurcd; -Pascal Eeftinck; -Patrick Koppen; -Patrik Andersin; -Paul E.; -Paul Slootman; -Pavel Gulchouck; -Pawe? Go?aszewski; -Pedro Marcolino; -Peter; -Peter Gervai; -Peter K; -Peter W.; -Peter Wirdemo; -Philipp Capoy; -Philippe.Simonet; -Pierfrancesco Caci; -Pietro Falessi; -Poetzel, Christopher; -Purvis, William; -Quentin Dunchue; -Quip; -Rafael Martinez; -Rainer Bawidamann; -Rainer.Bawidamann; -Ralf Weber; -Ratko Bucic; -Rawlin Blake; -redrat at; -Ricardo Bravo; -Richard Bullington-McGuire; -Richard Kwong; -riocat(^..^)~; -Robert Allmeroth; -Robert Boyle; -Roddy Strachan; -Rodrigue Assard; -Roman Festchook; -Ronald Florence; -Rory Clancy; -Roy-Magne Mo; -Ruben Cheng; -Russell Carleton; -Russ Price; -Ryan Finnie; -Sergio Chiesa; -Sergiy Guminilovych; -seweryn; -Simon Barnes; -Simon Butcher; -Simon Leinen; -Simon LeinenMike; -Simon Lyall; -Simos Xenitellis; -Spain, Jeffry; -Starkweather, Mike; -Stefan Loidl; -Stefan.Schnitter t-systems.com; -Stefan stefan; -Stephen Heise; -Stephen Satchell; -Steve Alligood; -Steve Bonds; -Steven Bakker; -Steven Micallef; -Steven Shipway; -Steven.Shipway; -Steve Pierce,; -Steve Shipway; -Stieers, Ken; -Stuart Henderson; -Sune Kirkeby; -Systems Administrator; -Szabo Balazs; -Tate; -Thomas Abthorpe; -Thomas Brian; -Thomas Lehnig; -Thomas Muggli; -Tim Cimarusti; -Tomas Pospisek; -Tom Pala; -Tony-Farr (Canberra); -T. Pospisek; -Ù¤Âê¹û; -Ulf Härnhammar; -Us; -Valerio Bontempi; -ve; -Vitezslav Crhonek; -Vlado Potisk; -Walery Kokarev; -webmaster; -Willem Jaap; -William P.; -Wolfgang Hoffmann; -x; -Xenitellis S; -Yo; -yoshimoto; -yours truely; -Yovko Lambrev; -Yozo Toda; -Yusaku Nakajima; -Zaphod Beeblebrox; -zurkabsd; diff --git a/web/cast/index.wml b/web/cast/index.wml deleted file mode 100644 index 66149b9..0000000 --- a/web/cast/index.wml +++ /dev/null @@ -1,31 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "cast"> - -<H1>Cast</H1> - -<h2>Main Characters</h2> - -<p><b><a href="http://tobi.oetiker.ch">Tobias Oetiker</a></b> -- original design, main developer.</p> -<p><b>Dave Rand</b> -- created the rateup program and got me started on mrtg-2.</p> -<p><b>Simon Leinen</b> -- wrote the perl SNMP library included with mrtg.</p> -<p><b>Daniel J McDonald</b> and <b>Mike Mitchell</b> -- contributed SNMPv3 support.</p> -<p><b>Jakob Ilves</b> -- rewrote cfgmaker for maximum flexibilty.</p> -<p><b>Valerio Bontempi</b> and <b>Lorenzo Colitti</b> -- added IpV6 support.</p> -<p><b>Alex van den Bogaerdt</b> and <b>Paul C. Williamson</b> -- act as mailinglist guardians.</p> - -<h2>Also With</h2> - -<p><b><a href="http://www.timkennedy.net">Tim Kennedy</a></b> -- who provides the www.mrtg.org dns reflector</p> - -<h2>Additional Cast</h2> - -<p>Over the years many people have coded for MRTG. Their contributions -have helped greatly to make MRTG as useful as it is today.</p> - -<p> -#include "contrib.inc" -</p> - -<p>Note that above list is generated from the records I have in the CHANGES -file. If your name came out wrong, please let me know so that I can fix -it.</p> diff --git a/web/design.css b/web/design.css deleted file mode 100644 index 4865530..0000000 --- a/web/design.css +++ /dev/null @@ -1,316 +0,0 @@ -body { - background-color:#FFFFFF; - padding:10px; - font-family: sans-serif; - margin:0px; - max-width: 80em; - min-width: 910px; -} - -/* hide old stuff */ -.legacy { - display: none -} - -#page_header { - background-image : url('images/mrtg_logo.gif'); - background-repeat : no-repeat; - background-position: 0px 10px; - height:71px; - width:100%; - font-size: 10pt; - text-align:right; - border-bottom:3px solid #fe754d; - padding-top:25px; -} - -#page_header a { - color:#345d98; - text-decoration: none; -} - -#main_container { - width: 100%; -} - - -.orange_ruller { -height:3px; -font-size:2px; -background-color: #fe754d; -width:100%; -margin:1px 0px; -padding:0px; -clear :both; -} - -/*Navbar styles start*/ -#navbar_container { - width: 205px; -} - -#menu { - width:205px; - vertical-align:top; - font-size: 10pt; -} - -#menu a { - text-decoration : none; -} -#menu a:hover { - text-decoration : underline; -} - - -/*Removing list decoration in navbar*/ -div#menu ul { - padding:0px; - margin:0px; -} -div#menu li { - list-style-type:none; - padding:0px; - margin:0px; -} - -div#menu li > div { - padding-top: 2px; -} -div#menu > ul > li > div.selected_head { - border:1px solid #345d98; - background-image : url('images/minus.gif'); - background-repeat : no-repeat; - background-position : 4px 0.4ex; - background-color : #345d98; - margin:1px 0px; -} - -div#menu > ul > li > div.selected_head > a { - color : #ffffff; - font-weight:bold; -} - - - -div#menu > ul > li > div { - border:1px solid #345d98; - background-image : url('images/plus.gif'); - background-repeat : no-repeat; - background-position : 4px 0.4ex; - background-color : #345d98; - margin:1px 0px; - padding-left:17px; -} - -div#menu ul > li > div.selected { - background-image : url('images/arr_black_right.gif'); - background-position : 4px 0.5ex; - background-color :#fe754d; - color : #345d98; - font-weight:bold; -} - -div#menu > ul > li > div > a { - color : #ffffff; - font-weight:bold; -} - -div#menu > ul > li > ul > li > div { - background-color:#ffffff; - margin:1px 0px; - border : 1px solid #345d98; -} -div#menu > ul > li > ul > li > div > a { - background-color:#ffffff; - color : #345d98; - font-weight:bold; - margin-left:15px; -} - - -div#menu > ul > li > ul > li > div.selected { - background-image:url('images/arr_black_right.gif'); - background-repeat: no-repeat; - background-position: 5px 0.5ex; - background-color: #fe754d; - border:1px solid #345d98; - padding-left:15px; - font-weight:bold; -} - -div#menu > ul > li > ul > li > div.selected > a { - color:#FFFFFF; -} - - -div#menu > ul > li > ul > li > div.selected_head { - background-image:url('images/arr_black.gif'); - background-repeat : no-repeat; - background-position : 5px 0.6ex; - background-color :#fe754d; - border:1px solid #345d98; -} - -div#menu > ul > li > ul > li > div.selected_head > a { - margin-left:15px; - color:#FFFFFF; - background-color :#fe754d; - font-weight:bold; -} - -div#menu > ul > li > ul > li > ul > li > div { - background-color:#e4e4e4; - background-image:url('images/arr_white.gif'); - background-repeat:no-repeat; - background-position:15px 3px; - border:1px solid #345d98; - margin-top:1px; -} -div#menu > ul > li > ul > li > ul > li > div a { - color : #345d98; - margin-left:23px; -} - -/*Navbar styles end*/ - -/* Content styles start*/ -#content_container { - vertical-align:top; - padding-left:20px; - line-height: 2.6ex; -} - -#content_container h1 { - background-color:#e4e4e4; - padding-left:8px; - padding-top:0.6ex; - padding-bottom: 0.5ex; - margin-top: 1px; - margin-bottom:0.3ex; - line-height: 2.0ex; - -} - -#content_container h1, -#content_container h2, -#content_container h3 -{ - color:#345d98; -} - -#content_container a { - text-decoration:none; -} - -#content_container a[href] { - color:#345d98; - font-weight:bold; - text-decoration:underline; -} - -#content_container pre { - border-style: solid; - border-width: 1px; - border-color: #345d98; - padding: 5px; -} - -#content_container dt { - margin-top: 1ex; - color:#345d98; - font-weight:bold; -} - -#content_container dt a { - color:#345d98; - font-weight:bold; -} - -#content_container dd { - margin-left: 0px; -} - -#content_container dd a { - color:#345d98; - font-weight:bold; -} - -.desc_text { - font-weight:normal; - font-size:10pt; - color : #000000; -} -.orange { - color:#fe754d; -} -/* Content styles end*/ - -/* Footer styles start */ - -#content_container #pageauthor { - color: black; - padding-top: 1em; - padding-bottom: 1em; - font-size: small; -} - -#content_container #pageauthor > a { - text-decoration: none; - color: black; - font-weight:normal; -} - -div#googlead_right { - background-color: #ffffff; - padding-left: 15px; - padding-top: 1px; - padding-bottom: 10px; - float: right; -} - -div#googlead_firefox { - padding-top: 20px; -} - -#page_footer { - clear:both; - /* - background-image : url('images/foot_logo.jpg'); - background-repeat : no-repeat; - background-position : 0px 5px; - */ - border-top:6px solid #345d98; - text-align:right; - height:80px; - width:100%; -} -.footer_splitter { - margin-top:2px; - width:100%; -} -.footer_splitter -#footer_logo { - text-align:left; - vertical-align:middle; -} -#footer_logo img { - margin-top:2px; - border:none; -} -.footer_splitter td { - padding:0px; - margin:0px; - vertical-align:middle; - text-align:right; -} -#page_footer, -#page_footer a { - color:black; - font-weight:normal; - font-size: 10pt; - text-decoration:none; -} - - -/*Footer styles end*/ diff --git a/web/doc/.gitignore b/web/doc/.gitignore deleted file mode 100644 index b1277aa..0000000 --- a/web/doc/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pod -*.wml -*.tmp
\ No newline at end of file diff --git a/web/doc/build.sh b/web/doc/build.sh deleted file mode 100755 index 89c746e..0000000 --- a/web/doc/build.sh +++ /dev/null @@ -1,25 +0,0 @@ - -#!/bin/sh -sect=doc -src=/home/oetiker/checkouts/mrtg/src/ -. ../bin/pod2wml.sh - -pod2descr() { - pod=$1.pod - descr=`egrep "$1 *- " $pod|head -1|sed 's/.*- //'` - menu=`egrep "$1 *- " $pod|head -1|sed 's/ -.*//'` -} - - -# build probe list -rm -f navbar.inc -rm -f index.inc - -for pod in mrtg.pod mrtg-unix-guide.pod mrtg-nt-guide.pod mrtg-nw-guide.pod mrtg-reference.pod cfgmaker.pod indexmaker.pod mrtg-contrib.pod mrtg-faq.pod mrtg-ipv6.pod mrtg-logfile.pod mrtg-mibhelp.pod mrtg-rrd.pod mrtg-webserver.pod; do - base=`echo $pod |sed 's,.pod,,'` - echo $base - cat $src/doc/$pod > $base.pod - pod2descr $base - pod2wml $base -done - diff --git a/web/doc/index.inc b/web/doc/index.inc deleted file mode 100644 index 87d3ed3..0000000 --- a/web/doc/index.inc +++ /dev/null @@ -1,28 +0,0 @@ -<dt><a href="mrtg.en.html">mrtg</a></dt><dd>What is MRTG ? -</dd> -<dt><a href="mrtg-unix-guide.en.html">mrtg-unix-guide</a></dt><dd>The MRTG 2.17.4 Linux/Unix Installation Guide -</dd> -<dt><a href="mrtg-nt-guide.en.html">mrtg-nt-guide</a></dt><dd>The MRTG 2.17.4 Windows Installation Guide -</dd> -<dt><a href="mrtg-nw-guide.en.html">mrtg-nw-guide</a></dt><dd>MRTG for NetWare -</dd> -<dt><a href="mrtg-reference.en.html">mrtg-reference</a></dt><dd>MRTG 2.17.4 configuration reference -</dd> -<dt><a href="cfgmaker.en.html">cfgmaker</a></dt><dd>Creates mrtg.cfg files (for mrtg-2.17.4) -</dd> -<dt><a href="indexmaker.en.html">indexmaker</a></dt><dd>Creates index files for mrtg web sites (mrtg-2.17.4) -</dd> -<dt><a href="mrtg-contrib.en.html">mrtg-contrib</a></dt><dd>Contribution Guidelines for MRTG -</dd> -<dt><a href="mrtg-faq.en.html">mrtg-faq</a></dt><dd>How to get help if you have problems with MRTG -</dd> -<dt><a href="mrtg-ipv6.en.html">mrtg-ipv6</a></dt><dd>IPv6 support in MRTG -</dd> -<dt><a href="mrtg-logfile.en.html">mrtg-logfile</a></dt><dd>description of the mrtg-2 logfile format -</dd> -<dt><a href="mrtg-mibhelp.en.html">mrtg-mibhelp</a></dt><dd>A Table of some interesting OIDs -</dd> -<dt><a href="mrtg-rrd.en.html">mrtg-rrd</a></dt><dd>How to use RRDtool with MRTG -</dd> -<dt><a href="mrtg-webserver.en.html">mrtg-webserver</a></dt><dd>hints for web server configuration -</dd> diff --git a/web/doc/index.wml b/web/doc/index.wml deleted file mode 100644 index 66780b3..0000000 --- a/web/doc/index.wml +++ /dev/null @@ -1,8 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "doc"> - -<H1>MRTG Documentation</H1> - -<dl> -#include "index.inc" -</dl> diff --git a/web/doc/navbar.inc b/web/doc/navbar.inc deleted file mode 100644 index 193daa1..0000000 --- a/web/doc/navbar.inc +++ /dev/null @@ -1,14 +0,0 @@ -<nav:but doc_mrtg "mrtg" mrtg/> -<nav:but doc_mrtg-unix-guide "mrtg-unix-guide" mrtg-unix-guide/> -<nav:but doc_mrtg-nt-guide "mrtg-nt-guide" mrtg-nt-guide/> -<nav:but doc_mrtg-nw-guide "mrtg-nw-guide" mrtg-nw-guide/> -<nav:but doc_mrtg-reference "mrtg-reference" mrtg-reference/> -<nav:but doc_cfgmaker "cfgmaker" cfgmaker/> -<nav:but doc_indexmaker "indexmaker" indexmaker/> -<nav:but doc_mrtg-contrib "mrtg-contrib" mrtg-contrib/> -<nav:but doc_mrtg-faq "mrtg-faq" mrtg-faq/> -<nav:but doc_mrtg-ipv6 "mrtg-ipv6" mrtg-ipv6/> -<nav:but doc_mrtg-logfile "mrtg-logfile" mrtg-logfile/> -<nav:but doc_mrtg-mibhelp "mrtg-mibhelp" mrtg-mibhelp/> -<nav:but doc_mrtg-rrd "mrtg-rrd" mrtg-rrd/> -<nav:but doc_mrtg-webserver "mrtg-webserver" mrtg-webserver/> diff --git a/web/download.wml b/web/download.wml deleted file mode 100644 index fa52d44..0000000 --- a/web/download.wml +++ /dev/null @@ -1,20 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "down"> - -<H1>MRTG Download</H1> - -You can download MRTG from several places: - -<H2>Primary Distribution Point</H2> - -<p>If you are running Unix, look for the *.tar.gz files, if you work with -Windows, you will be happier with the *.zip files.</p> - -<UL> - <LI><A HREF="pub/?M=D">Stable Release</A></LI> - <LI><A HREF="pub/beta/?M=D">Development SnapShots</A></LI> -</UL> - -<p>You might want to read the <a href="doc/">documentation</a> for inspiration on -how to install and configure it.</p> - diff --git a/web/fb-logo.png b/web/fb-logo.png Binary files differdeleted file mode 100644 index 3da6d85..0000000 --- a/web/fb-logo.png +++ /dev/null diff --git a/web/hoster.html b/web/hoster.html deleted file mode 100644 index 7f1f48c..0000000 --- a/web/hoster.html +++ /dev/null @@ -1,23 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -<head> -<style type="text/css"> -body { - margin: 0px; - padding: 0px; - font-family: sans-serif; -} - -#hoster a { - color: black; - text-decoration: none; -} -</style> -</head> -<body> -<div id="hoster"> -<a target="_top" href="http://www.init7.com/bandwidth.php">bandwidth</a> by <a href="http://www.init7.net/" target="_top">Init7</a> -</div> -</body> -</html> diff --git a/web/images/arr_black.gif b/web/images/arr_black.gif Binary files differdeleted file mode 100644 index 9245579..0000000 --- a/web/images/arr_black.gif +++ /dev/null diff --git a/web/images/arr_black_right.gif b/web/images/arr_black_right.gif Binary files differdeleted file mode 100644 index 19e5634..0000000 --- a/web/images/arr_black_right.gif +++ /dev/null diff --git a/web/images/arr_white.gif b/web/images/arr_white.gif Binary files differdeleted file mode 100644 index d6745b2..0000000 --- a/web/images/arr_white.gif +++ /dev/null diff --git a/web/images/foot_logo.gif b/web/images/foot_logo.gif Binary files differdeleted file mode 100644 index ea4fa24..0000000 --- a/web/images/foot_logo.gif +++ /dev/null diff --git a/web/images/foot_px.gif b/web/images/foot_px.gif Binary files differdeleted file mode 100644 index 1844f54..0000000 --- a/web/images/foot_px.gif +++ /dev/null diff --git a/web/images/minus.gif b/web/images/minus.gif Binary files differdeleted file mode 100644 index 6b81c89..0000000 --- a/web/images/minus.gif +++ /dev/null diff --git a/web/images/mrtg_logo.gif b/web/images/mrtg_logo.gif Binary files differdeleted file mode 100644 index d7b0552..0000000 --- a/web/images/mrtg_logo.gif +++ /dev/null diff --git a/web/images/plus.gif b/web/images/plus.gif Binary files differdeleted file mode 100644 index c98fa95..0000000 --- a/web/images/plus.gif +++ /dev/null diff --git a/web/images/px.gif b/web/images/px.gif Binary files differdeleted file mode 100644 index 8ac8785..0000000 --- a/web/images/px.gif +++ /dev/null diff --git a/web/images/spacer.gif b/web/images/spacer.gif Binary files differdeleted file mode 100644 index 5bfd67a..0000000 --- a/web/images/spacer.gif +++ /dev/null diff --git a/web/inc/IE7/README.txt b/web/inc/IE7/README.txt deleted file mode 100644 index e546ce4..0000000 --- a/web/inc/IE7/README.txt +++ /dev/null @@ -1,34 +0,0 @@ -Installation
-------------
-
-Follow these simple instructions to get IE7 working immediately on your server:
-
- * download the latest IE7 ZIP file (https://sourceforge.net/project/showfiles.php?group_id=109983&package_id=119707)
-
- * extract the contents to a directory on your server (keep the folder names used in the ZIP)
-
- * you will now have an IE7 directory on your server
-
- * include the IE7 JavaScript library in the page you wish to test
-
- <!-- compliance patch for microsoft browsers -->
- <!--[if lt IE 7]><script src="/ie7/ie7-standard-p.js" type="text/javascript"></script><![endif]-->
-
- * make sure this also points to the same directory
-
- * open the page in your web browser
-
- * the page should now be IE7 enabled.
-
- * if you are using the PNG solution then be aware that it operates on files
- names "something-trans.png"
-
- * see this page for more configuration and usage options:
- http://dean.edwards.name/IE7/usage/
-
-You may extract the contents of the ZIP file to your hard disk if you do not have access to a web server.
-
-
-Enjoy ;-)
-
-Dean Edwards, 23rd May 2005
diff --git a/web/inc/IE7/blank.gif b/web/inc/IE7/blank.gif Binary files differdeleted file mode 100644 index a4fe2e6..0000000 --- a/web/inc/IE7/blank.gif +++ /dev/null diff --git a/web/inc/IE7/ie7-base64.php b/web/inc/IE7/ie7-base64.php deleted file mode 100644 index 530392d..0000000 --- a/web/inc/IE7/ie7-base64.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php
-$data = split(";", $_SERVER["REDIRECT_QUERY_STRING"]);
-$type = $data[0];
-$data = split(",", $data[1]);
-header("Content-type: ".$type);
-echo base64_decode($data[1]);
-?>
\ No newline at end of file diff --git a/web/inc/IE7/ie7-content.htc b/web/inc/IE7/ie7-content.htc deleted file mode 100644 index cc480cb..0000000 --- a/web/inc/IE7/ie7-content.htc +++ /dev/null @@ -1,14 +0,0 @@ -<html>
-<!--
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
--->
-<head>
-<object id="dummy" width="0" height="0"></object>
-<base id="base">
-<style type="text/css">html,body,img{margin:0;}img{vertical-align:top}#dummy{display:inline}</style>
-<script type="text/javascript">public_description=new function(){var l=false;this.ie7_anon=true;this.load=function(o,c,u){if(l)return;l=true;base.href=o.document.URL;dummy.style.cssText=c;var _0=o.parentElement;var _1=Boolean(dummy.currentStyle.display=="inline");function r(){o.runtimeStyle.width=(_1)?image.offsetWidth:"100%";o.runtimeStyle.height=body.offsetHeight};image.onreadystatechange=function(){if(this.readyState=="complete")_2()};image.src=u;function _2(){function copy(p){try{body.style[p]=_0.currentStyle[p]}catch(i){}};for(var j in body.currentStyle)copy(j);body.style.width="";body.style.height="";body.style.border="none";body.style.padding="0";body.style.margin="0";body.style.textIndent="";body.style.position="static";while(_0&&_0.currentStyle.backgroundColor=="transparent"){_0=_0.parentElement}if(_0)document.body.style.backgroundColor=_0.currentStyle.backgroundColor;body.runtimeStyle.cssText=c;body.runtimeStyle.margin="0";if(_1)body.runtimeStyle.width="";r()}}};</script>
-</head>
-<body><span id="body"><img id="image"></span></body>
-</html>
diff --git a/web/inc/IE7/ie7-core.js b/web/inc/IE7/ie7-core.js deleted file mode 100644 index c3dbcef..0000000 --- a/web/inc/IE7/ie7-core.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('x(!1M.1j)z 6(){1l{1M.1j=8;4 1W=8.2m=z 26;8.O=6(){7"1j 2q 0.9 (5G)"};4 36=/36/.B(42.41.40);4 1G=(36)?6(m){1M.1G(1j+"\\n\\n"+m)}:1W;4 2t=5F.2t.1g(/5E (\\d\\.\\d)/)[1];4 2z=K.5D!="5C";x(/5B/.B(42.41.40)||2t<5||!/^5A/.B(K.1J.2A))7;4 1H=K.39=="1H";4 1t,5z;4 1J=K.1J,2s,3X,17=K.17;4 5y="!";4 22={};4 1u=1C;1j.2m=6(n,s){x(!22[n]){x(1u)1k("s="+2o(s));22[n]=z s()}};4 R=/^[\\w\\.]+[^:]*$/;6 1I(h,p){x(R.B(h))h=(p||"")+h;7 h};6 2e(h,p){h=1I(h,p);7 h.1d(0,h.3n("/")+1)};4 s=K.3Z[K.3Z.y-1];1l{1k(s.3z)}1i(i){}4 1R=2e(s.5x);4 1F;1l{4 l=(5w()>=5)?"5v":"5u";1F=z 5t(l+".5s")}1i(i){}4 2w={};6 2y(h,p){1l{h=1I(h,p);x(!2w[h]){1F.5r("5q",h,1C);1F.5p();x(1F.3Y==0||1F.3Y==5o){2w[h]=1F.5n}}}1i(i){1G("2x [1]: 30 5m 5l "+h)}37{7 2w[h]||""}};4 5k=1I("5j.5i",1R);6 1E(V){x(V!=1L){V.2v=13.16.2v;V.12=13.16.12}7 V};1E.12=6(p,c){x(!p)p={};x(!c)c=p.J;x(c=={}.J)c=z 26("8.2v()");c.Y=z 26("7 8");c.Y.16=z 8.Y;c.Y.16.12(p);c.16=z c.Y;c.Y.16.J=c.16.J=c;c.1r=8;c.12=F.32;c.2u=8.2u;7 c};1E.Y=z 26("7 8");1E.Y.16={J:1E,2v:6(){7 F.32.5h.1r.2k(8,F)},12:6(V){x(8==8.J.16&&8.J.12){7 8.J.Y.16.12(V)}D(4 i 5g V){2K(i){1o"J":1o"O":1o"Y":2X}x(2V V[i]=="6"&&V[i]!=8[i]){V[i].1r=8[i]}8[i]=V[i]}x(V.O!=8.O&&V.O!={}.O){V.O.1r=8.O;8.O=V.O}7 8}};6 13(){};8.13=1E.12({J:13,O:6(){7"[5f "+(8.J.2Z||"5e")+"]"},5d:6(1h){7 8.J==1h||1h.2u(8.J)}});13.2Z="13";13.1r=1L;13.2u=6(1h){1f(1h&&1h.1r!=8)1h=1h.1r;7 3J(1h)};13.Y.1r=1E;2a 8.13;4 3A=13.12({J:6(){8.5c=[];8.1p=[]},1s:1W});x(2t<5.5)1k(2y("Z-5b.3a",1R));4 35=1C;1j.1s=6(){1l{x(35)7;35=1H=1c;2s=K.2s;3X=(2z)?2s:1J;x(1K&&1t)1t.2k();15.2k();1n();1G("1u 5a")}1i(e){1G("2x [2]: "+e.38)}};4 1p=[];6 2C(r){1p.11(r)};6 1n(){H.3P();x(1K&&1t)1t.1n();15.1n();D(4 i=0;i<1p.y;i++)1p[i]()};6 23(){4 E=0,R=1,L=2;4 G=/\\(/g,S=/\\$\\d/,I=/^\\$\\d+$/,T=/([\'"])\\1\\+(.*)\\+\\1\\1$/,3Q=/\\\\./g,Q=/\'/,3W=/\\25[^\\25]*\\25/g;4 1X=8;8.18=6(e,r){x(!r)r="";4 l=(34(2o(e)).1g(G)||"").y+1;x(S.B(r)){x(I.B(r)){r=3e(r.1d(1))-1}1b{4 i=l;4 q=Q.B(34(r))?\'"\':"\'";1f(i)r=r.2S("$"+i--).2p(q+"+a[o+"+i+"]+"+q);r=z 26("a,o","7"+q+r.19(T,"$1")+q)}}3V(e||"/^$/",r,l)};8.1U=6(s){24.y=0;7 3R(3S(s,8.2r).19(z 1Z(1D,8.33?"2I":"g"),3T),8.2r).19(3W,"")};8.59=6(){1D.y=0};4 24=[];4 1D=[];4 3U=6(){7"("+2o(8[E]).1d(1,-1)+")"};1D.O=6(){7 8.2p("|")};6 3V(){F.O=3U;1D[1D.y]=F}6 3T(){x(!F[0])7"";4 i=1,j=0,p;1f(p=1D[j++]){x(F[i]){4 r=p[R];2K(2V r){1o"6":7 r(F,i);1o"58":7 F[r+i]}4 d=(F[i].57(1X.2r)==-1)?"":"\\25"+F[i]+"\\25";7 d+r}1b i+=p[L]}};6 3S(s,e){7 e?s.19(z 1Z("\\\\"+e+"(.)","g"),6(m,c){24[24.y]=c;7 e}):s};6 3R(s,e){4 i=0;7 e?s.19(z 1Z("\\\\"+e,"g"),6(){7 e+(24[i++]||"")}):s};6 34(s){7 s.19(3Q,"")}};23.16={J:23,33:1C,2r:""};13.12(23.16);4 1V=23.12({33:1c});4 H=6(){4 2q="2.0.2";4 C=/\\s*,\\s*/;4 H=6(s,14){1l{4 m=[];4 u=F.32.2Q&&!14;4 b=(14)?(14.J==3G)?14:[14]:[K];4 31=3D(s).2S(C),i;D(i=0;i<31.y;i++){s=2R(31[i]);x(3K&&s.1d(0,3).2p("")==" *#"){s=s.1d(2);14=3H([],b,s[1])}1b 14=b;4 j=0,t,f,a,c="";1f(j<s.y){t=s[j++];f=s[j++];c+=t+f;a="";x(s[j]=="("){1f(s[j++]!=")"&&j<s.y){a+=s[j]}a=a.1d(0,-1);c+="("+a+")"}14=(u&&1P[c])?1P[c]:3F(14,t,f,a);x(u)1P[c]=14}m=m.3t(14)}2a H.30;7 m}1i(e){H.30=e;7[]}};H.O=6(){7"6 H() {\\n [2q "+2q+"]\\n}"};4 1P={};H.2Q=1C;H.3P=6(s){x(s){s=2R(s).2p("");2a 1P[s]}1b 1P={}};4 22={};4 1u=1C;H.2m=6(n,s){x(1u)1k("s="+2o(s));22[n]=z s()};H.Y=6(c){7 c?1k(c):8};4 1B={};4 2n={};4 56={1g:/\\[([\\w-]+(\\|[\\w-]+)?)\\s*(\\W?=)?\\s*([^\\]]*)\\]/};4 55=[];1B[" "]=6(r,f,t,n){4 e,i,j;D(i=0;i<f.y;i++){4 s=2l(f[i],t,n);D(j=0;(e=s[j]);j++){x(1q(e)&&2T(e,n))r.11(e)}}};1B["#"]=6(r,f,i){4 e,j;D(j=0;(e=f[j]);j++)x(e.1a==i)r.11(e)};1B["."]=6(r,f,c){c=z 1Z("(^|\\\\s)"+c+"(\\\\s|$)");4 e,i;D(i=0;(e=f[i]);i++)x(c.B(e.2Z))r.11(e)};1B[":"]=6(r,f,p,a){4 t=2n[p],e,i;x(t)D(i=0;(e=f[i]);i++)x(t(e,a))r.11(e)};2n["21"]=6(e){4 d=2U(e);x(d.2Y)D(4 i=0;i<d.2Y.y;i++){x(d.2Y[i]==e)7 1c}};2n["2N"]=6(e){};4 1q=6(e){7(e&&e.3B==1&&e.2P!="!")?e:1L};4 3N=6(e){1f(e&&(e=e.54)&&!1q(e))2X;7 e};4 2W=6(e){1f(e&&(e=e.53)&&!1q(e))2X;7 e};4 3L=6(e){7 1q(e.3O)||2W(e.3O)};4 52=6(e){7 1q(e.3M)||3N(e.3M)};4 51=6(e){4 c=[];e=3L(e);1f(e){c.11(e);e=2W(e)}7 c};4 3K=1c;4 2O=6(e){4 d=2U(e);7(2V d.3I=="50")?/\\.4Z$/i.B(d.4Y):3J(d.3I=="4X 4W")};4 2U=6(e){7 e.4V||e.K};4 2l=6(e,t){7(t=="*"&&e.1A)?e.1A:e.2l(t)};4 4U=6(e,t,n){x(t=="*")7 1q(e);x(!2T(e,n))7 1C;x(!2O(e))t=t.4T();7 e.2P==t};4 2T=6(e,n){7!n||(n=="*")||(e.4S==n)};4 4R=6(e){7 e.4Q};6 3H(r,f,1a){4 m,i,j;D(i=0;i<f.y;i++){x(m=f[i].1A.4P(1a)){x(m.1a==1a)r.11(m);1b x(m.y!=1L){D(j=0;j<m.y;j++){x(m[j].1a==1a)r.11(m[j])}}}}7 r};x(![].11)3G.16.11=6(){D(4 i=0;i<F.y;i++){8[8.y]=F[i]}7 8.y};4 N=/\\|/;6 3F(14,t,f,a){x(N.B(f)){f=f.2S(N);a=f[0];f=f[1]}4 r=[];x(1B[t]){1B[t](r,14,f,a)}7 r};4 S=/^[^\\s>+~]/;4 3E=/[\\s#.:>+~()@]|[^\\s#.:>+~()@]+/g;6 2R(s){x(S.B(s))s=" "+s;7 s.1g(3E)||[]};4 W=/\\s*([\\s>+~(),]|^|$)\\s*/g;4 I=/([\\s>+~,]|[^(]\\+|^)([#.:@])/g;4 3D=6(s){7 s.19(W,"$1").19(I,"$1*$2")};4 1y={O:6(){7"\'"},1g:/^(\'[^\']*\')|("[^"]*")$/,B:6(s){7 8.1g.B(s)},18:6(s){7 8.B(s)?s:8+s+8},3C:6(s){7 8.B(s)?s.1d(1,-1):s}};4 1N=6(t){7 1y.3C(t)};4 E=/([\\/()[\\]?{}|*+-])/g;6 4O(s){7 s.19(E,"\\\\$1")};1u=1c;7 H}();H.2Q=1c;H.2m("Z",6(){1q=6(e){7(e&&e.3B==1&&e.2P!="!"&&!e.3d)?e:1L}});H.Y("1N=F[1]",3k);4 1K=!H.Y("2O(F[1])",1J);4 2h=":21{Z-21:21}:2N{Z-21:2N}"+(1K?"":"*{4N:0}");4 15=z(3A.12({2F:z 1V,1O:"",1w:"",2L:[],1s:6(){8.2M();8.2g()},2g:6(){15.1Y.X=2h+8.1O+8.1w},3y:6(){4 20=K.2l("1e"),s;D(4 i=20.y-1;(s=20[i]);i--){x(!s.2H&&!s.Z){8.2L.11(s.3z)}}},2k:6(){8.3y();8.2g();z 28("1O");8.3u()},3w:6(e,r){8.2F.18(e,r)},1n:6(){4 R=/3v\\d+/g;4 s=2h.1g(/[{,]/g).y;4 20=s+(8.1O.X.1g(/\\{/g)||"").y;4 3x=8.1Y.4M,r;4 2j,c,2i,e,i,j,k,1a;D(i=s;i<20;i++){r=3x[i];x(r&&(2j=r.1e.X.1g(R))){2i=H(r.4L);x(2i.y)D(j=0;j<2j.y;j++){1a=2j[j];c=15.1p[1a.1d(10)][2];D(k=0;(e=2i[k]);k++){x(e.1v[1a])c(e)}}}}},2C:6(p,t,h,r){t=z 1Z("([{;\\\\s])"+p+"\\\\s*:\\\\s*"+t+"[^;}]*");4 i=8.1p.y;x(r)r=p+":"+r;8.3w(t,6(m,o){7(r?m[o+1]+r:m[o])+";Z-"+m[o].1d(1)+";3v"+i+":1"});8.1p.11(F);7 i},1N:6(s){7 s.X||""},2M:6(){x(1H||!1K)K.2M();1b K.4K("<1e Z=1c></1e>");8.1Y=17[17.y-1];8.1Y.Z=1c;8.1Y.X=2h},3u:6(){D(4 i=0;i<17.y;i++){x(!17[i].Z&&17[i].X){17[i].X=""}}}}));6 28(m){8.1z=m;8.1S();15[m]=8;15.2g()};13.12({J:28,O:6(){7"@1z "+8.1z+"{"+8.X+"}"},1n:1W,1S:6(){8.X="";8.1N();8.3m();8.X=3j(8.X);f={}},1N:6(){4 3r=[].3t(15.2L);4 M=/@1z\\s+([^{]*)\\{([^@]+\\})\\s*\\}/2I;4 A=/\\4J\\b|^$/i,S=/\\4I\\b/i,P=/\\4H\\b/i;6 3q(c,m){2f.v=m;7 c.19(M,2f)};6 2f(4G,m,c){m=2J(m);2K(m){1o"1O":1o"1w":x(m!=2f.v)7"";1o"1A":7 c}7""};6 2J(m){x(A.B(m))7"1A";1b x(S.B(m))7(P.B(m))?"1A":"1O";1b x(P.B(m))7"1w"};4 1X=8;6 2G(s,p,m,l){4 c="";x(!l){m=2J(s.1z);l=0}x(m=="1A"||m==1X.1z){x(l<3){D(4 i=0;i<s.3s.y;i++){c+=2G(s.3s[i],2e(s.2d,p),m,l+1)}}c+=3l(s.2d?3p(s,p):3r.3h()||"");c=3q(c,1X.1z)}7 c};4 f={};6 3p(s,p){4 u=1I(s.2d,p);x(f[u])7"";f[u]=(s.2H)?"":3o(15.1N(s,p),2e(s.2d,p));7 f[u]};4 U=/(4F\\s*\\(\\s*[\'"]?)([\\w\\.]+[^:\\)]*[\'"]?\\))/2I;6 3o(c,p){7 c.19(U,"$1"+p.1d(0,p.3n("/")+1)+"$2")};D(4 i=0;i<17.y;i++){x(!17[i].2H&&!17[i].Z){8.X+=2G(17[i])}}},3m:6(){8.X=15.2F.1U(8.X)},1n:1W});4 1y=H.Y("1y");4 2b=[];6 3l(c){7 1x.1U(2c.1U(c))};6 2E(m,o){7 1y+(2b.11(m[o])-1)+1y};6 3k(v){7 1y.B(v)?1k(2b[1k(v)]):v};4 1x=z 1V;1x.18(/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//);1x.18(/\'[^\']*\'/,2E);1x.18(/"[^"]*"/,2E);1x.18(/\\s+/," ");1x.18(/@(4E|4D)[^;\\n]+[;\\n]|<!\\-\\-|\\-\\->/);4 2c=z 1V;2c.18(/\\\\\'/,"\\\\4C");2c.18(/\\\\"/,"\\\\4B");4 2D=z 1V;2D.18(/\'(\\d+)\'/,3i);6 3j(c){7 2D.1U(c)};6 3i(m,o){7 2b[m[o+1]]};4 2B=[];6 4A(h){2C(h);1Q(1M,"4z",h)};6 1Q(e,t,h){e.4y(t,h);2B.11(F)};6 3g(e,t,h){1l{e.4x(t,h)}1i(i){}};1Q(1M,"4w",6(){4 h;1f(h=2B.3h()){3g(h[0],h[1],h[2])}});6 4v(h,e,c){x(!h.29)h.29={};x(c)h.29[e.2A]=e;1b 2a h.29[e.2A];7 c};1Q(1M,"4u",6(){x(!15.1w)z 28("1w");15.1w.1n()});4 3f=/^\\d+(4t)?$/i;4 4s=/^\\d+%$/;4 4r=6(e,v){x(3f.B(v))7 3e(v);4 s=e.1e.1m;4 r=e.1T.1m;e.1T.1m=e.1v.1m;e.1e.1m=v||0;v=e.1e.4q;e.1e.1m=s;e.1T.1m=r;7 v};6 4p(t){4 e=K.4o(t||"4n");e.1e.X="3c:4m;4l:0;4k:4j;4i:4h;4g:4f(0 0 0 0);1m:-4e";e.3d=1c;7 e};4 27="Z-";6 4d(e){7 e.1v["Z-3c"]=="4c"};6 4b(e,p){7 e.1v[27+p]||e.1v[p]};6 4a(e,p,v){x(e.1v[27+p]==1L){e.1T[27+p]=e.1v[p]}e.1T[p]=v};6 49(o,c,u){4 t=48(6(){1l{x(!o.1S)7;o.1S(o,c,u);3b(t)}1i(i){3b(t)}},10)};1u=1c;x(2z)1k(2y("Z-47.3a",1R));15.1s();x(1K&&1t)1t.1s();x(1H)1j.1s();1b{1J.46(1I("Z-1S.45",1R));1Q(K,"44",6(){x(K.39=="1H")43(1j.1s,0)})}}1i(e){1G("2x [0]: "+e.38)}37{}};',62,353,'||||var||function|return|this|||||||||||||||||||||||||if|length|new||test||for||arguments||cssQuery||constructor|document||||toString|||||||that||cssText|valueOf|ie7||push|specialize|Common|fr|ie7CSS|prototype|styleSheets|add|replace|id|else|true|slice|style|while|match|klass|catch|IE7|eval|try|left|recalc|case|recalcs|thisElement|ancestor|init|ie7HTML|loaded|currentStyle|print|encoder|Quote|media|all|selectors|false|_0|ICommon|httpRequest|alert|complete|makePath|documentElement|isHTML|null|window|getText|screen|cache|addEventHandler|path|load|runtimeStyle|exec|Parser|DUMMY|self|styleSheet|RegExp|st|link|modules|ParseMaster|_1|x01|Function|_2|StyleSheet|elements|delete|_3|safeString|href|getPath|_4|refresh|HEADER|el|ca|apply|getElementsByTagName|addModule|pseudoClasses|String|join|version|escapeChar|body|appVersion|ancestorOf|inherit|_5|Error|loadFile|quirksMode|uniqueID|_6|addRecalc|decoder|_7|parser|_8|disabled|gi|_9|switch|styles|createStyleSheet|visited|isXML|tagName|caching|_10|split|compareNamespace|getDocument|typeof|nextElementSibling|continue|links|className|error|se|callee|ignoreCase|_11|_12|ie7_debug|finally|description|readyState|js|clearInterval|position|ie7_anon|parseInt|PIXEL|removeEventHandler|pop|_13|decode|getString|_14|parse|lastIndexOf|_15|_16|_17|_18|imports|concat|trash|ie7_recalc|addFix|ru|getInlineStyles|innerHTML|Fix|nodeType|remove|parseSelector|ST|select|Array|_19|mimeType|Boolean|isMSIE|firstElementChild|lastChild|previousElementSibling|firstChild|clearCache|ES|_20|_21|_22|_23|_24|DE|viewport|status|scripts|search|location|top|setTimeout|onreadystatechange|htc|addBehavior|quirks|setInterval|addTimer|setOverrideStyle|getDefinedStyle|fixed|isFixed|9999|rect|clip|none|border|block|display|padding|absolute|object|createElement|createTempElement|pixelLeft|getPixelValue|PERCENT|px|onbeforeprint|register|onunload|detachEvent|attachEvent|onresize|addResize|x22|x27|import|namespace|url|ma|bprint|bscreen|ball|write|selectorText|rules|margin|regEscape|item|innerText|getTextContent|scopeName|toUpperCase|compareTagName|ownerDocument|Document|XML|URL|xml|unknown|childElements|lastElementChild|nextSibling|previousSibling|attributeSelectors|AttributeSelector|indexOf|number|reset|successfully|ie5|fixes|instanceOf|Object|common|in|caller|gif|blank|BLANK_GIF|file|loading|responseText|200|send|GET|open|XMLHTTP|ActiveXObject|Microsoft|Msxml2|ScriptEngineMajorVersion|src|ANON|ie7Layout|ms_|ie7_off|CSS1Compat|compatMode|MSIE|navigator|alpha'.split('|'),0,{}))
diff --git a/web/inc/IE7/ie7-css-strict.js b/web/inc/IE7/ie7-css-strict.js deleted file mode 100644 index 0c7e330..0000000 --- a/web/inc/IE7/ie7-css-strict.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-css-strict",function(){if(!modules["ie7-css2-selectors"])return;StyleSheet.prototype.specialize({parse:function(){this.inherit();var r=[].concat(this.rules);r.sort(ie7CSS.Rule.compare);this.cssText=r.join("\n")},createRule:function(s,c){var m;if(m=s.match(ie7CSS.PseudoElement.MATCH))return new ie7CSS.PseudoElement(m[1],m[2],c);else if(m=s.match(ie7CSS.DynamicRule.MATCH))return new ie7CSS.DynamicRule(s,m[1],m[2],m[3],c);else return new ie7CSS.Rule(s,c)}});ie7CSS.specialize({apply:function(){this.inherit();this.Rule.MATCH=/([^{}]+)(\{[^{}]*\})/g}});ie7CSS.Rule.compare=function(r1,r2){return r1.specificity-r2.specificity};var N=[],I=/#/g,C=/[.:\[]/g,T=/^\w|[\s>+~]\w/g;ie7CSS.Rule.score=function(s){return(s.match(I)||N).length*10000+(s.match(C)||N).length*100+(s.match(T)||N).length};ie7CSS.Rule.simple=function(){return""};ie7CSS.Rule.prototype.specialize({specificity:0,init:function(){this.specificity=ie7CSS.Rule.score(this.selector)}})});
diff --git a/web/inc/IE7/ie7-css2-selectors.js b/web/inc/IE7/ie7-css2-selectors.js deleted file mode 100644 index bb08da3..0000000 --- a/web/inc/IE7/ie7-css2-selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-css2-selectors",function(){cssQuery.addModule("css-level2",function(){selectors[">"]=function(r,f,t,n){var e,i,j;for(i=0;i<f.length;i++){var s=childElements(f[i]);for(j=0;(e=s[j]);j++)if(compareTagName(e,t,n))r.push(e)}};selectors["+"]=function(r,f,t,n){for(var i=0;i<f.length;i++){var e=nextElementSibling(f[i]);if(e&&compareTagName(e,t,n))r.push(e)}};selectors["@"]=function(r,f,a){var t=attributeSelectors[a].test;var e,i;for(i=0;(e=f[i]);i++)if(t(e))r.push(e)};pseudoClasses["first-child"]=function(e){return!previousElementSibling(e)};pseudoClasses["lang"]=function(e,c){c=new RegExp("^"+c,"i");while(e&&!e.getAttribute("lang"))e=e.parentNode;return e&&c.test(e.getAttribute("lang"))};AttributeSelector.NS_IE=/\\:/g;AttributeSelector.PREFIX="@";AttributeSelector.tests={};AttributeSelector.replace=function(m,a,n,c,v){var k=this.PREFIX+m;if(!attributeSelectors[k]){a=this.create(a,c||"",v||"");attributeSelectors[k]=a;attributeSelectors.push(a)}return attributeSelectors[k].id};AttributeSelector.parse=function(s){s=s.replace(this.NS_IE,"|");var m;while(m=s.match(this.match)){var r=this.replace(m[0],m[1],m[2],m[3],m[4]);s=s.replace(this.match,r)}return s};AttributeSelector.create=function(p,t,v){var a={};a.id=this.PREFIX+attributeSelectors.length;a.name=p;t=this.tests[t];t=t?t(this.getAttribute(p),getText(v)):false;a.test=new Function("e","return "+t);return a};AttributeSelector.getAttribute=function(n){switch(n.toLowerCase()){case"id":return"e.id";case"class":return"e.className";case"for":return"e.htmlFor";case"href":if(isMSIE){return"String((e.outerHTML.match(/href=\\x22?([^\\s\\x22]*)\\x22?/)||[])[1]||'')"}}return"e.getAttribute('"+n.replace(N,":")+"')"};AttributeSelector.tests[""]=function(a){return a};AttributeSelector.tests["="]=function(a,v){return a+"=="+Quote.add(v)};AttributeSelector.tests["~="]=function(a,v){return"/(^| )"+regEscape(v)+"( |$)/.test("+a+")"};AttributeSelector.tests["|="]=function(a,v){return"/^"+regEscape(v)+"(-|$)/.test("+a+")"};var _6=parseSelector;parseSelector=function(s){return _6(AttributeSelector.parse(s))}});var AttributeSelector=cssQuery.valueOf("AttributeSelector");var H=/a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;var B1=/\s*\{\s*/,B2=/\s*\}\s*/,C=/\s*\,\s*/;var F=/(.*)(:first-(line|letter))/;StyleSheet.prototype.specialize({parse:function(){this.inherit();var o=ie7CSS.rules.length;var ru=this.cssText.split(B2),r;var se,c,i,j;for(i=0;i<ru.length;i++){r=ru[i].split(B1);se=r[0].split(C);c=r[1];for(j=0;j<se.length;j++){se[j]=c?this.createRule(se[j],c):""}ru[i]=se.join("\n")}this.cssText=ru.join("\n");this.rules=ie7CSS.rules.slice(o)},recalc:function(){var r,i;for(i=0;(r=this.rules[i]);i++)r.recalc()},createRule:function(s,c){if(ie7CSS.UNKNOWN.test(s)){var m;if(m=s.match(PseudoElement.MATCH)){return new PseudoElement(m[1],m[2],c)}else if(m=s.match(DynamicRule.MATCH)){if(!isHTML||!H.test(m)||DynamicRule.COMPLEX.test(m)){return new DynamicRule(s,m[1],m[2],m[3],c)}}else return new Rule(s,c)}return s+" {"+c+"}"}});ie7CSS.specialize({rules:[],pseudoClasses:cssQuery.valueOf("pseudoClasses"),dynamicPseudoClasses:{},cache:cssQuery.valueOf("cache"),Rule:Rule,DynamicRule:DynamicRule,PseudoElement:PseudoElement,DynamicPseudoClass:DynamicPseudoClass,apply:function(){var p=this.pseudoClasses+"|before|after|"+this.dynamicPseudoClasses;p=p.replace(/(link|visited)\|/g,"");this.UNKNOWN=new RegExp("[>+~\[]|([:.])[\\w-()]+\\1|:("+p+")");var c="[^\\s(]+\\s*[+~]|@\\d+|:(";Rule.COMPLEX=new RegExp(c+p+")","g");DynamicRule.COMPLEX=new RegExp(c+this.pseudoClasses+")","g");DynamicRule.MATCH=new RegExp("(.*):("+this.dynamicPseudoClasses+")(.*)");PseudoElement.MATCH=/(.*):(before|after).*/;this.inherit()},recalc:function(){this.screen.recalc();this.inherit()},getText:function(s,p){return httpRequest?(loadFile(s.href,p)||s.cssText):this.inherit(s)},addEventHandler:function(e,t,h){addEventHandler(e,t,h)}});function Rule(s,c){this.id=ie7CSS.rules.length;this.className=Rule.PREFIX+this.id;s=(s).match(F)||s||"*";this.selector=s[1]||s;this.selectorText=Rule.simple(this.selector)+"."+this.className+(s[2]||"");this.cssText=c;this.MATCH=new RegExp("\\s"+this.className+"(\\s|$)","g");ie7CSS.rules.push(this);this.init()};Common.specialize({constructor:Rule,toString:function(){return this.selectorText+" {"+this.cssText+"}"},init:DUMMY,add:function(e){e.className+=" "+this.className},remove:function(e){e.className=e.className.replace(this.MATCH,"$1")},recalc:function(){var m=ie7CSS.cache[" *."+this.className]=cssQuery(this.selector);for(i=0;i<m.length;i++)this.add(m[i])}});Rule.PREFIX="ie7_class";Rule.CHILD=/>/g;Rule.simple=function(s){s=AttributeSelector.parse(s);return s.replace(this.COMPLEX,"").replace(this.CHILD," ")};function DynamicRule(s,a,d,t,c){this.attach=a||"*";this.dynamicPseudoClass=ie7CSS.dynamicPseudoClasses[d];this.target=t;this.inherit(s,c)};Rule.specialize({constructor:DynamicRule,recalc:function(){var m=cssQuery(this.attach);for(var i=0;i<m.length;i++){var t=(this.target)?cssQuery(this.target,m[i]):[m[i]];if(t.length)this.dynamicPseudoClass.apply(m[i],t,this)}}});var A=/^attr/;var U=/^url\s*\(\s*([^)]*)\)$/;var M={before0:"beforeBegin",before1:"afterBegin",after0:"afterEnd",after1:"beforeEnd"};var _5=makePath("ie7-content.htc",path)+"?";HEADER+=".ie7_anon{display:none}";function PseudoElement(s,p,c){this.position=p;var co=c.match(PseudoElement.CONTENT),m,e;if(co){co=co[1];m=co.split(/\s+/);for(var i=0;(e=m[i]);i++){m[i]=A.test(e)?{attr:e.slice(5,-1)}:(e.charAt(0)=="'")?getString(e):decode(e)}co=m}this.content=co;this.inherit(s,decode(c))};Rule.specialize({constructor:PseudoElement,toString:function(){return"."+this.className+"{display:inline}"},init:function(){this.match=cssQuery(this.selector);for(var i=0;i<this.match.length;i++){var r=this.match[i].runtimeStyle;if(!r[this.position])r[this.position]={cssText:""};r[this.position].cssText+=";"+this.cssText;if(this.content!=null)r[this.position].content=this.content}},recalc:function(){if(this.content==null)return;for(var i=0;i<this.match.length;i++){this.create(this.match[i])}},create:function(t){var g=t.runtimeStyle[this.position];if(g){var c=[].concat(g.content||"");for(var j=0;j<c.length;j++){if(typeof c[j]=="object"){c[j]=t.getAttribute(c[j].attr)}}c=c.join("");var u=c.match(U);var h=PseudoElement[u?"OBJECT":"ANON"].replace(/%1/,this.className);var cs=g.cssText.replace(/'/g,'"');var po=M[this.position+Number(t.canHaveChildren)];if(u){var p=document.createElement(h);t.insertAdjacentElement(po,p);p.data=_5;addTimer(p,cs,Quote.remove(u[1]))}else{h=h.replace(/%2/,cs).replace(/%3/,c);t.insertAdjacentHTML(po,h)}t.runtimeStyle[this.position]=null}}});PseudoElement.CONTENT=/content\s*:\s*([^;]*)(;|$)/;PseudoElement.OBJECT="<object class='ie7_anon %1' ie7_anon width=100% height=0 type=text/x-scriptlet>";PseudoElement.ANON="<ie7:! class='ie7_anon %1' ie7_anon style='%2'>%3</ie7:!>";function DynamicPseudoClass(n,a){this.name=n;this.apply=a;this.instances={};ie7CSS.dynamicPseudoClasses[n]=this};Common.specialize({constructor:DynamicPseudoClass,register:function(i){var c=i[2];i.id=c.id+i[0].uniqueID;if(!this.instances[i.id]){var t=i[1],j;for(j=0;j<t.length;j++)c.add(t[j]);this.instances[i.id]=i}},unregister:function(i){if(this.instances[i.id]){var c=i[2];var t=i[1],j;for(j=0;j<t.length;j++)c.remove(t[j]);delete this.instances[i.id]}}});ie7CSS.pseudoClasses.toString=function(){var t=[],p;for(p in this){if(this[p].length>1)p+="\\([^)]*\\)";t.push(p)}return t.join("|")};ie7CSS.pseudoClasses["link"]=function(e){return e.currentStyle["ie7-link"]=="link"};ie7CSS.pseudoClasses["visited"]=function(e){return e.currentStyle["ie7-link"]=="visited"};var _4=(appVersion<5.5)?"onmouseover":"onmouseenter";var _3=(appVersion<5.5)?"onmouseout":"onmouseleave";ie7CSS.dynamicPseudoClasses.toString=ie7CSS.pseudoClasses.toString;var _0=new DynamicPseudoClass("hover",function(e){var i=arguments;ie7CSS.addEventHandler(e,_4,function(){_0.register(i)});ie7CSS.addEventHandler(e,_3,function(){_0.unregister(i)})});var _1=new DynamicPseudoClass("focus",function(e){var i=arguments;ie7CSS.addEventHandler(e,"onfocus",function(){_1.unregister(i);_1.register(i)});ie7CSS.addEventHandler(e,"onblur",function(){_1.unregister(i)});if(e==document.activeElement){_1.register(i)}});var _2=new DynamicPseudoClass("active",function(e){var i=arguments;ie7CSS.addEventHandler(e,"onmousedown",function(){_2.register(i)})});addEventHandler(document,"onmouseup",function(){var i=_2.instances,j;for(j in i)_2.unregister(i[j]);i=_0.instances;for(j in i)if(!i[j][0].contains(event.srcElement))_0.unregister(i[j])});ICommon(AttributeSelector);AttributeSelector.specialize({getAttribute:function(n){switch(n.toLowerCase()){case"class":return"e.className.replace(/\\b\\s*ie7_class\\d+/g,'')";case"src":return"(e.pngSrc||e.src)"}return this.inherit(n)}});encoder.add(/::/,":");safeString.add(/\\([\da-fA-F]{1,4})/,function(m,o){m=m[o+1];return"\\u"+"0000".slice(m.length)+m})});
diff --git a/web/inc/IE7/ie7-css3-selectors.js b/web/inc/IE7/ie7-css3-selectors.js deleted file mode 100644 index 7337b82..0000000 --- a/web/inc/IE7/ie7-css3-selectors.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-css3-selectors",function(){cssQuery.addModule("css-level3",function(){selectors["~"]=function(r,f,t,n){var e,i;for(i=0;(e=f[i]);i++){while(e=nextElementSibling(e)){if(compareTagName(e,t,n))r.push(e)}}};pseudoClasses["contains"]=function(e,t){t=new RegExp(regEscape(getText(t)));return t.test(getTextContent(e))};pseudoClasses["root"]=function(e){return e==getDocument(e).documentElement};pseudoClasses["empty"]=function(e){var n,i;for(i=0;(n=e.childNodes[i]);i++){if(thisElement(n)||n.nodeType==3)return false}return true};pseudoClasses["last-child"]=function(e){return!nextElementSibling(e)};pseudoClasses["only-child"]=function(e){e=e.parentNode;return firstElementChild(e)==lastElementChild(e)};pseudoClasses["not"]=function(e,s){var n=cssQuery(s,getDocument(e));for(var i=0;i<n.length;i++){if(n[i]==e)return false}return true};pseudoClasses["nth-child"]=function(e,a){return nthChild(e,a,previousElementSibling)};pseudoClasses["nth-last-child"]=function(e,a){return nthChild(e,a,nextElementSibling)};pseudoClasses["target"]=function(e){return e.id==location.hash.slice(1)};pseudoClasses["checked"]=function(e){return e.checked};pseudoClasses["enabled"]=function(e){return e.disabled===false};pseudoClasses["disabled"]=function(e){return e.disabled};pseudoClasses["indeterminate"]=function(e){return e.indeterminate};AttributeSelector.tests["^="]=function(a,v){return"/^"+regEscape(v)+"/.test("+a+")"};AttributeSelector.tests["$="]=function(a,v){return"/"+regEscape(v)+"$/.test("+a+")"};AttributeSelector.tests["*="]=function(a,v){return"/"+regEscape(v)+"/.test("+a+")"};function nthChild(e,a,t){switch(a){case"n":return true;case"even":a="2n";break;case"odd":a="2n+1"}var ch=childElements(e.parentNode);function _5(i){var i=(t==nextElementSibling)?ch.length-i:i-1;return ch[i]==e};if(!isNaN(a))return _5(a);a=a.split("n");var m=parseInt(a[0]);var s=parseInt(a[1]);if((isNaN(m)||m==1)&&s==0)return true;if(m==0&&!isNaN(s))return _5(s);if(isNaN(s))s=0;var c=1;while(e=t(e))c++;if(isNaN(m)||m==1)return(t==nextElementSibling)?(c<=s):(s>=c);return(c%m)==s}});var firstElementChild=cssQuery.valueOf("firstElementChild");ie7CSS.pseudoClasses["root"]=function(e){return(e==viewport)||(!isHTML&&e==firstElementChild(body))};var _4=new ie7CSS.DynamicPseudoClass("checked",function(e){if(typeof e.checked!="boolean")return;var i=arguments;ie7CSS.addEventHandler(e,"onpropertychange",function(){if(event.propertyName=="checked"){if(e.checked)_4.register(i);else _4.unregister(i)}});if(e.checked)_4.register(i)});var _3=new ie7CSS.DynamicPseudoClass("enabled",function(e){if(typeof e.disabled!="boolean")return;var i=arguments;ie7CSS.addEventHandler(e,"onpropertychange",function(){if(event.propertyName=="disabled"){if(!e.isDisabled)_3.register(i);else _3.unregister(i)}});if(!e.isDisabled)_3.register(i)});var _2=new ie7CSS.DynamicPseudoClass("disabled",function(e){if(typeof e.disabled!="boolean")return;var i=arguments;ie7CSS.addEventHandler(e,"onpropertychange",function(){if(event.propertyName=="disabled"){if(e.isDisabled)_2.register(i);else _2.unregister(i)}});if(e.isDisabled)_2.register(i)});var _1=new ie7CSS.DynamicPseudoClass("indeterminate",function(e){if(typeof e.indeterminate!="boolean")return;var i=arguments;ie7CSS.addEventHandler(e,"onpropertychange",function(){if(event.propertyName=="indeterminate"){if(e.indeterminate)_1.register(i);else _1.unregister(i)}});ie7CSS.addEventHandler(e,"onclick",function(){_1.unregister(i)})});var _0=new ie7CSS.DynamicPseudoClass("target",function(e){var i=arguments;if(!e.tabIndex)e.tabIndex=0;ie7CSS.addEventHandler(document,"onpropertychange",function(){if(event.propertyName=="activeElement"){if(e.id==location.hash.slice(1))_0.register(i);else _0.unregister(i)}});if(e.id==location.hash.slice(1))_0.register(i)});decoder.add(/\|/,"\\:")});
diff --git a/web/inc/IE7/ie7-dhtml.js b/web/inc/IE7/ie7-dhtml.js deleted file mode 100644 index d768063..0000000 --- a/web/inc/IE7/ie7-dhtml.js +++ /dev/null @@ -1,57 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-dhtml", function() {
-
-/* ---------------------------------------------------------------------
- This module is still in development and should not be used.
---------------------------------------------------------------------- */
-
-ie7CSS.specialize("recalc", function() {
- this.inherit();
- for (var i = 0; i < this.recalcs.length; i++) {
- var $recalc = this.recalcs[i];
- for (var j = 0; i < $recalc[3].length; i++) {
- _addPropertyChangeHandler($recalc[3][j], _getPropertyName($recalc[2]), $recalc[1]);
- }
- }
-});
-
-// constants
-var _PATTERNS = {
- width: "(width|paddingLeft|paddingRight|borderLeftWidth|borderRightWidth|borderLeftStyle|borderRightStyle)",
- height: "(height|paddingTop|paddingBottom|borderTopHeight|borderBottomHeight|borderTopStyle|borderBottomStyle)"
-};
-var _PROPERTY_NAMES = {
- width: "fixedWidth",
- height: "fixedHeight",
- right: "width",
- bottom: "height"
-};
-var _DASH_LETTER = /-(\w)/g;
-var _PROPERTY_NAME = /\w+/;
-
-function _addPropertyChangeHandler($element, $propertyName, $fix) {
- addEventHandler($element, "onpropertychange", function() {
- if (_getPattern($propertyName).test(event.propertyName)) {
- _reset($element, $propertyName);
- $fix($element);
- }
- });
-};
-function _upper($match, $letter) {return $letter.toUpperCase()};
-function _getPropertyName($pattern) {
- return String(String($pattern).toLowerCase().replace(_DASH_LETTER, _upper).match(_PROPERTY_NAME));
-};
-function _getPattern($propertyName) {
- return eval("/^style." + (_PATTERNS[$propertyName] || $propertyName) + "$/");
-};
-function _reset($element, $propertyName) {
- $element.runtimeStyle[$propertyName] = "";
- $propertyName = _PROPERTY_NAMES[$propertyName]
- if ($propertyName) $element.runtimeStyle[$propertyName] = "";
-};
-
-});
diff --git a/web/inc/IE7/ie7-dynamic-attributes.js b/web/inc/IE7/ie7-dynamic-attributes.js deleted file mode 100644 index e066911..0000000 --- a/web/inc/IE7/ie7-dynamic-attributes.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-dynamic-attributes",function(){if(!modules["ie7-css2-selectors"])return;var attributeSelectors=cssQuery.valueOf("attributeSelectors");var parseSelector=cssQuery.valueOf("parseSelector");function DynamicAttribute(s,a,d,t,c){this.attach=a||"*";parseSelector(d);this.dynamicAttribute=attributeSelectors["@"+d];this.target=t;this.inherit(s,c)};ie7CSS.Rule.specialize({constructor:DynamicAttribute,recalc:function(){var m=cssQuery(this.attach);for(var i=0;i<m.length;i++){var t=(this.target)?cssQuery(this.target,m[i]):[m[i]];if(t.length)this.apply(m[i],t)}},apply:function(e,t){var self=this;addEventHandler(e,"onpropertychange",function(){if(event.propertyName==self.dynamicAttribute.name)self.test(e,t)});this.test(e,t)},test:function(e,t){var a=this.dynamicAttribute.test(e)?"add":"remove";for(var i=0;(e=t[i]);i++)this[a](e)}});DynamicAttribute.MATCH=/(.*)(\[[^\]]*\])(.*)/;StyleSheet.prototype.specialize({createRule:function(s,c){var m;if(m=s.match(DynamicAttribute.MATCH)){return new DynamicAttribute(s,m[1],m[2],m[3],c)}else return this.inherit(s,c)}})});
diff --git a/web/inc/IE7/ie7-fixed.js b/web/inc/IE7/ie7-fixed.js deleted file mode 100644 index 10d629f..0000000 --- a/web/inc/IE7/ie7-fixed.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-fixed",function(){ie7CSS.addRecalc("position","fixed",_6,"absolute");ie7CSS.addRecalc("background(-attachment)?","[^};]*fixed",_7);var _10=(quirksMode)?"body":"documentElement";var _8=function(){if(body.currentStyle.backgroundAttachment!="fixed"){if(body.currentStyle.backgroundImage=="none"){body.runtimeStyle.backgroundRepeat="no-repeat";body.runtimeStyle.backgroundImage="url("+BLANK_GIF+")"}body.runtimeStyle.backgroundAttachment="fixed"}_8=DUMMY};var _0=createTempElement("img");function _1(f){return _2.exec(String(f))};var _2=new ParseMaster;_2.add(/Left/,"Top");_2.add(/left/,"top");_2.add(/Width/,"Height");_2.add(/width/,"height");_2.add(/right/,"bottom");_2.add(/X/,"Y");function _3(e){return(e)?isFixed(e)||_3(e.parentElement):false};function setExpression(e,p,ex){setTimeout("document.all."+e.uniqueID+".runtimeStyle.setExpression('"+p+"','"+ex+"')",0)};function _7(e){if(register(_7,e,e.currentStyle.backgroundAttachment=="fixed"&&!e.contains(body))){_8();backgroundLeft(e);backgroundTop(e);_9(e)}};function _9(e){_0.src=e.currentStyle.backgroundImage.slice(5,-2);var p=(e.canHaveChildren)?e:e.parentElement;p.appendChild(_0);setOffsetLeft(e);setOffsetTop(e);p.removeChild(_0)};function backgroundLeft(e){e.style.backgroundPositionX=e.currentStyle.backgroundPositionX;if(!_3(e)){var ex="(parseInt(runtimeStyle.offsetLeft)+document."+_10+".scrollLeft)||0";setExpression(e,"backgroundPositionX",ex)}};eval(_1(backgroundLeft));function setOffsetLeft(e){var p=_3(e)?"backgroundPositionX":"offsetLeft";e.runtimeStyle[p]=getOffsetLeft(e,e.style.backgroundPositionX)-e.getBoundingClientRect().left-e.clientLeft+2};eval(_1(setOffsetLeft));function getOffsetLeft(e,p){switch(p){case"left":case"top":return 0;case"right":case"bottom":return viewport.clientWidth-_0.offsetWidth;case"center":return(viewport.clientWidth-_0.offsetWidth)/2;default:if(PERCENT.test(p)){return parseInt((viewport.clientWidth-_0.offsetWidth)*parseFloat(p)/100)}_0.style.left=p;return _0.offsetLeft}};eval(_1(getOffsetLeft));function _6(e){if(register(_6,e,isFixed(e))){setOverrideStyle(e,"position","absolute");setOverrideStyle(e,"left",e.currentStyle.left);setOverrideStyle(e,"top",e.currentStyle.top);_8();if(ie7Layout)ie7Layout.fixRight(e);_5(e)}};function _5(e,r){positionTop(e,r);positionLeft(e,r,true);if(!e.runtimeStyle.autoLeft&&e.currentStyle.marginLeft=="auto"&&e.currentStyle.right!="auto"){var l=viewport.clientWidth-getPixelWidth(e,e.currentStyle.right)-getPixelWidth(e,e.runtimeStyle._12)-e.clientWidth;if(e.currentStyle.marginRight=="auto")l=parseInt(l/2);if(_3(e.offsetParent))e.runtimeStyle.pixelLeft+=l;else e.runtimeStyle.shiftLeft=l}clipWidth(e);clipHeight(e)};function clipWidth(e){if(e.currentStyle.width!="auto"){var r=e.getBoundingClientRect();var w=e.offsetWidth-viewport.clientWidth+r.left-2;if(w>=0){w=Math.max(getPixelValue(e,e.currentStyle.width)-w,0);setOverrideStyle(e,"width",w)}}};eval(_1(clipWidth));function positionLeft(e,r){if(!r&&PERCENT.test(e.currentStyle.width)){e.runtimeStyle.fixWidth=e.currentStyle.width}if(e.runtimeStyle.fixWidth){e.runtimeStyle.width=getPixelWidth(e,e.runtimeStyle.fixWidth)}if(r){if(!e.runtimeStyle.autoLeft)return}else{e.runtimeStyle.shiftLeft=0;e.runtimeStyle._12=e.currentStyle.left;e.runtimeStyle.autoLeft=e.currentStyle.right!="auto"&&e.currentStyle.left=="auto"}e.runtimeStyle.left="";e.runtimeStyle.screenLeft=getScreenLeft(e);e.runtimeStyle.pixelLeft=e.runtimeStyle.screenLeft;if(!r&&!_3(e.offsetParent)){var ex="runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document."+_10+".scrollLeft";setExpression(e,"pixelLeft",ex)}};eval(_1(positionLeft));function getScreenLeft(e){var s=e.offsetLeft,n=1;if(e.runtimeStyle.autoLeft){s=viewport.clientWidth-e.offsetWidth-getPixelWidth(e,e.currentStyle.right)}if(e.currentStyle.marginLeft!="auto"){s-=getPixelWidth(e,e.currentStyle.marginLeft)}while(e=e.offsetParent){if(e.currentStyle.position!="static")n=-1;s+=e.offsetLeft*n}return s};eval(_1(getScreenLeft));function getPixelWidth(e,v){if(PERCENT.test(v))return parseInt(parseFloat(v)/100*viewport.clientWidth);return getPixelValue(e,v)};eval(_1(getPixelWidth));function _11(){var e=_7.elements;for(var i in e)_9(e[i]);e=_6.elements;for(i in e){_5(e[i],true);_5(e[i],true)}_4=0};var _4;addResize(function(){if(!_4)_4=setTimeout(_11,0)})});
\ No newline at end of file diff --git a/web/inc/IE7/ie7-graphics.js b/web/inc/IE7/ie7-graphics.js deleted file mode 100644 index 7e63c47..0000000 --- a/web/inc/IE7/ie7-graphics.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-graphics",function(){if(appVersion<5.5)return;var A="DXImageTransform.Microsoft.AlphaImageLoader";var F="progid:"+A+"(src='%1',sizingMethod='scale')";var _3=new RegExp((window.IE7_PNG_SUFFIX||"-trans.png")+"$","i");var _0=[];function _2(e){var f=e.filters[A];if(f){f.src=e.src;f.enabled=true}else{e.runtimeStyle.filter=F.replace(/%1/,e.src);_0.push(e)}e.src=BLANK_GIF};function _5(e){e.src=e.pngSrc;e.filters[A].enabled=false};ie7CSS.addFix(/opacity\s*:\s*([\d.]+)/,function(m,o){return"zoom:1;filter:progid:DXImageTransform.Microsoft.Alpha(opacity="+((parseFloat(m[o+1])*100)||1)+")"});var B=/background(-image)?\s*:\s*([^\(};]*)url\(([^\)]+)\)([^;}]*)/;ie7CSS.addFix(B,function(m,o){var u=getString(m[o+3]);return _3.test(u)?"filter:"+F.replace(/scale/,"crop").replace(/%1/,u)+";zoom:1;background"+(m[o+1]||"")+":"+(m[o+2]||"")+"none"+(m[o+4]||""):m[o]});if(ie7HTML){ie7HTML.addRecalc("img,input",function(e){if(e.tagName=="INPUT"&&e.type!="image")return;_4(e);addEventHandler(e,"onpropertychange",function(){if(!_1&&event.propertyName=="src"&&e.src.indexOf(BLANK_GIF)==-1)_4(e)})});var B64=/^data:.*;base64/i;var _7=makePath("ie7-base64.php",path);function _4(e){if(_3.test(e.src)){var i=new Image(e.width,e.height);i.onload=function(){e.width=i.width;e.height=i.height;i=null};i.src=e.src;e.pngSrc=e.src;_2(e)}else if(B64.test(e.src)){e.src=_7+"?"+e.src.slice(5)}};var I=/^image/i;var _6=makePath("ie7-object.htc",path);ie7HTML.addRecalc("object",function(e){if(I.test(e.type)){var o=document.createElement("<object type=text/x-scriptlet>");o.style.width=e.currentStyle.width;o.style.height=e.currentStyle.height;o.data=_6;var u=makePath(e.data,getPath(location.href));e.parentNode.replaceChild(o,e);cssQuery.clearCache("object");addTimer(o,"",u);return o}})}var _1=false;addEventHandler(window,"onbeforeprint",function(){_1=true;for(var i=0;i<_0.length;i++)_5(_0[i])});addEventHandler(window,"onafterprint",function(){for(var i=0;i<_0.length;i++)_2(_0[i]);_1=false})});
diff --git a/web/inc/IE7/ie7-html4.js b/web/inc/IE7/ie7-html4.js deleted file mode 100644 index 3fcd891..0000000 --- a/web/inc/IE7/ie7-html4.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-html4",function(){if(!isHTML)return;HEADER+="h1{font-size:2em}h2{font-size:1.5em;}h3{font-size:1.17em;}"+"h4{font-size:1em}h5{font-size:.83em}h6{font-size:.67em}";var _0={};ie7HTML=new(Fix.specialize({init:DUMMY,addFix:function(){this.fixes.push(arguments)},apply:function(){for(var i=0;i<this.fixes.length;i++){var m=cssQuery(this.fixes[i][0]);var f=this.fixes[i][1]||_1;for(var j=0;j<m.length;j++)f(m[j])}},addRecalc:function(){this.recalcs.push(arguments)},recalc:function(){for(var i=0;i<this.recalcs.length;i++){var m=cssQuery(this.recalcs[i][0]);var r=this.recalcs[i][1],e;var k=Math.pow(2,i);for(var j=0;(e=m[j]);j++){var u=e.uniqueID;if((_0[u]&k)==0){e=r(e)||e;_0[u]|=k}}}}}));ie7HTML.addFix("abbr");ie7HTML.addRecalc("label",function(e){if(!e.htmlFor){var f=cssQuery("input,textarea",e)[0];if(f){addEventHandler(e,"onclick",function(){f.click()})}}});ie7HTML.addRecalc("button,input",function(e){if(e.tagName=="BUTTON"){var m=e.outerHTML.match(/ value="([^"]*)"/i);e.runtimeStyle.value=(m)?m[1]:""}if(e.type=="submit"){addEventHandler(e,"onclick",function(){e.runtimeStyle.clicked=true;setTimeout("document.all."+e.uniqueID+".runtimeStyle.clicked=false",1)})}});var U=/^(submit|reset|button)$/;ie7HTML.addRecalc("form",function(e){addEventHandler(e,"onsubmit",function(){for(var i=0;i<e.length;i++){if(_2(e[i])){e[i].disabled=true;setTimeout("document.all."+e[i].uniqueID+".disabled=false",1)}else if(e[i].tagName=="BUTTON"&&e[i].type=="submit"){setTimeout("document.all."+e[i].uniqueID+".value='"+e[i].value+"'",1);e[i].value=e[i].runtimeStyle.value}}})});function _2(e){return U.test(e.type)&&!e.disabled&&!e.runtimeStyle.clicked};ie7HTML.addRecalc("img",function(e){if(e.alt&&!e.title)e.title=""});var P=(appVersion<5.5)?"HTML:":"";function _1(e){var f=document.createElement("<"+P+e.outerHTML.slice(1));if(e.outerHTML.slice(-2)!="/>"){var en="</"+e.tagName+">",n;while((n=e.nextSibling)&&n.outerHTML!=en){f.appendChild(n)}if(n)n.removeNode()}e.parentNode.replaceChild(f,e)}});
diff --git a/web/inc/IE7/ie7-ie5.js b/web/inc/IE7/ie7-ie5.js deleted file mode 100644 index a07fd98..0000000 --- a/web/inc/IE7/ie7-ie5.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-if(appVersion<5.5){ANON="HTML:!";var ap=function(f,o,a){f.apply(o,a)};if(''.replace(/^/,String)){var _0=String.prototype.replace;var _1=function(e,r){var m,n="",s=this;while(s&&(m=e.exec(s))){n+=s.slice(0,m.index)+ap(r,this,m);s=s.slice(m.lastIndex)}return n+s};String.prototype.replace=function(e,r){this.replace=(typeof r=="function")?_1:_0;return this.replace(e,r)}}if(!Function.apply){var APPLY="apply-"+Number(new Date);ap=function(f,o,a){var r;o[APPLY]=f;switch(a.length){case 0:r=o[APPLY]();break;case 1:r=o[APPLY](a[0]);break;case 2:r=o[APPLY](a[0],a[1]);break;case 3:r=o[APPLY](a[0],a[1],a[2]);break;case 4:r=o[APPLY](a[0],a[1],a[2],a[3]);break;default:var aa=[],i=a.length-1;do aa[i]="a["+i+"]";while(i--);eval("r=o[APPLY]("+aa+")")}delete o[APPLY];return r};ICommon.valueOf.prototype.inherit=function(){return ap(arguments.callee.caller.ancestor,this,arguments)}}if(![].push)Array.prototype.push=function(){for(var i=0;i<arguments.length;i++){this[this.length]=arguments[i]}return this.length};if(![].pop)Array.prototype.pop=function(){var i=this[this.length-1];this.length--;return i};if(isHTML){HEADER+="address,blockquote,body,dd,div,dt,fieldset,form,"+"frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,p,"+"hr,applet,center,dir,menu,pre,dl,li,ol,ul{display:block}"}}
diff --git a/web/inc/IE7/ie7-layout.js b/web/inc/IE7/ie7-layout.js deleted file mode 100644 index d1b64eb..0000000 --- a/web/inc/IE7/ie7-layout.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-layout",function(){ie7Layout=this;HEADER+="*{boxSizing:content-box}";this.hasLayout=(appVersion<5.5)?function(e){return e.clientWidth}:function(e){return e.currentStyle.hasLayout};this.boxSizing=function(e){if(!ie7Layout.hasLayout(e)){e.style.height="0cm";if(e.currentStyle.verticalAlign=="auto")e.runtimeStyle.verticalAlign="top";_1(e)}};function _1(e){if(e!=viewport&&e.currentStyle.position!="absolute"){collapseMarginTop(e);collapseMarginBottom(e)}};var firstElementChild=cssQuery.valueOf("firstElementChild");var lastElementChild=cssQuery.valueOf("lastElementChild");function collapseMarginTop(e){if(!e.runtimeStyle.marginTop){var p=e.parentElement;if(p&&ie7Layout.hasLayout(p)&&e==firstElementChild(p))return;var f=firstElementChild(e);if(f&&f.currentStyle.styleFloat=="none"&&ie7Layout.hasLayout(f)){collapseMarginTop(f);m=_3(e,e.currentStyle.marginTop);c=_3(f,f.currentStyle.marginTop);if(m<0||c<0){e.runtimeStyle.marginTop=m+c}else{e.runtimeStyle.marginTop=Math.max(c,m)}f.runtimeStyle.marginTop="0px"}}};eval(String(collapseMarginTop).replace(/Top/g,"Bottom").replace(/first/g,"last"));function _3(e,v){return(v=="auto")?0:getPixelValue(e,v)};var U=/^[.\d][\w%]*$/,A=/^(auto|0cm)$/,N="[.\\d]";var applyWidth,applyHeight;function borderBox(e){applyWidth(e);applyHeight(e)};function fixWidth(H){applyWidth=function(e){if(!PERCENT.test(e.currentStyle.width))fixWidth(e);_1(e)};function fixWidth(e,v){if(!e.runtimeStyle.fixedWidth){if(!v)v=e.currentStyle.width;e.runtimeStyle.fixedWidth=(U.test(v))?Math.max(0,getFixedWidth(e,v)):v;setOverrideStyle(e,"width",e.runtimeStyle.fixedWidth)}};function layoutWidth(e){if(!isFixed(e)){var l=e.offsetParent;while(l&&!ie7Layout.hasLayout(l))l=l.offsetParent}return(l||viewport).clientWidth};function getPixelWidth(e,v){if(PERCENT.test(v))return parseInt(parseFloat(v)/100*layoutWidth(e));return getPixelValue(e,v)};var getFixedWidth=function(e,v){var b=e.currentStyle["box-sizing"]=="border-box";var a=0;if(quirksMode&&!b)a+=getBorderWidth(e)+getPaddingWidth(e);else if(!quirksMode&&b)a-=getBorderWidth(e)+getPaddingWidth(e);return getPixelWidth(e,v)+a};function getBorderWidth(e){return e.offsetWidth-e.clientWidth};function getPaddingWidth(e){return getPixelWidth(e,e.currentStyle.paddingLeft)+getPixelWidth(e,e.currentStyle.paddingRight)};eval(String(getPaddingWidth).replace(/padding/g,"margin").replace(/Padding/g,"Margin"));HEADER+="*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";function minWidth(e){if(e.currentStyle["min-width"]!=null){e.style.minWidth=e.currentStyle["min-width"]}if(register(minWidth,e,e.currentStyle.minWidth!="none")){ie7Layout.boxSizing(e);fixWidth(e);resizeWidth(e)}};eval(String(minWidth).replace(/min/g,"max"));ie7Layout.minWidth=minWidth;ie7Layout.maxWidth=maxWidth;function resizeWidth(e){var r=e.getBoundingClientRect();var w=r.right-r.left;if(e.currentStyle.minWidth!="none"&&w<=getFixedWidth(e,e.currentStyle.minWidth)){e.runtimeStyle.width=getFixedWidth(e,e.currentStyle.minWidth)}else if(e.currentStyle.maxWidth!="none"&&w>=getFixedWidth(e,e.currentStyle.maxWidth)){e.runtimeStyle.width=getFixedWidth(e,e.currentStyle.maxWidth)}else{e.runtimeStyle.width=e.runtimeStyle.fixedWidth}};function fixRight(e){if(register(fixRight,e,/^(fixed|absolute)$/.test(e.currentStyle.position)&&getDefinedStyle(e,"left")!="auto"&&getDefinedStyle(e,"right")!="auto"&&A.test(getDefinedStyle(e,"width")))){resizeRight(e);ie7Layout.boxSizing(e)}};ie7Layout.fixRight=fixRight;function resizeRight(e){var l=getPixelWidth(e,e.runtimeStyle._4||e.currentStyle.left);var w=layoutWidth(e)-getPixelWidth(e,e.currentStyle.right)-l-getMarginWidth(e);if(parseInt(e.runtimeStyle.width)==w)return;e.runtimeStyle.width="";if(isFixed(e)||H||e.offsetWidth<w){if(!quirksMode)w-=getBorderWidth(e)+getPaddingWidth(e);if(w<0)w=0;e.runtimeStyle.fixedWidth=w;setOverrideStyle(e,"width",w)}};var _2=0;addResize(function(){var i,w=(_2<viewport.clientWidth);_2=viewport.clientWidth;for(i in minWidth.elements){var e=minWidth.elements[i];var f=(parseInt(e.runtimeStyle.width)==getFixedWidth(e,e.currentStyle.minWidth));if(w&&f)e.runtimeStyle.width="";if(w==f)resizeWidth(e)}for(i in maxWidth.elements){var e=maxWidth.elements[i];var f=(parseInt(e.runtimeStyle.width)==getFixedWidth(e,e.currentStyle.maxWidth));if(!w&&f)e.runtimeStyle.width="";if(w!=f)resizeWidth(e)}for(i in fixRight.elements)resizeRight(fixRight.elements[i])});if(window.IE7_BOX_MODEL!==false){ie7CSS.addRecalc("width",N,quirksMode?applyWidth:_1)}ie7CSS.addRecalc("min-width",N,minWidth);ie7CSS.addRecalc("max-width",N,maxWidth);ie7CSS.addRecalc("right",N,fixRight)};ie7CSS.addRecalc("border-spacing",N,function(e){if(e.currentStyle.borderCollapse!="collapse"){e.cellSpacing=getPixelValue(e,e.currentStyle["border-spacing"])}});ie7CSS.addRecalc("box-sizing","content-box",this.boxSizing);ie7CSS.addRecalc("box-sizing","border-box",borderBox);var _0=new ParseMaster;_0.add(/Width/,"Height");_0.add(/width/,"height");_0.add(/Left/,"Top");_0.add(/left/,"top");_0.add(/Right/,"Bottom");_0.add(/right/,"bottom");eval(_0.exec(String(fixWidth)));fixWidth();fixHeight(true)});
diff --git a/web/inc/IE7/ie7-load.htc b/web/inc/IE7/ie7-load.htc deleted file mode 100644 index a6f1e7f..0000000 --- a/web/inc/IE7/ie7-load.htc +++ /dev/null @@ -1 +0,0 @@ -<component lightweight="true"><attach event="ondocumentready" onevent="IE7.init()"/></component>
diff --git a/web/inc/IE7/ie7-object.htc b/web/inc/IE7/ie7-object.htc deleted file mode 100644 index 392409e..0000000 --- a/web/inc/IE7/ie7-object.htc +++ /dev/null @@ -1,12 +0,0 @@ -<html>
-<!--
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
--->
-<head>
-<style type="text/css">body{margin:0}</style>
-<script type="text/javascript">public_description=new function(){var l=false;this.ie7_anon=true;this.load=function(o,c,u){if(l)return;l=true;function _0(t,p){t.style[p]=o.currentStyle[p]};var p=o;while(p&&p.currentStyle.backgroundColor=="transparent"){p=p.parentElement}if(p)body.style.backgroundColor=p.currentStyle.backgroundColor;_0(body,"backgroundImage");_0(body,"backgroundRepeat");_0(body,"backgroundPositionX");_0(body,"backgroundPositionY");_0(body,"fontFamily");_0(body,"fontSize");_0(wrapper,"paddingTop");_0(wrapper,"paddingRight");_0(wrapper,"paddingBottom");_0(wrapper,"paddingLeft");image.width=o.clientWidth;image.height=o.clientHeight;var B64=/^data:.*;base64/i,P=/.png$/i;if(B64.test(u))u="ie7-base64.php"+"?"+u.slice(5);if(P.test(u)&&!/MSIE 5.0/.test(navigator.userAgent)){image.src="blank.gif";image.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+u+"',sizingMethod='scale')"}else{image.src=u}o.style.width=body.scrollWidth;o.style.height=body.scrollHeight}};</script>
-</head>
-<body id="body"><div id="wrapper"><img id="image"></div></body>
-</html>
diff --git a/web/inc/IE7/ie7-overflow.js b/web/inc/IE7/ie7-overflow.js deleted file mode 100644 index ad2e030..0000000 --- a/web/inc/IE7/ie7-overflow.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-overflow",function(){var S={backgroundColor:"transparent",backgroundImage:"none",backgroundPositionX:null,backgroundPositionY:null,backgroundRepeat:null,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderTopStyle:"none",borderRightStyle:"none",borderBottomStyle:"none",borderLeftWidth:0,height:null,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,width:"100%"};function _3(p,s,t){t.style[p]=s.currentStyle[p];if(S[p]!=null){s.runtimeStyle[p]=S[p]}};ie7CSS.addRecalc("overflow","visible",function(e){if(e.parentNode.ie7_wrapper)return;if(ie7Layout&&e.currentStyle["max-height"]!="auto"){ie7Layout.maxHeight(e)}if(e.currentStyle.marginLeft=="auto")e.style.marginLeft=0;if(e.currentStyle.marginRight=="auto")e.style.marginRight=0;var w=document.createElement(ANON);w.ie7_wrapper=true;for(var p in S)_3(p,e,w);w.style.display="block";w.style.position="relative";e.runtimeStyle.position="absolute";e.parentNode.insertBefore(w,e);w.appendChild(e)});cssQuery.addModule("ie7-overflow",function(){function _0(e){return(e&&e.ie7_wrapper)?e.firstChild:e};var _2=previousElementSibling;previousElementSibling=function(e){return _0(_2(e))};var _1=nextElementSibling;nextElementSibling=function(e){return _0(_1(e))};selectors[" "]=function(r,f,t,n){var e,i,j;for(i=0;i<f.length;i++){var s=getElementsByTagName(f[i],t,n);for(j=0;(e=_0(s[j]));j++){if(thisElement(e)&&(!n||compareNamespace(e,n)))r.push(e)}}};selectors[">"]=function(r,f,t,n){var e,i,j;for(i=0;i<f.length;i++){var s=childElements(f[i]);for(j=0;(e=_0(s[j]));j++){if(compareTagName(e,t,n))r.push(e)}}}})});
diff --git a/web/inc/IE7/ie7-quirks.js b/web/inc/IE7/ie7-quirks.js deleted file mode 100644 index a1314dd..0000000 --- a/web/inc/IE7/ie7-quirks.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-quirks",function(){if(quirksMode){var F="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");for(var i=0;i<F.length;i++){F[F[i]]=F[i-1]||"0.67em"}ie7CSS.addFix(new RegExp("(font(-size)?\\s*:\\s*)([\\w\\-\\.]+)"),function(m,o){return m[o+1]+(F[m[o+3]]||m[o+3])});if(appVersion<6){var N=/^\-/,L=/(em|ex)$/i;var EM=/em$/i,EX=/ex$/i;function _2(e){var s=1;_0.style.fontFamily=e.currentStyle.fontFamily;_0.style.lineHeight=e.currentStyle.lineHeight;while(e!=body){var f=e.currentStyle["ie7-font-size"];if(f){if(EM.test(f))s*=parseFloat(f);else if(PERCENT.test(f))s*=(parseFloat(f)/100);else if(EX.test(f))s*=(parseFloat(f)/2);else{_0.style.fontSize=f;return 1}}e=e.parentElement}return s};var _0=createTempElement();getPixelValue=function(e,v){if(PIXEL.test(v||0))return parseInt(v||0);var scale=N.test(v)?-1:1;if(L.test(v))scale*=_2(e);_0.style.width=(scale<0)?v.slice(1):v;body.appendChild(_0);v=scale*_0.offsetWidth;_0.removeNode();return parseInt(v)};HEADER=HEADER.replace(/(font(-size)?\s*:\s*([^\s;}\/]*))/gi,"ie7-font-size:$3;$1");ie7CSS.addFix(/cursor\s*:\s*pointer/,"cursor:hand");ie7CSS.addFix(/display\s*:\s*list-item/,"display:block")}function getPaddingWidth(e){return getPixelValue(e,e.currentStyle.paddingLeft)+getPixelValue(e,e.currentStyle.paddingRight)};function _1(e){if(appVersion<5.5&&ie7Layout)ie7Layout.boxSizing(e.parentElement);var p=e.parentElement;var m=p.offsetWidth-e.offsetWidth-getPaddingWidth(p);var a=(e.currentStyle["ie7-margin"]&&e.currentStyle.marginRight=="auto")||e.currentStyle["ie7-margin-right"]=="auto";switch(p.currentStyle.textAlign){case"right":m=(a)?parseInt(m/2):0;e.runtimeStyle.marginRight=parseInt(m)+"px";break;case"center":if(a)m=0;default:if(a)m=parseInt(m/2);e.runtimeStyle.marginLeft=parseInt(m)+"px"}};ie7CSS.addRecalc("margin(-left|-right)?","[^};]*auto",function(e){if(register(_1,e,e.parentElement&&e.currentStyle.display=="block"&&e.currentStyle.marginLeft=="auto"&&e.currentStyle.position!="absolute")){_1(e)}});addResize(function(){for(var i in _1.elements){e=_1.elements[i];e.runtimeStyle.marginLeft=e.runtimeStyle.marginRight="";_1(e)}})}});
diff --git a/web/inc/IE7/ie7-recalc.js b/web/inc/IE7/ie7-recalc.js deleted file mode 100644 index 10cb839..0000000 --- a/web/inc/IE7/ie7-recalc.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-recalc",function(){C=/\sie7_class\d+/g;function _0(e){e.className=e.className.replace(C,"")};function _1(e){e.runtimeStyle.cssText=""};ie7CSS.specialize({elements:{},handlers:[],reset:function(){this.removeEventHandlers();var e=this.elements;for(var i in e)_1(e[i]);this.elements={};if(this.Rule){var e=this.Rule.elements;for(var i in e)_0(e[i]);this.Rule.elements={}}},reload:function(){ie7CSS.rules=[];this.getInlineStyles();this.screen.load();if(this.print)this.print.load();this.refresh();this.trash()},addRecalc:function(p,t,h,r){this.inherit(p,t,function(e){h(e);ie7CSS.elements[e.uniqueID]=e},r)},recalc:function(){this.reset();this.inherit()},addEventHandler:function(e,t,h){e.attachEvent(t,h);this.handlers.push(arguments)},removeEventHandlers:function(){var h;while(h=this.handlers.pop()){removeEventHandler(h[0],h[1],h[2])}},getInlineStyles:function(){var st=document.getElementsByTagName("style"),s;for(var i=st.length-1;(s=st[i]);i--){if(!s.disabled&&!s.ie7){var c=s.c||s.innerHTML;this.styles.push(c);s.c=c}}},trash:function(){var s,i;for(i=0;i<styleSheets.length;i++){s=styleSheets[i];if(!s.ie7&&!s.c){s.c=s.cssText}}this.inherit()},getText:function(s){return s.c||this.inherit(s)}});addEventHandler(window,"onunload",function(){ie7CSS.removeEventHandlers()});if(ie7CSS.Rule){ie7CSS.Rule.elements={};ie7CSS.Rule.prototype.specialize({add:function(e){this.inherit(e);ie7CSS.Rule.elements[e.uniqueID]=e}});ie7CSS.PseudoElement.hash={};ie7CSS.PseudoElement.prototype.specialize({create:function(t){var k=this.selector+":"+t.uniqueID;if(!ie7CSS.PseudoElement.hash[k]){ie7CSS.PseudoElement.hash[k]=true;this.inherit(t)}}})}if(isHTML&&ie7HTML){ie7HTML.specialize({elements:{},addRecalc:function(s,h){this.inherit(s,function(e){if(!ie7HTML.elements[e.uniqueID]){h(e);ie7HTML.elements[e.uniqueID]=e}})}})}document.recalc=function(reload){if(ie7CSS.screen){if(reload)ie7CSS.reload();recalc()}}});
diff --git a/web/inc/IE7/ie7-server.css b/web/inc/IE7/ie7-server.css deleted file mode 100644 index 50ca605..0000000 --- a/web/inc/IE7/ie7-server.css +++ /dev/null @@ -1,44 +0,0 @@ -body, td, dd {font: 10pt Verdana, Arial, Helvetica, sans-serif; color: black;}
-body {margin: 8px; background: #333;}
-h1 {margin: 0;}
-h1 a:hover {background-color: transparent;}
-h2 {font-size: 1.75em;}
-h3 {font-size: 1.1em;}
-p.footnote {font-family: "Times New Roman", Times, serif; font-style: italic;}
-a:active {color: #ff0000;}
-a:link {color: #0a6cce;}
-a:visited {color: #0a6cce;}
-code, *.code {font-family: monospace; font-size: 100%; font-style: normal; white-space: nowrap;
- padding: 0 1px; background: #f2f3f8; border: #d6d9e9 1px solid;}
-code.box {display: block; padding: 10px; margin: 0.5em 0;}
-ul {list-style-type: square;}
-dd {margin: .2em 0 .5em 1em;}
-dl.library dt {display: list-item; margin-left: 3em; list-style-type: square;}
-dl.library dd {font-style: italic; margin-left: 3em;}
-dt {font-weight: bold;}
-dt.pack {color: brown;}
-a img {border-style: none;}
-hr {height: 1px; color: #000; border-style: solid;}
-hr.short {height: 2px; width: 100px;}
-div.document {background: #eef; padding: 20px 20px 5px 20px; width: 600px; border: 1px solid black;}
-hr {border-bottom-width: 0px;}
-div.header hr {color: #0a6cce; background-color: #0a6cce;}
-div.footer hr {color: #898e79; background-color: #898e79; }
-div.header, div.header a:link, div.header a:visited, h3 a:link, h3 a:visited {text-decoration: none;}
-a:hover {color: #fff; background-color: #0a6cce; text-decoration: none;}
-div.footer a:hover {background-color: transparent; text-decoration: none;}
-div.header .menu {text-align: right;}
-div.content {min-height: 100px;}
-div.footer {font-size: x-small; margin-top: 8px;}
-div.footnote {font-family: "times new roman", times; font-style: italic; margin-top: 10px;}
-#license {margin-top: 5px; font-size: xx-small;}
-table {border-top: 1px solid #000; border-left: 1px solid #000;}
-th {background-color: #fff; text-align: left;}
-th, td {border-right: 1px solid #000; border-bottom: 1px solid #000;}
-th.small {width: 100px;}
-th.medium {width: 200px;}
-th.large {width: 270px;}
-th.x-large {width: 408px;}
-table.fixed {table-layout: fixed;}
-span.comment {color: #666;}
-
diff --git a/web/inc/IE7/ie7-squish.js b/web/inc/IE7/ie7-squish.js deleted file mode 100644 index e5a1972..0000000 --- a/web/inc/IE7/ie7-squish.js +++ /dev/null @@ -1,45 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-IE7.addModule("ie7-squish", function() {
-
-/* ---------------------------------------------------------------------
-
- Squish some IE bugs!
-
- Some of these bug fixes may have adverse effects so they are
- not included in the standard library. Add your own if you want.
-
- -dean
-
---------------------------------------------------------------------- */
-
-// @NOTE: ie7Layout.boxSizing is the same as the "Holly Hack"
-
-// "doubled margin" bug
-// http://www.positioniseverything.net/explorer/doubled-margin.html
-ie7CSS.addFix(/float\s*:\s*(left|right)/, "display:inline;$1");
-
-if (ie7Layout) {
- // "peekaboo" bug
- // http://www.positioniseverything.net/explorer/peekaboo.html
- if (appVersion >= 6) ie7CSS.addRecalc("float", "left|right", function($element) {
- ie7Layout.boxSizing($element.parentElement);
- // "doubled margin" bug
- $element.runtimeStyle.display = "inline";
- });
-
- // "unscrollable content" bug
- // http://www.positioniseverything.net/explorer/unscrollable.html
- ie7CSS.addRecalc("position", "absolute|fixed", function($element) {
- if ($element.offsetParent && $element.offsetParent.currentStyle.position == "relative")
- ie7Layout.boxSizing($element.offsetParent);
- });
-}
-
-//# // get rid of Microsoft's pesky image toolbar
-//# if (!complete) document.write('<meta http-equiv="imagetoolbar" content="no">');
-
-});
diff --git a/web/inc/IE7/ie7-standard-p.js b/web/inc/IE7/ie7-standard-p.js deleted file mode 100644 index 6db85f5..0000000 --- a/web/inc/IE7/ie7-standard-p.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('y(!26.1F)11 7(){2C{26.1F=8;6 2s=8.24=11 3b;8.1g=7(){z"1F 4x 0.9 (ad)"};6 5T=/5T/.Z(2y.5h.7C);6 31=(5T)?7(m){26.31(1F+"\\n\\n"+m)}:2s;6 29=ac.29.19(/ab (\\d\\.\\d)/)[1];6 2m=16.aa!="a9";y(/a8/.Z(2y.5h.7C)||29<5||!/^a7/.Z(16.2F.2a))z;6 33=16.5W=="33";6 1s,1K;6 2F=16.2F,1X,1J,1R=16.1R;6 4E="!";6 3Q={};6 2G=1z;1F.24=7(n,s){y(!3Q[n]){y(2G)1k("s="+23(s));3Q[n]=11 s()}};6 R=/^[\\w\\.]+[^:]*$/;7 1Z(h,p){y(R.Z(h))h=(p||"")+h;z h};7 3F(h,p){h=1Z(h,p);z h.1q(0,h.7a("/")+1)};6 s=16.7B[16.7B.K-1];2C{1k(s.7j)}2j(i){}6 2k=3F(s.1l);6 2v;2C{6 l=(a6()>=5)?"a5":"5n";2v=11 a4(l+".a3")}2j(i){}6 4A={};7 3T(h,p){2C{h=1Z(h,p);y(!4A[h]){2v.a2("a1",h,1z);2v.a0();y(2v.7A==0||2v.7A==9Z){4A[h]=2v.9Y}}}2j(i){31("4B [1]: 5O 9X 9W "+h)}5U{z 4A[h]||""}};6 4i=1Z("9V.9U",2k);7 2o(1w){y(1w!=1U){1w.1T=1t.1C.1T;1w.1e=1t.1C.1e}z 1w};2o.1e=7(p,c){y(!p)p={};y(!c)c=p.1h;y(c=={}.1h)c=11 3b("8.1T()");c.1i=11 3b("z 8");c.1i.1C=11 8.1i;c.1i.1C.1e(p);c.1C=11 c.1i;c.1i.1C.1h=c.1C.1h=c;c.2E=8;c.1e=1a.5P;c.4z=8.4z;z c};2o.1i=11 3b("z 8");2o.1i.1C={1h:2o,1T:7(){z 1a.5P.9T.2E.2q(8,1a)},1e:7(1w){y(8==8.1h.1C&&8.1h.1e){z 8.1h.1i.1C.1e(1w)}O(6 i 28 1w){34(i){1m"1h":1m"1g":1m"1i":5M}y(3Y 1w[i]=="7"&&1w[i]!=8[i]){1w[i].2E=8[i]}8[i]=1w[i]}y(1w.1g!=8.1g&&1w.1g!={}.1g){1w.1g.2E=8.1g;8.1g=1w.1g}z 8}};7 1t(){};8.1t=2o.1e({1h:1t,1g:7(){z"[9S "+(8.1h.1x||"9R")+"]"},9Q:7(2i){z 8.1h==2i||2i.4z(8.1h)}});1t.1x="1t";1t.2E=1U;1t.4z=7(2i){1D(2i&&2i.2E!=8)2i=2i.2E;z 7q(2i)};1t.1i.2E=2o;3u 8.1t;6 5x=1t.1e({1h:7(){8.3L=[];8.1Q=[]},1S:2s});y(29<5.5)1k(3T("17-9P.5X",2k));6 5S=1z;1F.1S=7(){2C{y(5S)z;5S=33=1o;1X=16.1X;1J=(2m)?1X:2F;y(2l&&1s)1s.2q();V.2q();1u();31("2G 9O")}2j(e){31("4B [2]: "+e.5V)}};6 1Q=[];7 1n(r){1Q.1b(r)};7 1u(){14.5g();y(2l&&1s)1s.1u();V.1u();O(6 i=0;i<1Q.K;i++)1Q[i]()};7 2U(){6 E=0,R=1,L=2;6 G=/\\(/g,S=/\\$\\d/,I=/^\\$\\d+$/,T=/([\'"])\\1\\+(.*)\\+\\1\\1$/,7t=/\\\\./g,Q=/\'/,7z=/\\3S[^\\3S]*\\3S/g;6 3N=8;8.15=7(e,r){y(!r)r="";6 l=(5R(23(e)).19(G)||"").K+1;y(S.Z(r)){y(I.Z(r)){r=25(r.1q(1))-1}1d{6 i=l;6 q=Q.Z(5R(r))?\'"\':"\'";1D(i)r=r.2O("$"+i--).2p(q+"+a[o+"+i+"]+"+q);r=11 3b("a,o","z"+q+r.13(T,"$1")+q)}}7y(e||"/^$/",r,l)};8.2V=7(s){3R.K=0;z 7u(7v(s,8.4y).13(11 1N(30,8.5Q?"5D":"g"),7w),8.4y).13(7z,"")};8.72=7(){30.K=0};6 3R=[];6 30=[];6 7x=7(){z"("+23(8[E]).1q(1,-1)+")"};30.1g=7(){z 8.2p("|")};7 7y(){1a.1g=7x;30[30.K]=1a}7 7w(){y(!1a[0])z"";6 i=1,j=0,p;1D(p=30[j++]){y(1a[i]){6 r=p[R];34(3Y r){1m"7":z r(1a,i);1m"9N":z 1a[r+i]}6 d=(1a[i].6F(3N.4y)==-1)?"":"\\3S"+1a[i]+"\\3S";z d+r}1d i+=p[L]}};7 7v(s,e){z e?s.13(11 1N("\\\\"+e+"(.)","g"),7(m,c){3R[3R.K]=c;z e}):s};7 7u(s,e){6 i=0;z e?s.13(11 1N("\\\\"+e,"g"),7(){z e+(3R[i++]||"")}):s};7 5R(s){z s.13(7t,"")}};2U.1C={1h:2U,5Q:1z,4y:""};1t.1e(2U.1C);6 3M=2U.1e({5Q:1o});6 14=7(){6 4x="2.0.2";6 C=/\\s*,\\s*/;6 14=7(s,1E){2C{6 m=[];6 u=1a.5P.5I&&!1E;6 b=(1E)?(1E.1h==7n)?1E:[1E]:[16];6 2f=45(s).2O(C),i;O(i=0;i<2f.K;i++){s=5J(2f[i]);y(4P&&s.1q(0,3).2p("")==" *#"){s=s.1q(2);1E=7o([],b,s[1])}1d 1E=b;6 j=0,t,f,a,c="";1D(j<s.K){t=s[j++];f=s[j++];c+=t+f;a="";y(s[j]=="("){1D(s[j++]!=")"&&j<s.K){a+=s[j]}a=a.1q(0,-1);c+="("+a+")"}1E=(u&&2e[c])?2e[c]:7m(1E,t,f,a);y(u)2e[c]=1E}m=m.4J(1E)}3u 14.5O;z m}2j(e){14.5O=e;z[]}};14.1g=7(){z"7 14() {\\n [4x "+4x+"]\\n}"};6 2e={};14.5I=1z;14.5g=7(s){y(s){s=5J(s).2p("");3u 2e[s]}1d 2e={}};6 3Q={};6 2G=1z;14.24=7(n,s){y(2G)1k("s="+23(s));3Q[n]=11 s()};14.1i=7(c){z c?1k(c):8};6 1V={};6 1B={};6 1p={19:/\\[([\\w-]+(\\|[\\w-]+)?)\\s*(\\W?=)?\\s*([^\\]]*)\\]/};6 2R=[];1V[" "]=7(r,f,t,n){6 e,i,j;O(i=0;i<f.K;i++){6 s=4w(f[i],t,n);O(j=0;(e=s[j]);j++){y(2D(e)&&5K(e,n))r.1b(e)}}};1V["#"]=7(r,f,i){6 e,j;O(j=0;(e=f[j]);j++)y(e.1c==i)r.1b(e)};1V["."]=7(r,f,c){c=11 1N("(^|\\\\s)"+c+"(\\\\s|$)");6 e,i;O(i=0;(e=f[i]);i++)y(c.Z(e.1x))r.1b(e)};1V[":"]=7(r,f,p,a){6 t=1B[p],e,i;y(t)O(i=0;(e=f[i]);i++)y(t(e,a))r.1b(e)};1B["21"]=7(e){6 d=5L(e);y(d.5N)O(6 i=0;i<d.5N.K;i++){y(d.5N[i]==e)z 1o}};1B["37"]=7(e){};6 2D=7(e){z(e&&e.7k==1&&e.2W!="!")?e:1U};6 4S=7(e){1D(e&&(e=e.9M)&&!2D(e))5M;z e};6 47=7(e){1D(e&&(e=e.6W)&&!2D(e))5M;z e};6 3l=7(e){z 2D(e.7s)||47(e.7s)};6 5t=7(e){z 2D(e.7r)||4S(e.7r)};6 6q=7(e){6 c=[];e=3l(e);1D(e){c.1b(e);e=47(e)}z c};6 4P=1o;6 5H=7(e){6 d=5L(e);z(3Y d.7p=="9L")?/\\.9K$/i.Z(d.9J):7q(d.7p=="9I 9H")};6 5L=7(e){z e.9G||e.16};6 4w=7(e,t){z(t=="*"&&e.1Y)?e.1Y:e.4w(t)};6 4T=7(e,t,n){y(t=="*")z 2D(e);y(!5K(e,n))z 1z;y(!5H(e))t=t.9F();z e.2W==t};6 5K=7(e,n){z!n||(n=="*")||(e.9E==n)};6 9D=7(e){z e.9C};7 7o(r,f,1c){6 m,i,j;O(i=0;i<f.K;i++){y(m=f[i].1Y.9B(1c)){y(m.1c==1c)r.1b(m);1d y(m.K!=1U){O(j=0;j<m.K;j++){y(m[j].1c==1c)r.1b(m[j])}}}}z r};y(![].1b)7n.1C.1b=7(){O(6 i=0;i<1a.K;i++){8[8.K]=1a[i]}z 8.K};6 N=/\\|/;7 7m(1E,t,f,a){y(N.Z(f)){f=f.2O(N);a=f[0];f=f[1]}6 r=[];y(1V[t]){1V[t](r,1E,f,a)}z r};6 S=/^[^\\s>+~]/;6 7l=/[\\s#.:>+~()@]|[^\\s#.:>+~()@]+/g;7 5J(s){y(S.Z(s))s=" "+s;z s.19(7l)||[]};6 W=/\\s*([\\s>+~(),]|^|$)\\s*/g;6 I=/([\\s>+~,]|[^(]\\+|^)([#.:@])/g;6 45=7(s){z s.13(W,"$1").13(I,"$1*$2")};6 2c={1g:7(){z"\'"},19:/^(\'[^\']*\')|("[^"]*")$/,Z:7(s){z 8.19.Z(s)},15:7(s){z 8.Z(s)?s:8+s+8},3v:7(s){z 8.Z(s)?s.1q(1,-1):s}};6 2w=7(t){z 2c.3v(t)};6 E=/([\\/()[\\]?{}|*+-])/g;7 4O(s){z s.13(E,"\\\\$1")};2G=1o;z 14}();14.5I=1o;14.24("17",7(){2D=7(e){z(e&&e.7k==1&&e.2W!="!"&&!e.2K)?e:1U}});14.1i("2w=1a[1]",42);6 2l=!14.1i("5H(1a[1])",2F);6 2r=":21{17-21:21}:37{17-21:37}"+(2l?"":"*{6Q:0}");6 V=11(5x.1e({5B:11 3M,2P:"",2Y:"",5F:[],1S:7(){8.5G();8.4t()},4t:7(){V.3O.18=2r+8.2P+8.2Y},7i:7(){6 3P=16.4w("1r"),s;O(6 i=3P.K-1;(s=3P[i]);i--){y(!s.3m&&!s.17){8.5F.1b(s.7j)}}},2q:7(){8.7i();8.4t();11 3y("2P");8.7g()},3i:7(e,r){8.5B.15(e,r)},1u:7(){6 R=/7h\\d+/g;6 s=2r.19(/[{,]/g).K;6 3P=s+(8.2P.18.19(/\\{/g)||"").K;6 2Q=8.3O.2t,r;6 4v,c,4u,e,i,j,k,1c;O(i=s;i<3P;i++){r=2Q[i];y(r&&(4v=r.1r.18.19(R))){4u=14(r.4M);y(4u.K)O(j=0;j<4v.K;j++){1c=4v[j];c=V.1Q[1c.1q(10)][2];O(k=0;(e=4u[k]);k++){y(e.D[1c])c(e)}}}}},1n:7(p,t,h,r){t=11 1N("([{;\\\\s])"+p+"\\\\s*:\\\\s*"+t+"[^;}]*");6 i=8.1Q.K;y(r)r=p+":"+r;8.3i(t,7(m,o){z(r?m[o+1]+r:m[o])+";17-"+m[o].1q(1)+";7h"+i+":1"});8.1Q.1b(1a);z i},2w:7(s){z s.18||""},5G:7(){y(33||!2l)16.5G();1d 16.9A("<1r 17=1o></1r>");8.3O=1R[1R.K-1];8.3O.17=1o;8.3O.18=2r},7g:7(){O(6 i=0;i<1R.K;i++){y(!1R[i].17&&1R[i].18){1R[i].18=""}}}}));7 3y(m){8.2Z=m;8.3q();V[m]=8;V.4t()};1t.1e({1h:3y,1g:7(){z"@2Z "+8.2Z+"{"+8.18+"}"},1u:2s,3q:7(){8.18="";8.2w();8.38();8.18=41(8.18);f={}},2w:7(){6 7e=[].4J(V.5F);6 M=/@2Z\\s+([^{]*)\\{([^@]+\\})\\s*\\}/5D;6 A=/\\9z\\b|^$/i,S=/\\9y\\b/i,P=/\\9x\\b/i;7 7d(c,m){4s.v=m;z c.13(M,4s)};7 4s(9w,m,c){m=5E(m);34(m){1m"2P":1m"2Y":y(m!=4s.v)z"";1m"1Y":z c}z""};7 5E(m){y(A.Z(m))z"1Y";1d y(S.Z(m))z(P.Z(m))?"1Y":"2P";1d y(P.Z(m))z"2Y"};6 3N=8;7 5C(s,p,m,l){6 c="";y(!l){m=5E(s.2Z);l=0}y(m=="1Y"||m==3N.2Z){y(l<3){O(6 i=0;i<s.7f.K;i++){c+=5C(s.7f[i],3F(s.2u,p),m,l+1)}}c+=79(s.2u?7c(s,p):7e.77()||"");c=7d(c,3N.2Z)}z c};6 f={};7 7c(s,p){6 u=1Z(s.2u,p);y(f[u])z"";f[u]=(s.3m)?"":7b(V.2w(s,p),3F(s.2u,p));z f[u]};6 U=/(43\\s*\\(\\s*[\'"]?)([\\w\\.]+[^:\\)]*[\'"]?\\))/5D;7 7b(c,p){z c.13(U,"$1"+p.1q(0,p.7a("/")+1)+"$2")};O(6 i=0;i<1R.K;i++){y(!1R[i].3m&&!1R[i].17){8.18+=5C(1R[i])}}},38:7(){8.18=V.5B.2V(8.18)},1u:2s});6 2c=14.1i("2c");6 4r=[];7 79(c){z 2n.2V(3r.2V(c))};7 5A(m,o){z 2c+(4r.1b(m[o])-1)+2c};7 42(v){z 2c.Z(v)?1k(4r[1k(v)]):v};6 2n=11 3M;2n.15(/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//);2n.15(/\'[^\']*\'/,5A);2n.15(/"[^"]*"/,5A);2n.15(/\\s+/," ");2n.15(/@(9v|9u)[^;\\n]+[;\\n]|<!\\-\\-|\\-\\->/);6 3r=11 3M;3r.15(/\\\\\'/,"\\\\9t");3r.15(/\\\\"/,"\\\\46");6 5z=11 3M;5z.15(/\'(\\d+)\'/,78);7 41(c){z 5z.2V(c)};7 78(m,o){z 4r[m[o+1]]};6 5y=[];7 4U(h){1n(h);1j(26,"9s",h)};7 1j(e,t,h){e.9r(t,h);5y.1b(1a)};7 76(e,t,h){2C{e.9q(t,h)}2j(i){}};1j(26,"9p",7(){6 h;1D(h=5y.77()){76(h[0],h[1],h[2])}});7 20(h,e,c){y(!h.1O)h.1O={};y(c)h.1O[e.2a]=e;1d 3u h.1O[e.2a];z c};1j(26,"6z",7(){y(!V.2Y)11 3y("2Y");V.2Y.1u()});6 75=/^\\d+(9o)?$/i;6 3d=/^\\d+%$/;6 3c=7(e,v){y(75.Z(v))z 25(v);6 s=e.1r.1f;6 r=e.J.1f;e.J.1f=e.D.1f;e.1r.1f=v||0;v=e.1r.4e;e.1r.1f=s;e.J.1f=r;z v};7 6x(t){6 e=16.3X(t||"2M");e.1r.18="1y:3C;6R:0;4K:9n;3G:1M;9m:9l(0 0 0 0);1f:-9k";e.2K=1o;z e};6 4q="17-";7 3D(e){z e.D["17-1y"]=="2z"};7 4o(e,p){z e.D[4q+p]||e.D[p]};7 2T(e,p,v){y(e.D[4q+p]==1U){e.J[4q+p]=e.D[p]}e.J[p]=v};7 4H(o,c,u){6 t=9j(7(){2C{y(!o.3q)z;o.3q(o,c,u);74(t)}2j(i){74(t)}},10)};1F.24("17-9i",7(){y(!2l)z;2r+="9h{3p-3o:9g}9f{3p-3o:1.9e;}9d{3p-3o:1.9c;}"+"9b{3p-3o:9a}99{3p-3o:.98}97{3p-3o:.96}";6 5w={};1s=11(5x.1e({1S:2s,3i:7(){8.3L.1b(1a)},2q:7(){O(6 i=0;i<8.3L.K;i++){6 m=14(8.3L[i][0]);6 f=8.3L[i][1]||6X;O(6 j=0;j<m.K;j++)f(m[j])}},1n:7(){8.1Q.1b(1a)},1u:7(){O(6 i=0;i<8.1Q.K;i++){6 m=14(8.1Q[i][0]);6 r=8.1Q[i][1],e;6 k=4g.95(2,i);O(6 j=0;(e=m[j]);j++){6 u=e.2a;y((5w[u]&k)==0){e=r(e)||e;5w[u]|=k}}}}}));1s.3i("94");1s.1n("93",7(e){y(!e.6o){6 f=14("5l,92",e)[0];y(f){1j(e,"73",7(){f.91()})}}});1s.1n("71,5l",7(e){y(e.2W=="70"){6 m=e.3z.19(/ 3n="([^"]*)"/i);e.J.3n=(m)?m[1]:""}y(e.2L=="5v"){1j(e,"73",7(){e.J.5u=1o;32("16.1Y."+e.2a+".J.5u=1z",1)})}});6 U=/^(5v|72|71)$/;1s.1n("90",7(e){1j(e,"8Z",7(){O(6 i=0;i<e.K;i++){y(6Z(e[i])){e[i].3m=1o;32("16.1Y."+e[i].2a+".3m=1z",1)}1d y(e[i].2W=="70"&&e[i].2L=="5v"){32("16.1Y."+e[i].2a+".3n=\'"+e[i].3n+"\'",1);e[i].3n=e[i].J.3n}}})});7 6Z(e){z U.Z(e.2L)&&!e.3m&&!e.J.5u};1s.1n("5d",7(e){y(e.8Y&&!e.6Y)e.6Y=""});6 P=(29<5.5)?"8X:":"";7 6X(e){6 f=16.3X("<"+P+e.3z.1q(1));y(e.3z.1q(-2)!="/>"){6 6V="</"+e.2W+">",n;1D((n=e.6W)&&n.3z!=6V){f.6t(n)}y(n)n.8W()}e.4R.6A(f,e)}});1F.24("17-8V",7(){1K=8;2r+="*{3H:22-2X}";8.3j=(29<5.5)?7(e){z e.1I}:7(e){z e.D.3j};8.3H=7(e){y(!1K.3j(e)){e.1r.2b="6T";y(e.D.6U=="1P")e.J.6U="2y";4k(e)}};7 4k(e){y(e!=1J&&e.D.1y!="3C"){4p(e);8U(e)}};6 3l=14.1i("3l");6 5t=14.1i("5t");7 4p(e){y(!e.J.3k){6 p=e.59;y(p&&1K.3j(p)&&e==3l(p))z;6 f=3l(e);y(f&&f.D.8T=="1M"&&1K.3j(f)){4p(f);m=5s(e,e.D.3k);c=5s(f,f.D.3k);y(m<0||c<0){e.J.3k=m+c}1d{e.J.3k=4g.3g(c,m)}f.J.3k="8S"}}};1k(23(4p).13(/5c/g,"6N").13(/4N/g,"8R"));7 5s(e,v){z(v=="1P")?0:3c(e,v)};6 U=/^[.\\d][\\w%]*$/,A=/^(1P|6T)$/,N="[.\\\\d]";6 4l,6S;7 6O(e){4l(e);6S(e)};7 2g(H){4l=7(e){y(!3d.Z(e.D.12))2g(e);4k(e)};7 2g(e,v){y(!e.J.3J){y(!v)v=e.D.12;e.J.3J=(U.Z(v))?4g.3g(0,2B(e,v)):v;2T(e,"12",e.J.3J)}};7 5r(e){y(!3D(e)){6 l=e.3B;1D(l&&!1K.3j(l))l=l.3B}z(l||1J).1I};7 1H(e,v){y(3d.Z(v))z 25(4c(v)/3w*5r(e));z 3c(e,v)};6 2B=7(e,v){6 b=e.D["2X-5o"]=="3G-2X";6 a=0;y(2m&&!b)a+=4n(e)+3K(e);1d y(!2m&&b)a-=4n(e)+3K(e);z 1H(e,v)+a};7 4n(e){z e.2S-e.1I};7 3K(e){z 1H(e,e.D.8Q)+1H(e,e.D.8P)};1k(23(3K).13(/6R/g,"6Q").13(/8O/g,"8N"));2r+="*{1A:1M;27:1M;3I-12:1M;3g-12:1M}";7 1A(e){y(e.D["3I-12"]!=1U){e.1r.1A=e.D["3I-12"]}y(20(1A,e,e.D.1A!="1M")){1K.3H(e);2g(e);4m(e)}};1k(23(1A).13(/3I/g,"3g"));1K.1A=1A;1K.27=27;7 4m(e){6 r=e.54();6 w=r.1W-r.1f;y(e.D.1A!="1M"&&w<=2B(e,e.D.1A)){e.J.12=2B(e,e.D.1A)}1d y(e.D.27!="1M"&&w>=2B(e,e.D.27)){e.J.12=2B(e,e.D.27)}1d{e.J.12=e.J.3J}};7 2x(e){y(20(2x,e,/^(2z|3C)$/.Z(e.D.1y)&&4o(e,"1f")!="1P"&&4o(e,"1W")!="1P"&&A.Z(4o(e,"12")))){5p(e);1K.3H(e)}};1K.2x=2x;7 5p(e){6 l=1H(e,e.J.52||e.D.1f);6 w=5r(e)-1H(e,e.D.1W)-l-8M(e);y(25(e.J.12)==w)z;e.J.12="";y(3D(e)||H||e.2S<w){y(!2m)w-=4n(e)+3K(e);y(w<0)w=0;e.J.3J=w;2T(e,"12",w)}};6 5q=0;4U(7(){6 i,w=(5q<1J.1I);5q=1J.1I;O(i 28 1A.1O){6 e=1A.1O[i];6 f=(25(e.J.12)==2B(e,e.D.1A));y(w&&f)e.J.12="";y(w==f)4m(e)}O(i 28 27.1O){6 e=27.1O[i];6 f=(25(e.J.12)==2B(e,e.D.27));y(!w&&f)e.J.12="";y(w!=f)4m(e)}O(i 28 2x.1O)5p(2x.1O[i])});y(26.8L!==1z){V.1n("12",N,2m?4l:4k)}V.1n("3I-12",N,1A);V.1n("3g-12",N,27);V.1n("1W",N,2x)};V.1n("3G-6P",N,7(e){y(e.D.8K!="8J"){e.8I=3c(e,e.D["3G-6P"])}});V.1n("2X-5o","22-2X",8.3H);V.1n("2X-5o","3G-2X",6O);6 1v=11 2U;1v.15(/6v/,"6u");1v.15(/12/,"2b");1v.15(/6w/,"5c");1v.15(/1f/,"2y");1v.15(/8H/,"6N");1v.15(/1W/,"56");1k(1v.2V(23(2g)));2g();8G(1o)});1F.24("17-8F",7(){y(29<5.5)z;6 A="6J.5n.8E";6 F="6K:"+A+"(1l=\'%1\',8D=\'6H\')";6 5j=11 1N((26.8C||"-8B.8A")+"$","i");6 3h=[];7 5f(e){6 f=e.6M[A];y(f){f.1l=e.1l;f.6L=1o}1d{e.J.5m=F.13(/%1/,e.1l);3h.1b(e)}e.1l=4i};7 6y(e){e.1l=e.4D;e.6M[A].6L=1z};V.3i(/6I\\s*:\\s*([\\d.]+)/,7(m,o){z"6G:1;5m:6K:6J.5n.8z(6I="+((4c(m[o+1])*3w)||1)+")"});6 B=/5e(-5i)?\\s*:\\s*([^\\(};]*)43\\(([^\\)]+)\\)([^;}]*)/;V.3i(B,7(m,o){6 u=42(m[o+3]);z 5j.Z(u)?"5m:"+F.13(/6H/,"8y").13(/%1/,u)+";6G:1;5e"+(m[o+1]||"")+":"+(m[o+2]||"")+"1M"+(m[o+4]||""):m[o]});y(1s){1s.1n("5d,5l",7(e){y(e.2W=="8x"&&e.2L!="5i")z;5k(e);1j(e,"8w",7(){y(!4j&&60.8v=="1l"&&e.1l.6F(4i)==-1)5k(e)})});6 6D=/^3W:.*;6E/i;6 6C=1Z("17-6E.8u",2k);7 5k(e){y(5j.Z(e.1l)){6 i=11 8t(e.12,e.2b);i.8s=7(){e.12=i.12;e.2b=i.2b;i=1U};i.1l=e.1l;e.4D=e.1l;5f(e)}1d y(6D.Z(e.1l)){e.1l=6C+"?"+e.1l.1q(5)}};6 I=/^5i/i;6 6B=1Z("17-2M.4C",2k);1s.1n("2M",7(e){y(I.Z(e.2L)){6 o=16.3X("<2M 2L=68/x-67>");o.1r.12=e.D.12;o.1r.2b=e.D.2b;o.3W=6B;6 u=1Z(e.3W,3F(5h.2u));e.4R.6A(o,e);14.5g("2M");4H(o,"",u);z o}})}6 4j=1z;1j(26,"6z",7(){4j=1o;O(6 i=0;i<3h.K;i++)6y(3h[i])});1j(26,"8r",7(){O(6 i=0;i<3h.K;i++)5f(3h[i]);4j=1z})});1F.24("17-2z",7(){V.1n("1y","2z",4a,"3C");V.1n("5e(-8q)?","[^};]*2z",4b);6 4Z=(2m)?"1X":"2F";6 4h=7(){y(1X.D.5b!="2z"){y(1X.D.5a=="1M"){1X.J.8p="8o-8n";1X.J.5a="43("+4i+")"}1X.J.5b="2z"}4h=2s};6 2h=6x("5d");7 1v(f){z 2A.2V(23(f))};6 2A=11 2U;2A.15(/6w/,"5c");2A.15(/1f/,"2y");2A.15(/6v/,"6u");2A.15(/12/,"2b");2A.15(/1W/,"56");2A.15(/X/,"Y");7 3f(e){z(e)?3D(e)||3f(e.59):1z};7 4f(e,p,3e){32("16.1Y."+e.2a+".J.4f(\'"+p+"\',\'"+3e+"\')",0)};7 4b(e){y(20(4b,e,e.D.5b=="2z"&&!e.61(1X))){4h();58(e);8m(e);4V(e)}};7 4V(e){2h.1l=e.D.5a.1q(5,-2);6 p=(e.6c)?e:e.59;p.6t(2h);57(e);8l(e);p.8k(2h)};7 58(e){e.1r.3E=e.D.3E;y(!3f(e)){6 3e="(25(J.3A)+16."+4Z+".6s)||0";4f(e,"3E",3e)}};1k(1v(58));7 57(e){6 p=3f(e)?"3E":"3A";e.J[p]=55(e,e.1r.3E)-e.54().1f-e.8j+2};1k(1v(57));7 55(e,p){34(p){1m"1f":1m"2y":z 0;1m"1W":1m"56":z 1J.1I-2h.2S;1m"8i":z(1J.1I-2h.2S)/2;8h:y(3d.Z(p)){z 25((1J.1I-2h.2S)*4c(p)/3w)}2h.1r.1f=p;z 2h.3A}};1k(1v(55));7 4a(e){y(20(4a,e,3D(e))){2T(e,"1y","3C");2T(e,"1f",e.D.1f);2T(e,"2y",e.D.2y);4h();y(1K)1K.2x(e);49(e)}};7 49(e,r){8g(e,r);4Y(e,r,1o);y(!e.J.4d&&e.D.4X=="1P"&&e.D.1W!="1P"){6 l=1J.1I-1H(e,e.D.1W)-1H(e,e.J.52)-e.1I;y(e.D.8f=="1P")l=25(l/2);y(3f(e.3B))e.J.4e+=l;1d e.J.50=l}53(e);8e(e)};7 53(e){y(e.D.12!="1P"){6 r=e.54();6 w=e.2S-1J.1I+r.1f-2;y(w>=0){w=4g.3g(3c(e,e.D.12)-w,0);2T(e,"12",w)}}};1k(1v(53));7 4Y(e,r){y(!r&&3d.Z(e.D.12)){e.J.2g=e.D.12}y(e.J.2g){e.J.12=1H(e,e.J.2g)}y(r){y(!e.J.4d)z}1d{e.J.50=0;e.J.52=e.D.1f;e.J.4d=e.D.1W!="1P"&&e.D.1f=="1P"}e.J.1f="";e.J.51=4W(e);e.J.4e=e.J.51;y(!r&&!3f(e.3B)){6 3e="J.51+J.50+16."+4Z+".6s";4f(e,"4e",3e)}};1k(1v(4Y));7 4W(e){6 s=e.3A,n=1;y(e.J.4d){s=1J.1I-e.2S-1H(e,e.D.1W)}y(e.D.4X!="1P"){s-=1H(e,e.D.4X)}1D(e=e.3B){y(e.D.1y!="8d")n=-1;s+=e.3A*n}z s};1k(1v(4W));7 1H(e,v){y(3d.Z(v))z 25(4c(v)/3w*1J.1I);z 3c(e,v)};1k(1v(1H));7 6r(){6 e=4b.1O;O(6 i 28 e)4V(e[i]);e=4a.1O;O(i 28 e){49(e[i],1o);49(e[i],1o)}48=0};6 48;4U(7(){y(!48)48=32(6r,0)})});1F.24("17-8c-1V",7(){14.24("8b-8a",7(){1V[">"]=7(r,f,t,n){6 e,i,j;O(i=0;i<f.K;i++){6 s=6q(f[i]);O(j=0;(e=s[j]);j++)y(4T(e,t,n))r.1b(e)}};1V["+"]=7(r,f,t,n){O(6 i=0;i<f.K;i++){6 e=47(f[i]);y(e&&4T(e,t,n))r.1b(e)}};1V["@"]=7(r,f,a){6 t=2R[a].Z;6 e,i;O(i=0;(e=f[i]);i++)y(t(e))r.1b(e)};1B["4N-89"]=7(e){z!4S(e)};1B["4Q"]=7(e,c){c=11 1N("^"+c,"i");1D(e&&!e.2H("4Q"))e=e.4R;z e&&c.Z(e.2H("4Q"))};1p.6p=/\\\\:/g;1p.3x="@";1p.3a={};1p.13=7(m,a,n,c,v){6 k=8.3x+m;y(!2R[k]){a=8.3Z(a,c||"",v||"");2R[k]=a;2R.1b(a)}z 2R[k].1c};1p.38=7(s){s=s.13(8.6p,"|");6 m;1D(m=s.19(8.19)){6 r=8.13(m[0],m[1],m[2],m[3],m[4]);s=s.13(8.19,r)}z s};1p.3Z=7(p,t,v){6 a={};a.1c=8.3x+2R.K;a.66=p;t=8.3a[t];t=t?t(8.2H(p),2w(v)):1z;a.Z=11 3b("e","z "+t);z a};1p.2H=7(n){34(n.5Z()){1m"1c":z"e.1c";1m"3U":z"e.1x";1m"O":z"e.6o";1m"2u":y(4P){z"23((e.3z.19(/2u=\\\\46?([^\\\\s\\\\46]*)\\\\46?/)||[])[1]||\'\')"}}z"e.2H(\'"+n.13(N,":")+"\')"};1p.3a[""]=7(a){z a};1p.3a["="]=7(a,v){z a+"=="+2c.15(v)};1p.3a["~="]=7(a,v){z"/(^| )"+4O(v)+"( |$)/.Z("+a+")"};1p.3a["|="]=7(a,v){z"/^"+4O(v)+"(-|$)/.Z("+a+")"};6 6n=45;45=7(s){z 6n(1p.38(s))}});6 1p=14.1i("1p");6 H=/a(#[\\w-]+)?(\\.[\\w-]+)?:(65|62)/i;6 6l=/\\s*\\{\\s*/,6m=/\\s*\\}\\s*/,C=/\\s*\\,\\s*/;6 F=/(.*)(:4N-(88|87))/;3y.1C.1e({38:7(){8.1T();6 o=V.2t.K;6 2Q=8.18.2O(6m),r;6 2f,c,i,j;O(i=0;i<2Q.K;i++){r=2Q[i].2O(6l);2f=r[0].2O(C);c=r[1];O(j=0;j<2f.K;j++){2f[j]=c?8.6k(2f[j],c):""}2Q[i]=2f.2p("\\n")}8.18=2Q.2p("\\n");8.2t=V.2t.1q(o)},1u:7(){6 r,i;O(i=0;(r=8.2t[i]);i++)r.1u()},6k:7(s,c){y(V.6j.Z(s)){6 m;y(m=s.19(1L.39)){z 11 1L(m[1],m[2],c)}1d y(m=s.19(2d.39)){y(!2l||!H.Z(m)||2d.44.Z(m)){z 11 2d(s,m[1],m[2],m[3],c)}}1d z 11 1G(s,c)}z s+" {"+c+"}"}});V.1e({2t:[],1B:14.1i("1B"),36:{},2e:14.1i("2e"),1G:1G,2d:2d,1L:1L,2J:2J,2q:7(){6 p=8.1B+"|6i|6h|"+8.36;p=p.13(/(21|37)\\|/g,"");8.6j=11 1N("[>+~\\[]|([:.])[\\\\w-()]+\\\\1|:("+p+")");6 c="[^\\\\s(]+\\\\s*[+~]|@\\\\d+|:(";1G.44=11 1N(c+p+")","g");2d.44=11 1N(c+8.1B+")","g");2d.39=11 1N("(.*):("+8.36+")(.*)");1L.39=/(.*):(6i|6h).*/;8.1T()},1u:7(){8.2P.1u();8.1T()},2w:7(s,p){z 2v?(3T(s.2u,p)||s.18):8.1T(s)},1j:7(e,t,h){1j(e,t,h)}});7 1G(s,c){8.1c=V.2t.K;8.1x=1G.3x+8.1c;s=(s).19(F)||s||"*";8.40=s[1]||s;8.4M=1G.6g(8.40)+"."+8.1x+(s[2]||"");8.18=c;8.39=11 1N("\\\\s"+8.1x+"(\\\\s|$)","g");V.2t.1b(8);8.1S()};1t.1e({1h:1G,1g:7(){z 8.4M+" {"+8.18+"}"},1S:2s,15:7(e){e.1x+=" "+8.1x},3v:7(e){e.1x=e.1x.13(8.39,"$1")},1u:7(){6 m=V.2e[" *."+8.1x]=14(8.40);O(i=0;i<m.K;i++)8.15(m[i])}});1G.3x="5Y";1G.6f=/>/g;1G.6g=7(s){s=1p.38(s);z s.13(8.44,"").13(8.6f," ")};7 2d(s,a,d,t,c){8.6e=a||"*";8.6d=V.36[d];8.4L=t;8.1T(s,c)};1G.1e({1h:2d,1u:7(){6 m=14(8.6e);O(6 i=0;i<m.K;i++){6 t=(8.4L)?14(8.4L,m[i]):[m[i]];y(t.K)8.6d.2q(m[i],t,8)}}});6 A=/^4I/;6 U=/^43\\s*\\(\\s*([^)]*)\\)$/;6 M={86:"85",84:"83",82:"81",80:"7Z"};6 6b=1Z("17-22.4C",2k)+"?";2r+=".2K{4K:1M}";7 1L(s,p,c){8.1y=p;6 2N=c.19(1L.6a),m,e;y(2N){2N=2N[1];m=2N.2O(/\\s+/);O(6 i=0;(e=m[i]);i++){m[i]=A.Z(e)?{4I:e.1q(5,-1)}:(e.7Y(0)=="\'")?42(e):41(e)}2N=m}8.22=2N;8.1T(s,41(c))};1G.1e({1h:1L,1g:7(){z"."+8.1x+"{4K:7X}"},1S:7(){8.19=14(8.40);O(6 i=0;i<8.19.K;i++){6 r=8.19[i].J;y(!r[8.1y])r[8.1y]={18:""};r[8.1y].18+=";"+8.18;y(8.22!=1U)r[8.1y].22=8.22}},1u:7(){y(8.22==1U)z;O(6 i=0;i<8.19.K;i++){8.3Z(8.19[i])}},3Z:7(t){6 g=t.J[8.1y];y(g){6 c=[].4J(g.22||"");O(6 j=0;j<c.K;j++){y(3Y c[j]=="2M"){c[j]=t.2H(c[j].4I)}}c=c.2p("");6 u=c.19(U);6 h=1L[u?"69":"4E"].13(/%1/,8.1x);6 4G=g.18.13(/\'/g,\'"\');6 4F=M[8.1y+7W(t.6c)];y(u){6 p=16.3X(h);t.7V(4F,p);p.3W=6b;4H(p,4G,2c.3v(u[1]))}1d{h=h.13(/%2/,4G).13(/%3/,c);t.7U(4F,h)}t.J[8.1y]=1U}}});1L.6a=/22\\s*:\\s*([^;]*)(;|$)/;1L.69="<2M 3U=\'2K %1\' 2K 12=3w% 2b=0 2L=68/x-67>";1L.4E="<17:! 3U=\'2K %1\' 2K 1r=\'%2\'>%3</17:!>";7 2J(n,a){8.66=n;8.2q=a;8.2I={};V.36[n]=8};1t.1e({1h:2J,20:7(i){6 c=i[2];i.1c=c.1c+i[0].2a;y(!8.2I[i.1c]){6 t=i[1],j;O(j=0;j<t.K;j++)c.15(t[j]);8.2I[i.1c]=i}},35:7(i){y(8.2I[i.1c]){6 c=i[2];6 t=i[1],j;O(j=0;j<t.K;j++)c.3v(t[j]);3u 8.2I[i.1c]}}});V.1B.1g=7(){6 t=[],p;O(p 28 8){y(8[p].K>1)p+="\\\\([^)]*\\\\)";t.1b(p)}z t.2p("|")};V.1B["21"]=7(e){z e.D["17-21"]=="21"};V.1B["37"]=7(e){z e.D["17-21"]=="37"};6 64=(29<5.5)?"7T":"7S";6 63=(29<5.5)?"7R":"7Q";V.36.1g=V.1B.1g;6 3s=11 2J("65",7(e){6 i=1a;V.1j(e,64,7(){3s.20(i)});V.1j(e,63,7(){3s.35(i)})});6 3t=11 2J("7P",7(e){6 i=1a;V.1j(e,"7O",7(){3t.35(i);3t.20(i)});V.1j(e,"7N",7(){3t.35(i)});y(e==16.7M){3t.20(i)}});6 3V=11 2J("62",7(e){6 i=1a;V.1j(e,"7L",7(){3V.20(i)})});1j(16,"7K",7(){6 i=3V.2I,j;O(j 28 i)3V.35(i[j]);i=3s.2I;O(j 28 i)y(!i[j][0].61(60.7J))3s.35(i[j])});2o(1p);1p.1e({2H:7(n){34(n.5Z()){1m"3U":z"e.1x.13(/\\\\b\\\\s*5Y\\\\d+/g,\'\')";1m"1l":z"(e.4D||e.1l)"}z 8.1T(n)}});2n.15(/::/,":");3r.15(/\\\\([\\7I-7H-F]{1,4})/,7(m,o){m=m[o+1];z"\\\\u"+"7G".1q(m.K)+m})});2G=1o;y(2m)1k(3T("17-7F.5X",2k));V.1S();y(2l&&1s)1s.1S();y(33)1F.1S();1d{2F.7E(1Z("17-3q.4C",2k));1j(16,"7D",7(){y(16.5W=="33")32(1F.1S,0)})}}2j(e){31("4B [0]: "+e.5V)}5U{}};',62,634,'||||||var|function|this||||||||||||||||||||||||||if|return||||currentStyle||||||runtimeStyle|length||||for|||||||ie7CSS||||test||new|width|replace|cssQuery|add|document|ie7|cssText|match|arguments|push|id|else|specialize|left|toString|constructor|valueOf|addEventHandler|eval|src|case|addRecalc|true|AttributeSelector|slice|style|ie7HTML|Common|recalc|_0|that|className|position|false|minWidth|pseudoClasses|prototype|while|fr|IE7|Rule|getPixelWidth|clientWidth|viewport|ie7Layout|PseudoElement|none|RegExp|elements|auto|recalcs|styleSheets|init|inherit|null|selectors|right|body|all|makePath|register|link|content|String|addModule|parseInt|window|maxWidth|in|appVersion|uniqueID|height|Quote|DynamicRule|cache|se|fixWidth|_1|klass|catch|path|isHTML|quirksMode|encoder|ICommon|join|apply|HEADER|DUMMY|rules|href|httpRequest|getText|fixRight|top|fixed|_2|getFixedWidth|try|thisElement|ancestor|documentElement|loaded|getAttribute|instances|DynamicPseudoClass|ie7_anon|type|object|co|split|screen|ru|attributeSelectors|offsetWidth|setOverrideStyle|ParseMaster|exec|tagName|box|print|media|_3|alert|setTimeout|complete|switch|unregister|dynamicPseudoClasses|visited|parse|MATCH|tests|Function|getPixelValue|PERCENT|ex|_4|max|_5|addFix|hasLayout|marginTop|firstElementChild|disabled|value|size|font|load|safeString|_6|_7|delete|remove|100|PREFIX|StyleSheet|outerHTML|offsetLeft|offsetParent|absolute|isFixed|backgroundPositionX|getPath|border|boxSizing|min|fixedWidth|getPaddingWidth|fixes|Parser|self|styleSheet|st|modules|_8|x01|loadFile|class|_9|data|createElement|typeof|create|selector|decode|getString|url|COMPLEX|parseSelector|x22|nextElementSibling|_10|_11|_12|_13|parseFloat|autoLeft|pixelLeft|setExpression|Math|_14|BLANK_GIF|_15|_16|applyWidth|resizeWidth|getBorderWidth|getDefinedStyle|collapseMarginTop|_17|_18|_19|refresh|el|ca|getElementsByTagName|version|escapeChar|ancestorOf|_20|Error|htc|pngSrc|ANON|po|cs|addTimer|attr|concat|display|target|selectorText|first|regEscape|isMSIE|lang|parentNode|previousElementSibling|compareTagName|addResize|_21|getScreenLeft|marginLeft|positionLeft|_22|shiftLeft|screenLeft|_23|clipWidth|getBoundingClientRect|getOffsetLeft|bottom|setOffsetLeft|backgroundLeft|parentElement|backgroundImage|backgroundAttachment|Top|img|background|_24|clearCache|location|image|_25|_26|input|filter|Microsoft|sizing|resizeRight|_27|layoutWidth|_28|lastElementChild|clicked|submit|_29|Fix|_30|decoder|_31|parser|_32|gi|_33|styles|createStyleSheet|isXML|caching|_34|compareNamespace|getDocument|continue|links|error|callee|ignoreCase|_35|_36|ie7_debug|finally|description|readyState|js|ie7_class|toLowerCase|event|contains|active|_37|_38|hover|name|scriptlet|text|OBJECT|CONTENT|_39|canHaveChildren|dynamicPseudoClass|attach|CHILD|simple|after|before|UNKNOWN|createRule|B1|B2|_40|htmlFor|NS_IE|childElements|_41|scrollLeft|appendChild|Height|Width|Left|createTempElement|_42|onbeforeprint|replaceChild|_43|_44|B64|base64|indexOf|zoom|scale|opacity|DXImageTransform|progid|enabled|filters|Bottom|borderBox|spacing|margin|padding|applyHeight|0cm|verticalAlign|en|nextSibling|_45|title|_46|BUTTON|button|reset|onclick|clearInterval|PIXEL|removeEventHandler|pop|_47|_48|lastIndexOf|_49|_50|_51|_52|imports|trash|ie7_recalc|getInlineStyles|innerHTML|nodeType|ST|select|Array|_53|mimeType|Boolean|lastChild|firstChild|ES|_54|_55|_56|_57|_58|DE|status|scripts|search|onreadystatechange|addBehavior|quirks|0000|fA|da|srcElement|onmouseup|onmousedown|activeElement|onblur|onfocus|focus|onmouseleave|onmouseout|onmouseenter|onmouseover|insertAdjacentHTML|insertAdjacentElement|Number|inline|charAt|beforeEnd|after1|afterEnd|after0|afterBegin|before1|beforeBegin|before0|letter|line|child|level2|css|css2|static|clipHeight|marginRight|positionTop|default|center|clientLeft|removeChild|setOffsetTop|backgroundTop|repeat|no|backgroundRepeat|attachment|onafterprint|onload|Image|php|propertyName|onpropertychange|INPUT|crop|Alpha|png|trans|IE7_PNG_SUFFIX|sizingMethod|AlphaImageLoader|graphics|fixHeight|Right|cellSpacing|collapse|borderCollapse|IE7_BOX_MODEL|getMarginWidth|Margin|Padding|paddingRight|paddingLeft|last|0px|styleFloat|collapseMarginBottom|layout|removeNode|HTML|alt|onsubmit|form|click|textarea|label|abbr|pow|67em|h6|83em|h5|1em|h4|17em|h3|5em|h2|2em|h1|html4|setInterval|9999|rect|clip|block|px|onunload|detachEvent|attachEvent|onresize|x27|import|namespace|ma|bprint|bscreen|ball|write|item|innerText|getTextContent|scopeName|toUpperCase|ownerDocument|Document|XML|URL|xml|unknown|previousSibling|number|successfully|ie5|instanceOf|Object|common|caller|gif|blank|file|loading|responseText|200|send|GET|open|XMLHTTP|ActiveXObject|Msxml2|ScriptEngineMajorVersion|ms_|ie7_off|CSS1Compat|compatMode|MSIE|navigator|alpha'.split('|'),0,{}))
diff --git a/web/inc/IE7/ie7-xml-extras.js b/web/inc/IE7/ie7-xml-extras.js deleted file mode 100644 index 97846f6..0000000 --- a/web/inc/IE7/ie7-xml-extras.js +++ /dev/null @@ -1,6 +0,0 @@ -/*
- IE7, version 0.9 (alpha) (2005-08-19)
- Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
- License: http://creativecommons.org/licenses/LGPL/2.1/
-*/
-function XMLHttpRequest(){var l=(ScriptEngineMajorVersion()>=5)?"Msxml2":"Microsoft";return new ActiveXObject(l+".XMLHTTP")};function DOMParser(){};DOMParser.prototype={toString:function(){return"[object DOMParser]"},parseFromString:function(s,c){var x=new ActiveXObject("Microsoft.XMLDOM");x.loadXML(s);return x},parseFromStream:new Function,baseURI:""};function XMLSerializer(){};XMLSerializer.prototype={toString:function(){return"[object XMLSerializer]"},serializeToString:function(r){return r.xml||r.outerHTML},serializeToStream:new Function};
diff --git a/web/inc/IE7/ie7.gif b/web/inc/IE7/ie7.gif Binary files differdeleted file mode 100644 index 64a2c2d..0000000 --- a/web/inc/IE7/ie7.gif +++ /dev/null diff --git a/web/inc/IE7/test-trans.png b/web/inc/IE7/test-trans.png Binary files differdeleted file mode 100644 index e187e2c..0000000 --- a/web/inc/IE7/test-trans.png +++ /dev/null diff --git a/web/inc/IE7/test.html b/web/inc/IE7/test.html deleted file mode 100644 index ab78f46..0000000 --- a/web/inc/IE7/test.html +++ /dev/null @@ -1,100 +0,0 @@ -<html xmlns:html="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head>
-<title>IE7 Test Page</title>
-<meta name="author" content="Dean Edwards"/>
-<!-- compliance patch for microsoft browsers -->
-<!--[if lt IE 7]>
-<script src="ie7-standard-p.js" type="text/javascript"></script>
-<script src="ie7-css3-selectors.js" type="text/javascript"></script>
-<script src="ie7-css-strict.js" type="text/javascript"></script>
-<![endif]-->
-<style type="text/css">
- body {background-color: #ccc;}
- img {border: none;}
- h1 {font-family: monospace;}
- h2 {background-color: black; color: white; font-style: normal;}
- h3 {margin: 0.1em 0;}
-</style>
-</head>
- -<body>
-<div class="document">
-<div class="header">
-<h1>IE7 { css2: auto; }</h1>
-<hr />
-</div>
-
-<div class="content">
-
-<h2>Black & White Test</h2>
-
-<h3>Legend</h3>
-<style type="text/css">
- div.legend {height: 20px; font-weight: bold; text-indent: 4px;}
- #fail {background-color: black; color: white;}
- #pass {background-color: white; color: black;}
-</style>
-<div class="legend" id="pass">PASS</div>
-<div class="legend" id="fail">FAIL</div>
-
-<hr />
-
-<h3>ie7-html4.js</h3>
-<style type="text/css">
- #ie7-html4 {background-color: black; height: 20px;}
- #ie7-html4 abbr {display: block; background-color: white; height: 20px;}
-</style>
-<div id="ie7-html4"><abbr> </abbr></div>
-
-<h3>ie7-layout.js</h3>
-<style type="text/css">
- #ie7-layout {background-color: black; height: 20px; overflow: hidden;}
- #ie7-layout div.box {position: relative; top: -40px; background-color: white;
- height: 40px; border-top: 20px black solid;}
-</style>
-<div id="ie7-layout"><div class="box"></div></div>
-
-<h3>ie7-graphics.js</h3>
-<style type="text/css">
- #ie7-graphics {background-color: white; height: 20px;}
- #ie7-graphics div.box {height: 20px; background: url(test-trans.png);}
-</style>
-<div id="ie7-graphics"><div class="box"></div></div>
-
-<h3>ie7-fixed.js</h3>
-<style type="text/css">
- #ie7-fixed {background-color: white; height: 20px;}
- #ie7-fixed div.box {position: fixed; top: -20px; background-color: black; height: 20px;}
-</style>
-<div id="ie7-fixed"><div class="box"></div></div>
-
-<h3>ie7-css2-selectors.js</h3>
-<style type="text/css">
- #ie7-css2-selectors {background-color: black; height: 20px;}
- #ie7-css2-selectors > span {display: block; background-color: white; height: 20px;}
-</style>
-<div id="ie7-css2-selectors"><span> </span></div>
-
-<h3>ie7-css3-selectors.js</h3>
-<style type="text/css">
- #ie7-css3-selectors {background-color: black; height: 20px;}
- #ie7-css3-selectors:empty {background-color: white;}
-</style>
-<div id="ie7-css3-selectors"></div>
-
-<h3>ie7-css-strict.js</h3>
-<style type="text/css">
- #ie7-css-strict {background-color: black; height: 20px;}
- #ie7-css-strict > span.strict {display: block; background-color: white; height: 20px;}
- #ie7-css-strict > span {display: block; background-color: black}
-</style>
-<div id="ie7-css-strict"><span class="strict"></span></div>
-</div>
-
-<div class="footer">
-<hr />
-<a href="http://dean.edwards.name/IE7/"><img src="ie7.gif" width="80" height="15" alt="IE7 Enhanced"/></a>
-</div>
-</div>
-</body> -</html> diff --git a/web/inc/button.png b/web/inc/button.png Binary files differdeleted file mode 100644 index 94bf839..0000000 --- a/web/inc/button.png +++ /dev/null diff --git a/web/inc/button.xar b/web/inc/button.xar Binary files differdeleted file mode 100644 index a55a5be..0000000 --- a/web/inc/button.xar +++ /dev/null diff --git a/web/inc/customtags.inc b/web/inc/customtags.inc deleted file mode 100644 index 5f3172c..0000000 --- a/web/inc/customtags.inc +++ /dev/null @@ -1,118 +0,0 @@ -<define-tag where>\ -<perl> -my $path=$WML_SRC_DIRNAME."/".$WML_SRC_BASENAME; -$path =~ s|.+?web/||s; -print "$path.en.html"; -</perl>\ -</define-tag> - -# -# an rrdworld entry -# -#<rrdworld type="extension|application" -# icon="rumble.png" > <!-- Size 100x66 --> -# -# <name> RRRRumble </name> -# <author> Peter Example </author> -#<description> Makes rrdtool rumble when new data is added </description> -# <homepage> http://somesite.blabla.plac </homepage> -# <year> 2005 </year><month> 4 </month> -# <license> GPL </license> -# -# <!-- Optional --> -# -# <livesite> http://somesite.blabla.plac </livesite> -# <email> max@example.com </email> -# -#</rrdworld> - -#<gallery image="graph.png" > -# -# <title> Virus Graph </title> -# <author> Max Beispiel </author> -#<description> The five most common critters of the week. </description> -# <year> 2005 </year><month> 4 </month> -# -# <!-- Optional --> -# -# <livesite> http://somesite.blabla.plac </livesite> -# <email> max@example.com </email> -# -#</gallery> - - - -<define-tag name endtag=required ><set-var-x name=rwv_name><h3>%body</h3></set-var-x></define-tag> -<define-tag title endtag=required ><set-var-x name=rwv_title><h2>%body</h2></set-var-x></define-tag> -<define-tag author endtag=required ><set-var-x name=rwv_author>%body</set-var-x></define-tag> -<define-tag description endtag=required ><set-var-x name=rwv_description>%body</set-var-x></define-tag> -<define-tag homepage endtag=required ><set-var-x name=rwv_homepage> ... <a href="<subst-in-string %body " " "" />">[home]</a></set-var-x></define-tag> -<define-tag year endtag=required ><set-var-x name=rwv_year> %body </set-var-x></define-tag> -<define-tag month endtag=required ><set-var-x name=rwv_month> /%body </set-var-x></define-tag> -<define-tag license endtag=required ><set-var-x name=rwv_license>License: %body</set-var-x></define-tag> -<define-tag livesite endtag=required ><set-var-x name=rwv_livesite> <a href="<subst-in-string "%body" " " "" />">[demo]</a></set-var-x></define-tag> -<define-tag email endtag=required ><set-var-x name=rwv_email><<subst-in-string <subst-in-string "%body" " " "" /> @ "@<span class="legacy">XYZ-</span>" />></set-var-x></define-tag> - -<define-tag rrdworld endtag=required> -<preserve icon type rwv_name rwv_author rwv_description rwv_homepage rwv_year rwv_month rwv_license rwv_livesite rwv_email/> -<set-var %attributes /> -%body -<subst-in-var rwv_year " " ""/> -<subst-in-var rwv_month " " ""/> -<div class="rrdworld"> -<if <get-var icon/> <img align="right" src="<subst-in-string <get-var icon/> " " "" />"/> /> -<get-var rwv_name/> -<div class="who"><get-var rwv_author/> <get-var rwv_email/> | Date: <get-var rwv_year/><get-var rwv_month/> | <get-var rwv_license/></div> -<div class="desc"> -<get-var rwv_description/> -<get-var rwv_homepage/><get-var rwv_livesite/> -</div> -</div> -<restore icon type rwv_name rwv_author rwv_description rwv_homepage rwv_year rwv_month rwv_license rwv_livesite rwv_email/> -</define-tag> - -<define-tag gallery endtag=required> -<preserve image rwv_title rwv_author rwv_description rwv_year rwv_month rwv_livesite rwv_email/> -<set-var %attributes /> -%body -<subst-in-var rwv_year " " ""/> -<subst-in-var rwv_month " " ""/> -<div class="gallery"> -<get-var rwv_title/> -<div class="image"><img src="<subst-in-string <get-var image/> " " "" />"/></div> -<div class="caption"><get-var rwv_description/> -- <get-var rwv_author/> <get-var rwv_email/>, <get-var rwv_year/><get-var rwv_month/> <get-var rwv_livesite/></div> -</div> -<restore image rwv_title rwv_author rwv_description rwv_year rwv_month rwv_livesite rwv_email/> -</define-tag> - - -<define-tag lastchange> -<perl> -use POSIX qw(strftime); -use POSIX qw(locale_h); - setlocale(LC_TIME,"de"); - my $x_de = strftime "%e. %B %Y", localtime("$(WML_SRC_TIME)"); - setlocale(LC_TIME,"en_US"); - my $x_en = strftime "%B %e, %Y", localtime("$(WML_SRC_TIME)"); - $x_de=~ s/\s/ /g; - $x_en=~ s/\s/ /g; -</perl> -<en> -<perl> - print $x_en; -</perl> -</en> -<de> -<perl> - print $x_de; -</perl> -</de> -</define-tag> - -<define-tag picture endtag=required> -<div class="pic"><img src="%body" align=left/></div> -</define-tag> - - - -# vi: ft=wml diff --git a/web/inc/event.js b/web/inc/event.js deleted file mode 100644 index cc99e46..0000000 --- a/web/inc/event.js +++ /dev/null @@ -1,149 +0,0 @@ -// event.js: cross-browser Listener-style event handling -// version 0.9, 18-Apr-2001 -// written by Andrew Clover <and@doxdesk.com>, use freely - -event_list= new Array(); - -event_level= 0; -if (document.implementation) - if (document.implementation.hasFeature('Events', '2.0')) - event_level= 2; - -function event_addListener(esource, etype, elistener) { - var i; - var alreadyTriggering= false; - for (i= 0; i<event_list.length; i++) { - if (event_list[i][0]==esource && event_list[i][1]==etype) { - if (event_list[i][2]==elistener) return; - alreadyTriggering= true; - } } - event_list[event_list.length]= new Array(esource, etype, elistener); - if (!alreadyTriggering) { - if (event_level==2) { - if (esource==window && !(esource.addEventListener)) - esource= document; // Opera 7.2 - esource.addEventListener(etype, event_trigger_DOM2, false); - } else { - eval(event_trigger_DOM0(etype)); - esource['on'+etype]= event_trigger; - if (esource.captureEvents) - esource.captureEvents('Event.'+etype.toUpperCase()); - } } -} - -function event_removeListener(esource, etype, elistener) { - var i; var e; - var j= 0; - var removedListener= false; - var keepTrigger= false; - for (i= 0; i<event_list.length; i++) { - if (event_list[i][0]==esource && event_list[i][1]==etype) { - if (event_list[i][2]==elistener) { - removedListener= true; - continue; - } - else keepTrigger= true; - } - if (i!=j) event_list[j]= event_list[i]; - j++; - } - event_list.length= j; - if (removedListener && !keepTrigger) { - if (event_level==2) - esource.removeEventListener(etype, elistener, true); - else - esource['on'+etype]= window.clientInformation ? null : window.undefined; - } -} - -function event_trigger_DOM2(e) { - if (event_dispatch(e.target, e.type)==false) - e.preventDefault(); -} - -function event_trigger_DOM0(t) { - return 'function event_trigger() {return event_dispatch(this, \''+t+'\');}'; -} - -function event_dispatch(esource, etype) { - var i; var r; - var elisteners= new Array(); - var result= window.undefined; - for (i= 0; i<event_list.length; i++) - if (event_list[i][0]==esource && event_list[i][1]==etype) - elisteners[elisteners.length]= event_list[i][2]; - for (i= 0; i<elisteners.length; i++) { - r= elisteners[i](esource, etype); - if (r+''!='undefined') result= r; - } - return result; -} - -// convenience prevent-default-action listener -function event_prevent(esource, etype) { return false; } - -// page finished loading detector for binding -var event_loaded= false; -function event_load(esource, etype) { - event_loaded= true; - event_removeListener(window, 'load', event_load); -} -event_addListener(window, 'load', event_load); - -// binding helper -var event_BINDDELAY= 750; -var event_binds= new Array(); - -function event_addBinding(btag, blistener) { - event_binds[event_binds.length]= new Array(btag, 0, blistener); - if (event_intervalling) - event_bind(); - else { - event_intervalling= true; - window.setTimeout(event_interval, 0); - } -} - -var event_intervalling= false; -function event_interval() { - event_bind(); - if (!event_loaded) - window.setTimeout(event_interval, event_BINDDELAY); -} - -function event_bind() { - var i, j, els, blistener; - for (i= event_binds.length; i-->0;) { - els= event_getElementsByTag(event_binds[i][0]); - blistener= event_binds[i][2]; - for (j= event_binds[i][1]; j<els.length; j++) - blistener(els[j]); - event_binds[i][1]= event_getElementsByTag(event_binds[i][0]).length; - } -} - -// get elements by tag name with backup for pre-DOM browsers -var event_NIL= new Array(); -function event_getElementsByTag(tag) { - if (document.getElementsByTagName) { - var arr= document.getElementsByTagName(tag); - // IE5.0/Win doesn't support '*' for all tags - if (tag!='*' || arr.length>0) return arr; - } - if (document.all) { - if (tag=='*') return event_array(document.all); - else return event_array(document.all.tags(tag)); - } - tag= tag.toLowerCase(); - if (tag=='a') return event_array(document.links); - if (tag=='img') return event_array(document.images); - if (tag=='form') return event_array(document.forms); - if (document.layers && tag=='div') return event_array(document.layers); - return event_NIL; -} -function event_array(coll) { - var arr= new Array(coll.length); - for (var i= arr.length; i-->0;) - arr[i]= coll[i]; - return arr; -}
\ No newline at end of file diff --git a/web/inc/favicon.ico b/web/inc/favicon.ico Binary files differdeleted file mode 100644 index e3b575a..0000000 --- a/web/inc/favicon.ico +++ /dev/null diff --git a/web/inc/fixed.js b/web/inc/fixed.js deleted file mode 100644 index 5382876..0000000 --- a/web/inc/fixed.js +++ /dev/null @@ -1,354 +0,0 @@ -// fixed.js: fix fixed positioning and fixed backgrounds in IE/Win -// version 1.8, 08-Aug-2003 -// written by Andrew Clover <and@doxdesk.com>, use freely - -/*@cc_on -@if (@_win32 && @_jscript_version>4) - -var fixed_positions= new Array(); -var fixed_backgrounds= new Array(); -var fixed_viewport; - -// Initialisation. Called when the <body> tag arrives. Set up viewport so the -// rest of the script knows we're going, and add a measurer div, used to detect -// font size changes and measure image sizes for backgrounds later - -function fixed_init() { - fixed_viewport= (document.compatMode=='CSS1Compat') ? - document.documentElement : document.body; - var el= document.createElement('div'); - el.setAttribute('id', 'fixed-measure'); - el.style.position= 'absolute'; - el.style.top= '0'; el.style.left= '0'; - el.style.overflow= 'hidden'; el.style.visibility= 'hidden'; - el.style.fontSize= 'xx-large'; el.style.height= '5em'; - el.style.setExpression('width', 'fixed_measureFont()'); - document.body.insertBefore(el, document.body.firstChild); -} - -// Binding. Called every time an element is added to the document, check it -// for fixed features, if found add to our lists and set initial props - -function fixed_bind(el) { - var needLayout= false; - var tag= el.tagName.toLowerCase(); - var st= el.style; - var cst= el.currentStyle; - var anc; - - // find fixed-position elements - if (cst.position=='fixed') { - needLayout= true; - fixed_positions[fixed_positions.length]= el; - // store original positioning as we'll overwrite it - st.position= 'absolute'; - st.fixedPLeft= cst.left; - st.fixedPTop= cst.top; - st.fixedPRight= cst.right; - st.fixedPBottom= cst.bottom; - st.fixedPWidth= fixed_parseLength(cst.width); - st.fixedPHeight= fixed_parseLength(cst.height); - // find element that will act as containing box, for convenience later - st.fixedCB= null; - for (anc= el; (anc= anc.parentElement).parentElement;) { - if (anc.currentStyle.position!='static') { - st.fixedCB= anc; - break; - } } - // detect nested fixed positioning (only ancestor need move) - st.fixedNest= false; - for (anc= el; anc= anc.parentElement;) { - if (anc.style.fixedNest!=null) - st.fixedNest= true; - break; - } - } - - // find fixed-background elements (not body/html which IE already gets right) - if (cst.backgroundAttachment=='fixed' && tag!='body' && tag!='html') { - needLayout= true; - fixed_backgrounds[fixed_backgrounds.length]= el; - // get background offset, converting from keyword if necessary - st.fixedBLeft= fixed_parseLength(cst.backgroundPositionX); - st.fixedBTop= fixed_parseLength(cst.backgroundPositionY); - // if it's a non-zero %age, need to know size of image for layout - if (st.fixedBLeft[1]=='%' || st.fixedBTop[1]=='%') { - st.fixedBWidth= 0; st.fixedBHeight= 0; - fixed_measureBack(el); - } - } - if (needLayout) fixed_layout(); -} - -// Layout. On every window or font size change, recalculate positioning - -// Request re-layout at next free moment -var fixed_delaying= false; -function fixed_delayout() { - if (fixed_delaying) return; - fixed_delaying= true; - window.setTimeout(fixed_layout, 0); -} - -var fixed_ARBITRARY= 200; - -function fixed_layout() { - fixed_delaying= false; - if (!fixed_viewport) return; - var i, el, st, j, pr, tmp, A= 'auto'; - var cb, cbLeft, cbTop, cbRight, cbBottom, oLeft, oTop, oRight, oBottom; - var vpWidth=fixed_viewport.clientWidth, vpHeight=fixed_viewport.clientHeight; - - // calculate initial position for fixed-position elements [black magic] - for (i= fixed_positions.length; i-->0;) { - el= fixed_positions[i]; st= el.style; - // find positioning of containing block - cb= st.fixedCB; if (!cb) cb= fixed_viewport; - cbLeft= fixed_pageLeft(cb); cbTop= fixed_pageTop(cb); - if (cb!=fixed_viewport) { cbLeft+= cb.clientLeft; cbTop+= cb.clientTop; } - cbRight= fixed_viewport.clientWidth-cbLeft-cb.clientWidth; - cbBottom= fixed_viewport.clientHeight-cbTop-cb.clientHeight; - // if size is in %, must recalculate relative to viewport - if (st.fixedPWidth[1]=='%') - st.width= Math.round(vpWidth*st.fixedPWidth[0]/100)+'px'; - if (st.fixedPHeight[1]=='%') - st.height= Math.round(vpHeight*st.fixedPHeight[0]/100)+'px'; - // find out offset values at max size, to account for margins - st.left= A; st.right= '0'; st.top= A; st.bottom= '0'; - oRight= el.offsetLeft+el.offsetWidth; oBottom= el.offsetTop+el.offsetHeight; - st.left= '0'; st.right= A; st.top= '0'; st.bottom= A; - oLeft= el.offsetLeft; oTop= el.offsetTop; - // use this to convert all edges to pixels - st.left= A; st.right= st.fixedPRight; - st.top= A; st.bottom= st.fixedPBottom; - oRight-= el.offsetLeft+el.offsetWidth; - oBottom-= el.offsetTop+el.offsetHeight; - st.left= st.fixedPLeft; st.top= st.fixedPTop; - oLeft= el.offsetLeft-oLeft; oTop= el.offsetTop-oTop; - // edge positioning fix - if (st.fixedPWidth[1]==A && st.fixedPLeft!=A && st.fixedPRight!=A) { - tmp= el.offsetLeft; st.left= A; st.width= fixed_ARBITRARY+'px'; - tmp= fixed_ARBITRARY+el.offsetLeft-tmp+cbLeft+cbRight; - st.left= st.fixedPLeft; st.width= ((tmp<1)?1:tmp)+'px'; - } - if (st.fixedPHeight[1]==A && st.fixedPTop!=A && st.fixedPBottom!=A) { - tmp= el.offsetTop; st.top= A; st.height= fixed_ARBITRARY+'px'; - tmp= fixed_ARBITRARY+el.offsetTop-tmp+cbTop+cbBottom; - st.top= st.fixedPTop; st.height= ((tmp<1)?1:tmp)+'px'; - } - // move all non-auto edges relative to the viewport - st.fixedCLeft= (st.fixedPLeft=='auto') ? oLeft : oLeft-cbLeft; - st.fixedCTop= (st.fixedPTop=='auto') ? oTop : oTop-cbTop; - st.fixedCRight= (st.fixedPRight=='auto') ? oRight : oRight-cbRight; - st.fixedCBottom= (st.fixedPBottom=='auto') ? oBottom : oBottom-cbBottom; - // remove left-positioning of right-positioned elements - if (st.fixedPLeft=='auto' && st.fixedPRight!='auto') st.fixedCLeft= 'auto'; - if (st.fixedPTop=='auto' && st.fixedPBottom!='auto') st.fixedCTop= 'auto'; - } - - - // calculate initial positioning of fixed backgrounds - for (i= fixed_backgrounds.length; i-->0;) { - el= fixed_backgrounds[i]; st= el.style; - tmp= st.fixedBImage; - if (tmp) { - if (tmp.readyState!='uninitialized') { - st.fixedBWidth= tmp.offsetWidth; - st.fixedBHeight= tmp.offsetHeight; - st.fixedBImage= window.undefined; - } - } - st.fixedBX= fixed_length(el, st.fixedBLeft, vpWidth-st.fixedBWidth); - st.fixedBY= fixed_length(el, st.fixedBTop, vpHeight-st.fixedBHeight); - } - - // now call scroll() to set the positions from the values just calculated - fixed_scroll(); -} - -// Scrolling. Offset fixed elements relative to viewport scrollness - -var fixed_lastX, fixed_lastY; -var fixed_PATCHDELAY= 300; -var fixed_patching= false; - -// callback function after a scroll, because incorrect scroll position is -// often reported first go! -function fixed_patch() { - fixed_patching= false; - var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop; - if (scrollX!=fixed_lastX && scrollY!=fixed_lastY) fixed_scroll(); -} - -function fixed_scroll() { - if (!fixed_viewport) return; - var i, el, st, viewportX, viewportY; - var scrollX= fixed_viewport.scrollLeft, scrollY= fixed_viewport.scrollTop; - fixed_lastX= scrollX; fixed_lastY= scrollY; - - // move non-nested fixed-position elements - for (i= fixed_positions.length; i-->0;) { - st= fixed_positions[i].style; - viewportX= (st.fixedNest) ? 0 : scrollX; - viewportY= (st.fixedNest) ? 0 : scrollY; - if (st.fixedCLeft!='auto') st.left= (st.fixedCLeft+viewportX)+'px'; - if (st.fixedCTop!='auto') st.top= (st.fixedCTop+viewportY)+'px'; - viewportX= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportX; - viewportY= (st.fixedCB==null || st.fixedCB==fixed_viewport) ? 0 : viewportY; - st.right= (st.fixedCRight-viewportX+1)+'px'; st.right= (st.fixedCRight-viewportX)+'px'; - st.bottom= (st.fixedCBottom-viewportY+1)+'px'; st.bottom= (st.fixedCBottom-viewportY)+'px'; - } - - // align fixed backgrounds to viewport - for (i= fixed_backgrounds.length; i-->0;) { - el= fixed_backgrounds[i]; st= el.style; - viewportX= scrollX; - viewportY= scrollY; - while (el.offsetParent) { - viewportX-= el.offsetLeft+el.clientLeft; - viewportY-= el.offsetTop +el.clientTop; - el= el.offsetParent; - } - st.backgroundPositionX= (st.fixedBX+viewportX)+'px'; - st.backgroundPositionY= (st.fixedBY+viewportY)+'px'; - } - - // call back again in a tic - if (!fixed_patching) { - fixed_patching= true; - window.setTimeout(fixed_patch, fixed_PATCHDELAY); - } -} - -// Measurement. Load bg-image into an invisible element on the page, when -// loaded write the width/height to an element's style for layout use; detect -// when font size changes - -function fixed_measureBack(el) { - var measure= document.getElementById('fixed-measure'); - var img= document.createElement('img'); - img.setAttribute('src', fixed_parseURL(el.currentStyle.backgroundImage)); - measure.appendChild(img); - el.style.fixedBImage= img; - if (img.readyState=='uninitialized') - img.attachEvent('onreadystatechange', fixed_measureBackImage_ready); -} - -function fixed_measureBackImage_ready() { - var img= event.srcElement; - if (img && img.readyState!='uninitialized') { - img.detachEvent('onreadystatechange', fixed_measureBackImage_ready); - fixed_layout(); - } -} - -var fixed_fontsize= 0; -function fixed_measureFont() { - var fs= document.getElementById('fixed-measure').offsetHeight; - if (fixed_fontsize!=fs && fixed_fontsize!=0) - fixed_delayout(); - fixed_fontsize= fs; - return '5em'; -} - -// Utility. General-purpose functions - -// parse url() to get value inside - -function fixed_parseURL(v) { - v= v.substring(4, v.length-1); - if (v.charAt(0)=='"' && v.charAt(v.length-1)=='"' || - v.charAt(0)=="'" && v.charAt(v.length-1)=="'") - return v.substring(1, v.length-1); - else return v; -} - -// parse length or auto or background-position keyword into number and unit - -var fixed_numberChars= '+-0123456789.'; -var fixed_ZERO= new Array(0, 'px'); -var fixed_50PC= new Array(50, '%'); -var fixed_100PC= new Array(100, '%'); -var fixed_AUTO= new Array(0, 'auto'); - -function fixed_parseLength(v) { - var num, i; - if (v=='left' || v=='top') return fixed_ZERO; - if (v=='right' || v=='bottom') return fixed_100PC; - if (v=='center') return fixed_50PC; - if (v=='auto') return fixed_AUTO; - i= 0; - while (i<v.length && fixed_numberChars.indexOf(v.charAt(i))!=-1) - i++; - num= parseFloat(v.substring(0, i)); - if (num==0) return fixed_ZERO; - else return new Array(num, v.substring(i)); -} - -// convert parsed (number, unit) into a number of pixels - -function fixed_length(el, l, full) { - var tmp, x; - if (l[1]=='px') return l[0]; - if (l[1]=='%') return Math.round(full*l[0]/100); - // other units - measure by setting position; this is rather inefficient - // but then these units are used for background-position so seldom... - tmp= el.currentStyle.left; - el.style.left= '0'; - x= el.offsetLeft; - el.style.left= l[0]+l[1]; - x= el.offsetLeft-x; - el.style.left= tmp; - return x; -} - -// convert stupid IE offsetLeft/Top to page-relative values - -function fixed_pageLeft(el) { - var v= 0; - while (el.offsetParent) { - v+= el.offsetLeft; - el= el.offsetParent; - } - return v; -} -function fixed_pageTop(el) { - var v= 0; - while (el.offsetParent) { - v+= el.offsetTop; - el= el.offsetParent; - } - return v; -} - -// Scanning. Check document every so often until it has finished loading. Do -// nothing until <body> arrives, then call main init. Pass any new elements -// found on each scan to be bound - -var fixed_SCANDELAY= 500; - -function fixed_scan() { - if (!document.body) return; - if (!fixed_viewport) fixed_init(); - var el; - for (var i= 0; i<document.all.length; i++) { - el= document.all[i]; - if (!el.fixed_bound) { - el.fixed_bound= true; - fixed_bind(el); - } } -} - -var fixed_scanner; -function fixed_stop() { - window.clearInterval(fixed_scanner); - fixed_scan(); -} - -fixed_scan(); -fixed_scanner= window.setInterval(fixed_scan, fixed_SCANDELAY); -window.attachEvent('onload', fixed_stop); -window.attachEvent('onresize', fixed_delayout); -window.attachEvent('onscroll', fixed_scroll); - -@end @*/ diff --git a/web/inc/html.inc b/web/inc/html.inc deleted file mode 100644 index d27aea6..0000000 --- a/web/inc/html.inc +++ /dev/null @@ -1,29 +0,0 @@ -<define-tag h1 whitespace=delete endtag=required> -<preserve subtitle /> -<set-var %attributes /> -{#H1#:<h1*>%body</h1*>:#H1#} -{#H1_FLAT#:<: $x = <<kjhasdflkjhasdf; -%body -kjhasdflkjhasdf -$x =~ s/\\n/ /g; print $x; :>:#H1_FLAT#} -<if <get-var title_is_set /> "" - {#Title#:{#H1_FLAT#}:#Title#} -/> -<restore subtitle /> -</define-tag> - -<define-tag title whitespace=delete endtag=required> -<set-var title_is_set=1/> -{#!Title#:<: $_ = <<kjhasdflkjhasdf; -%body -kjhasdflkjhasdf -s/\\n/ /g; print :>:#Title#} -</define-tag> - -<define-tag h2 whitespace=delete endtag=required> -<h2*>%body</h2*> -</define-tag> - -<define-tag h3 whitespace=delete endtag=required> -<h3*>%body</h3*> -</define-tag> diff --git a/web/inc/langset.inc b/web/inc/langset.inc deleted file mode 100644 index bd566d6..0000000 --- a/web/inc/langset.inc +++ /dev/null @@ -1,34 +0,0 @@ -# -# -# all definitions in the include rely on the existence of $LANG -# -# -############################################################################### -# define base languages of the document -############################################################################### -#use wml::std::lang -<set-var lntmp=<downcase "$(LANGS)" /> /> -<while <match <get-var lntmp /> "[a-z][a-z]" />> - <set-var lan=<match <get-var lntmp /> "[a-z][a-z]" action=extract /> /> - <set-var lntmp=<match <get-var lntmp /> "[a-z][a-z]" action=delete /> /> - <lang:new id=<get-var lan /> short /> -</while> - -############################################################################### -## creates .var file for automatic language selection -############################################################################### -[LANG_VAR: -URI: $(WML_SRC_BASENAME) -<set-var lntmp=<downcase "$(LANGS)" /> /> -<while <match <get-var lntmp /> "[a-z][a-z]" /> > - <set-var lan=<match <get-var lntmp /> "[a-z][a-z]" action=extract /> /> - <set-var lntmp=<match <get-var lntmp /> "[a-z][a-z]" action=delete /> /> -<protect></protect> -URI: $(WML_SRC_BASENAME).<get-var lan />.html -Content-type: text/html -Content-language: <get-var lan /> -</while> -<protect></protect> -URI: $(WML_SRC_BASENAME).en.html -Content-type: text/html -:LANG_VAR] diff --git a/web/inc/minmax.js b/web/inc/minmax.js deleted file mode 100644 index 7ebf1f5..0000000 --- a/web/inc/minmax.js +++ /dev/null @@ -1,144 +0,0 @@ -// minmax.js: make IE5+/Win support CSS min/max-width/height -// version 1.0, 08-Aug-2003 -// written by Andrew Clover <and@doxdesk.com>, use freely - -/*@cc_on -@if (@_win32 && @_jscript_version>4) - -var minmax_elements; - -minmax_props= new Array( - new Array('min-width', 'minWidth'), - new Array('max-width', 'maxWidth'), - new Array('min-height','minHeight'), - new Array('max-height','maxHeight') -); - -// Binding. Called on all new elements. If <body>, initialise; check all -// elements for minmax properties - -function minmax_bind(el) { - var i, em, ms; - var st= el.style, cs= el.currentStyle; - - if (minmax_elements==window.undefined) { - // initialise when body element has turned up, but only on IE - if (!document.body || !document.body.currentStyle) return; - minmax_elements= new Array(); - window.attachEvent('onresize', minmax_delayout); - // make font size listener - em= document.createElement('div'); - em.setAttribute('id', 'minmax_em'); - em.style.position= 'absolute'; em.style.visibility= 'hidden'; - em.style.fontSize= 'xx-large'; em.style.height= '5em'; - em.style.top='-5em'; em.style.left= '0'; - if (em.style.setExpression) { - em.style.setExpression('width', 'minmax_checkFont()'); - document.body.insertBefore(em, document.body.firstChild); - } - } - - // transform hyphenated properties the browser has not caught to camelCase - for (i= minmax_props.length; i-->0;) - if (cs[minmax_props[i][0]]) - st[minmax_props[i][1]]= cs[minmax_props[i][0]]; - // add element with properties to list, store optimal size values - for (i= minmax_props.length; i-->0;) { - ms= cs[minmax_props[i][1]]; - if (ms && ms!='auto' && ms!='none' && ms!='0' && ms!='') { - st.minmaxWidth= cs.width; st.minmaxHeight= cs.height; - minmax_elements[minmax_elements.length]= el; - // will need a layout later - minmax_delayout(); - break; - } } -} - -// check for font size changes - -var minmax_fontsize= 0; -function minmax_checkFont() { - var fs= document.getElementById('minmax_em').offsetHeight; - if (minmax_fontsize!=fs && minmax_fontsize!=0) - minmax_delayout(); - minmax_fontsize= fs; - return '5em'; -} - -// Layout. Called after window and font size-change. Go through elements we -// picked out earlier and set their size to the minimum, maximum and optimum, -// choosing whichever is appropriate - -// Request re-layout at next available moment -var minmax_delaying= false; -function minmax_delayout() { - if (minmax_delaying) return; - minmax_delaying= true; - window.setTimeout(minmax_layout, 0); -} - -function minmax_stopdelaying() { - minmax_delaying= false; -} - -function minmax_layout() { - window.setTimeout(minmax_stopdelaying, 100); - var i, el, st, cs, optimal, inrange; - for (i= minmax_elements.length; i-->0;) { - el= minmax_elements[i]; st= el.style; cs= el.currentStyle; - - // horizontal size bounding - st.width= st.minmaxWidth; optimal= el.offsetWidth; - inrange= true; - if (inrange && cs.minWidth && cs.minWidth!='0' && cs.minWidth!='auto' && cs.minWidth!='') { - st.width= cs.minWidth; - inrange= (el.offsetWidth<optimal); - } - if (inrange && cs.maxWidth && cs.maxWidth!='none' && cs.maxWidth!='auto' && cs.maxWidth!='') { - st.width= cs.maxWidth; - inrange= (el.offsetWidth>optimal); - } - if (inrange) st.width= st.minmaxWidth; - - // vertical size bounding - st.height= st.minmaxHeight; optimal= el.offsetHeight; - inrange= true; - if (inrange && cs.minHeight && cs.minHeight!='0' && cs.minHeight!='auto' && cs.minHeight!='') { - st.height= cs.minHeight; - inrange= (el.offsetHeight<optimal); - } - if (inrange && cs.maxHeight && cs.maxHeight!='none' && cs.maxHeight!='auto' && cs.maxHeight!='') { - st.height= cs.maxHeight; - inrange= (el.offsetHeight>optimal); - } - if (inrange) st.height= st.minmaxHeight; - } -} - -// Scanning. Check document every so often until it has finished loading. Do -// nothing until <body> arrives, then call main init. Pass any new elements -// found on each scan to be bound - -var minmax_SCANDELAY= 500; - -function minmax_scan() { - var el; - for (var i= 0; i<document.all.length; i++) { - el= document.all[i]; - if (!el.minmax_bound) { - el.minmax_bound= true; - minmax_bind(el); - } } -} - -var minmax_scanner; -function minmax_stop() { - window.clearInterval(minmax_scanner); - minmax_scan(); -} - -minmax_scan(); -minmax_scanner= window.setInterval(minmax_scan, minmax_SCANDELAY); -window.attachEvent('onload', minmax_stop); - -@end @*/ diff --git a/web/inc/navbar-def.inc b/web/inc/navbar-def.inc deleted file mode 100644 index 17a3ff8..0000000 --- a/web/inc/navbar-def.inc +++ /dev/null @@ -1,76 +0,0 @@ -# -# <ul> -# <li> -# <div><a href="../../index.de.html">Willkommen</a></div> -# </li> -# <li> -# <div><a href="../../events/index.de.html">Veranstaltungen</a></div> -# </li> -# <li> -# <div><a href="../../collegium/history.de.html">Das Collegium</a></div> -# </li> -# <li> -# <div class="selected_head"><a href="../../who/employee/index.de.html">Who is who</a></div> -# <ul> -# <li> -# <div><a href="../../who/employee/index.de.html">Mitarbeiter</a></div> -# </li> -# <li> -# <div class="selected">Fellows</div> -# <ul> -# <li> -# <div><a href="../../who/fellows/dalferth.de.html">Dalferth</a></div> -# </li> -# <li> -# <div><a href="../../who/fellows/fehr.de.html">Fehr</a></div> -# </li> -# </ul> -# </li> -# </ul> -# </li> -# </ul> -<define-tag nav:bar endtag=required> - <set-var __nav:level=%0 /> - <navbar:define name="%1" urlbase="$(ROOT)/%2"> - <navbar:header> - <ul*> - </navbar:header> - <navbar:footer> - </ul*> - </navbar:footer> - <navbar:prolog> - <li*><div*></navbar:prolog> - <navbar:epilog></div*></li*> - </navbar:epilog> - <navbar:prolog type="S"><li*><div* class="selected"></navbar:prolog> - <navbar:epilog type="S"></div></li*> - </navbar:epilog> - <navbar:filter> - <protect pass=2> - my ($mcode, $CFG, $select) = @_; - # have the top selected too - $mcode =~ s|<div>(.+?)</a><ul>|<div class="selected_head">$1</a></div><ul>|g; - $mcode =~ s|<div class="selected">([^<]+?)<ul>|<div class="selected">$1</div><ul>|g; - $mcode =~ s|</a><ul>|</a></div><ul>|g; - $mcode =~ s|</ul>\s*</div>\s*</li>|</ul></li>|g; - return $mcode; - </protect> - </navbar:filter> - %body - </navbar:define> -</define-tag> - -<define-tag nav:but> - <if <match "%2" "http://|html$|\?" /> - <navbar:button id="%0" - url="%2" - txt="%1" - menu="%3" - /> - <navbar:button id="%0" - url="%2.<lang:star: * />.html" - txt="%1 " - menu="%3" - /> - /> -</define-tag> diff --git a/web/inc/position.js b/web/inc/position.js deleted file mode 100644 index 7e95b67..0000000 --- a/web/inc/position.js +++ /dev/null @@ -1,118 +0,0 @@ -// position.js: make edge-positioning work on IE/Win -// version 0.5, 15-Jul-2003 -// written by Andrew Clover <and@doxdesk.com>, use freely - -/*@cc_on -@if (@_win32 && @_jscript_version>4) - -var position_h= new Array(); -var position_v= new Array(); -var position_viewport; -var position_width= 0; -var position_height= 0; -var position_fontsize= 0; -var position_ARBITRARY= 200; - -// Binding. Called on each new element; if the it's <body>, initialise script. -// Check all new elements to see if they need our help, make lists of them - -function position_bind(el) { - if (!position_viewport) { - if (!document.body) return; - // initialisation - position_viewport= (document.compatMode=='CSS1Compat') ? - document.documentElement : document.body; - window.attachEvent('onresize', position_delayout); - var em= document.createElement('div'); - em.setAttribute('id', 'position_em'); - em.style.position= 'absolute'; em.style.visibility= 'hidden'; - em.style.fontSize= 'xx-large'; em.style.height= '5em'; - em.style.top='-5em'; em.style.left= '0'; - em.style.setExpression('width', 'position_checkFont()'); - document.body.appendChild(em); - } - - // check for absolute edge-positioned elements (ignore ones from fixed.js!) - var st= el.style; var cs= el.currentStyle; - if (cs.position=='absolute' && !st.fixedPWidth) { - if (cs.left!='auto' && cs.right!='auto') { - position_h[position_h.length]= el; - st.position_width= position_ARBITRARY; - st.width= st.position_width+'px'; - position_delayout(); - } - if (cs.top!='auto' && cs.bottom!='auto') { - position_v[position_v.length]= el; - st.position_height= position_ARBITRARY; - st.height= st.position_height+'px'; - position_delayout(); - } } -} - -function position_checkFont() { position_delayout(); return '1em'; } - -// Layout. For each edge-positioned axis, measure difference between min-edge -// and max-edge positioning, set size to the difference - -// Request re-layout at next available moment -var position_delaying= false; -function position_delayout() { - if (position_delaying) return; - position_delaying= true; - window.setTimeout(position_layout, 0); -} - -function position_layout() { - position_delaying= false; - var i, el, st, pos, tmp; - var fs= document.all['position_em'].offsetWidth; - var newfs= (position_fontsize!=fs && position_fontsize!=0); - position_fontsize= fs; - - // horizontal axis - if (position_viewport.clientWidth!=position_width || newfs) { - position_width= position_viewport.clientWidth; - for (i= position_h.length; i-->0;) { - el= position_h[i]; st= el.style; cs= el.currentStyle; - pos= el.offsetLeft; tmp= cs.left; st.left= 'auto'; - st.position_width+= el.offsetLeft-pos; st.left= tmp; - if (st.position_width<1) st.position_width= 1; - st.width= st.position_width+'px'; - } } - // vertical axis - if (position_viewport.clientHeight!=position_height || newfs) { - position_height= position_viewport.clientHeight; - for (i= position_v.length; i-->0;) { - el= position_v[i]; st= el.style; cs= el.currentStyle; - pos= el.offsetTop; tmp= cs.top; st.top= 'auto'; - st.position_height+= el.offsetTop-pos; st.top= tmp; - if (st.position_height<1) st.position_height= 1; - st.height= st.position_height+'px'; - } } -} - -// Scanning. Check document every so often until it has finished loading. Do -// nothing until <body> arrives, then call main init. Pass any new elements -// found on each scan to be bound - -var position_SCANDELAY= 500; - -var position_nscanned= 0; -function position_scan() { - var nall= document.all.length; - for (var i= position_nscanned; i<nall; i++) - position_bind(document.all[i]); - position_nscanned= nall; -} - -var position_scanner; -function position_stop() { - window.clearInterval(position_scanner); - position_scan(); -} - -position_scan(); -position_scanner= window.setInterval(position_scan, position_SCANDELAY); -window.attachEvent('onload', position_stop); - -@end @*/ diff --git a/web/inc/silver-logo.png b/web/inc/silver-logo.png Binary files differdeleted file mode 100644 index 8759bac..0000000 --- a/web/inc/silver-logo.png +++ /dev/null diff --git a/web/inc/template.inc b/web/inc/template.inc deleted file mode 100644 index 842a68a..0000000 --- a/web/inc/template.inc +++ /dev/null @@ -1,177 +0,0 @@ -#this seems to confuse just too many things out there ... -#guess following the standard is not there yet -#<?xml version="1.0" encoding="iso-8859-15"?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -# this must be the very first line to make doc-type switching work on IE -#use wml::std::logo -#use wml::std::tags -#use wml::des::space -#use wml::des::imgdot -#use wml::std::grid -#use wml::fmt::url -#include <inc/langset.inc> -#include <inc/html.inc> -#include <inc/customtags.inc> -#use wml::des::navbar -#include <inc/navbar-def.inc> -#include <$(ROOT)/navbar.inc> -<html lang="<lang:star: * />" xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15" /> -<link* REL="icon" HREF="$(ROOT)/inc/favicon.ico" TYPE="image/ico" /> -..Title!>>MRTG - Page without a Title<<.. -<title*>MRTG - {#Title#}</title*> -<protect> -<!--[if lt IE 7]><script src="$(ROOT)/inc/IE7/ie7-standard-p.js" type="text/javascript"></script><![endif]--> -</protect> -<style type="text/css"> -<!--/* <![CDATA[ */ -/* ie5 for mac thinks this comment does not end here because of the backslash \*/ -@import url("$(ROOT)/design.css"); -/* ]]> */--> -</style> -{#ExtraHead#} -</head> -<body> -<div id="page_header"> -</div> - -<table id="main_container" cellspacing="0" cellpadding="0" border="0"> -<tr> -<!-- Navbar code start --> -<td valign="top" id="navbar_container"> -<div id="menu"> -<navbar:render name=main menumode=inner nohints txtonly select=$(PAGE)/> -</div> -<br/> -<br/> -<p><b>Gold Sponsors</b></p> -# From: Mark Hinkle <mrhinkle@zenoss.com> -# Date: Mon, 14 May 2007 14:43:09 -0400 -#<p><a href="http://www.zenoss.com/mrtg?utm_source=mrtg&utm_medium=logolink&utm_campaign=inbound"><img border="0" title="Zenoss Open Source IT Monitoring" alt="Zenoss Open Source IT Monitoring" src="$(ROOT)/logos/zenoss.png"/></a></p> -# maarten.vanlaere@serverscheck.com -# Date: Mon, 29 Jun 2009 00:40:35 +0200 -<p><a href="http://www.serverscheck.com/sensors?utm_source=mrtg&utm_medium=banner&utm_term=mrtg&utm_campaign=mrtg"><img border="0" title="Serverscheck" alt="Serverscheck" src="$(ROOT)/logos/mrtg_sensorgateway.png"/></a></p> - <p><a href="http://it.oetiker.ch/monitoring/sponsoring.var"><img border="0" alt="MRTG Gold Sponsor" src="$(ROOT)/inc/mrtg-gold.png"/></a></p> -<p><a href="$(ROOT)/sponsor.<lang:star: */>.html">Silver Sponsors ...</a></p> -<br/> -<br/> -<div> -<a href="http://tobi.oetiker.ch/wish/"><img border="0" alt="Make Tobi Happy" src="$(ROOT)/inc/happy-tobi.png"/></a> -</div> -<br/> -<br/> -<br/> -<div> -<iframe width="206" height="25" name="bandwidth" frameborder="0" src="$(ROOT)/hoster.html"></iframe> -</div> -<br/> -<br/> -<br/> -<div id="googlead_search"> -<!-- SiteSearch Google --> -<form method="get" action="http://www.google.com/custom" target="_top"> -<table border="0" bgcolor="#ffffff"> -<tr><td nowrap="nowrap" valign="top" align="left" height="32"> -<a href="http://www.google.com/"> -<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a> -<br/> -<input type="hidden" name="domains" value="oss.oetiker.ch"></input> -<input type="text" name="q" size="22" maxlength="255" value=""></input> -</td></tr> -<tr> -<td nowrap="nowrap"> -<table> -<tr> -<td> -<input type="radio" name="sitesearch" value="oss.oetiker.ch" checked="checked"></input> -<font size="-1" color="#000000">oss.oetiker.ch</font> -</td> -<td> -<input type="radio" name="sitesearch" value=""></input> -<font size="-1" color="#000000">Web</font> -</td> -</tr> -</table> -<input type="submit" name="sa" value="Search"></input> -<input type="hidden" name="client" value="pub-8135238818549668"></input> -<input type="hidden" name="forid" value="1"></input> -<input type="hidden" name="channel" value="1985457903"></input> -<input type="hidden" name="ie" value="ISO-8859-1"></input> -<input type="hidden" name="oe" value="ISO-8859-1"></input> -<input type="hidden" name="cof" value="GALT:#FE754D;GL:1;DIV:#345D98;VLC:345D98;AH:center;BGC:FFFFFF;LBGC:E4E4E4;ALC:345D98;LC:345D98;T:000000;GFNT:345D98;GIMP:345D98;LH:35;LW:100;L:http://oss.oetiker.ch/mrtg/images/mrtg_logo.gif;S:http://oss.oetiker.ch/mrtg;LP:1;FORID:1;"></input> -<input type="hidden" name="hl" value="en"></input> -</td></tr></table> -</form> -</div> -<!-- SiteSearch Google --> -</td> -<!-- Navbar code end --> - -<!-- Content code start --> -<td id="content_container"> -{#H1#} -{#Body#} -<p id="pageauthor"> -Last Update: <perl> -<protect pass=2> -use POSIX qw(strftime LC_TIME setlocale); -foreach my $l (qw($(LANGS))){ - my $lang = lc($l) eq 'de' ? 'de_CH' : $l; - $lang =~ s/^en.*/sv/i; - setlocale(LC_TIME,$lang); - my $year = strftime "%Y", localtime; - my $date = strftime "%x", localtime("$(WML_SRC_TIME)"); - q{$(AUTHOR)} =~ m{(.+\S+)\s*(<.+>|http://.+)} || die q{No Match for $(AUTHOR)}."\n"; - my $text=$1; my $url=$2; $url =~ s/<(\S+)(?:\@|_at_)(\S+)>/mailto:$1\@$2/; - my $LANG = uc("LANG_$l"); - print <<LINE -[$LANG:$date | <A HREF="$url">$text</A> | <A HREF="http://it.oetiker.ch/monitoring/">OETIKER+PARTNER AG</a>:$LANG] -LINE -} -</protect> -</perl> -</p> -</td> -</tr> -</table> - -<!-- content code end --> -<div class="orange_ruller"> </div> - -<!-- footer code start --> -<div id="page_footer"> -<table class="footer_splitter" cellspacing="0" cellpadding="0" border="0"> -<tr><td id="footer_logo"> -<img src="$(ROOT)/images/foot_logo.gif" alt="MRTG" /> -</td><td> -<small> -Web design by <a href="http://www.templatemonster.com" title=" Template Monster - Website Templates | Flash Templates | Web Templates Design">Template Monster</a> -</small> -</td></tr> -</table> -</div> - -<!-- footer code end --> -<hr class="legacy"/> -<p class="legacy" style="border-width: 1px; border-color: red; padding: 5px;"> -<en><b>NOTE:</b> The content of this website is accessible with any browser. The - graphical -design though relies completely on CSS2 styles. If you see this text, this means -that your browser does not support CSS2. Consider upgrading to a standard conformant -browser like Mozilla <a href="http://www.getfirefox.com">Firefox</a> or -<a href="http://www.opera.com">Opera</a> but also Apple's <a href="http://www.apple.com/safari/">Safari</a> -or KDE's <a href="http://www.konqueror.org">Konqueror</a> for example. It may also be that you -are looking at a mirror page which did not copy <a href="$(ROOT)/design.css">the CSS</a> for this page. Or if some pictures -are missing, then the mirror may not have picked up the contents of either the <a href="$(ROOT)/images/">images</a> or the <a href="$(ROOT)/inc/">inc</a> directory.</en> -#<de><b>HINWEIS:</b> Diese Website funktioniert mit jedem Browser. Die graphische Präsentation jedoch -#basiert komplett auf CSS2. Beispiele für CSS2 konforme Browser sind zum Beispiel <a href="http://www.getfirefox.com">Firefox</a> -#<a href="http://www.opera.com">Opera</a> oder auch <a href="http://www.apple.com/safari/">Safari</a> von Apple und -#<a href="http://www.konqueror.org">Konqueror</a> aus dem KDE Projekt. -#</de> -</p> -</body> -</html> - -# All the rest goes into Body -..Body>> diff --git a/web/inc/trac.css b/web/inc/trac.css deleted file mode 100644 index bddcfb7..0000000 --- a/web/inc/trac.css +++ /dev/null @@ -1,43 +0,0 @@ -@import url(/mrtg/design.css); - -body, th, td { - font-family: sans-serif; -} - -#navbar_container a { - border-style: none; -} - -#navbar_container a:hover { - background-color: inherit; -} - -div#header { - display:none; -} - -div#banner { - position:absolute; - top: 105px; - left: 0px; - width: 100%; - max-width: 80em; - padding-right: 70px; -} - -#content_container h1 { - margin-top: 10px; - margin-right: 0px; -} - -#pagepath { - font-size: 10px; -} - -#pagepath .pathentry { - float: left; -} - -#pagepath *:link, #pagepath *:visited { - margin: 0 0.2em; -} diff --git a/web/index.wml b/web/index.wml deleted file mode 100644 index 39573b1..0000000 --- a/web/index.wml +++ /dev/null @@ -1,74 +0,0 @@ -<PAGE AUTHOR = "Tobi Oetiker <tobi@oetiker.ch>" - PAGE = "welcome"> - -{#ExtraHead#: -<meta property="og:title" content="MRTG - The Multi Router Traffic Grapher"/> -<meta property="og:type" content="product"/> -<meta property="og:image" content="http://oss.oetiker.ch/mrtg/fb-logo.png"/> -<meta property="og:url" content="http://www.mrtg.org/"/> -<meta property="og:site_name" content="MRTG"/> -<meta property="fb:admins" content="706717092"/> -<meta property="og:description" content="MRTG allows you to monitor traffic on a wide variety of network devices"/> -:##} - -<H1>Tobi Oetiker's MRTG - The Multi Router Traffic Grapher</H1> - - -<H2>What it does</H2> - -#<div style="overflow:auto"> -#<div style="float:right"> -#<a href="http://www.usenix.org/lisa08/promote"> <img src="http://www.usenix.org/events/lisa08/art/lisa08_button.jpg" border="0" width="125" height="125" alt="LISA '08"/> </a> -#</div> - -<p>You have a router, you want to know what it does all day long? Then MRTG -is for you. It will monitor SNMP network devices and draw <a -href="http://www.switch.ch/network/operation/statistics/geant2.html">pretty pictures</a> -showing how much traffic has passed through each interface.</p> - -<p>Routers are only the beginning. MRTG is being used to graph all sorts of -network devices as well as everything else from weather data to vending -machines.</p> - -<p>MRTG is written in perl and works on Unix/Linux as well as Windows and -even Netware systems. MRTG is free software licensed under the Gnu GPL.</p> -</div> - -<fb:like href="http://www.mrtg.org/" show_faces="false" width="300"></fb:like> - -<p> -<img src="192.33.92.249_fa4_1-day.png" -alt="Sample Graph" /></p> - -<h2>News</h2> - -<div style="overflow:auto"> -<div style="float:left;margin-right: 10px"><a href="http://www.steveshipway.org/book/"><img src="mrtgbook.jpg" border="0" alt="MRTG Book"/></a></div> -<div>Steve Shipway has written a book on MRTG. If you have been looking for -something more than the documentation included with MRTG, this might be just -what you have been waiting for. Steve is publishing the book via Lulu, so -you can get an actual printed and bound copy. Check out <a -href="http://www.steveshipway.org/book/">Steve's Website</a> for more -information.</div> -</div> - -<H2 clear="left">Download</H2> - -<P>MRTG is free software. Just <A HREF="download.en.html">download</A> it -and -follow the install instructions for <a HREF="doc/mrtg-unix-guide.en.html">Unix/Linux</a> -or <a HREF="doc/mrtg-nt-guide.en.html">Windows</a> or <a -HREF="doc/mrtg-nw-guide.en.html">NetWare</a> to get get started.</P> - -<p>If you run into trouble, check out <a href="support/">support</a> -options.</p> - - - -<H2>Sponsorship and Appreciation</H2> - -<P>You like MRTG? You want to encourage me to spend my time, working on -it? You want me to implement a custom feature? Check out the <A -HREF="sponsor.en.html">sponsorship</a> page.</P> - -<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> diff --git a/web/license.wml b/web/license.wml deleted file mode 100644 index 188a56e..0000000 --- a/web/license.wml +++ /dev/null @@ -1,20 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "license"> - -<H1>License</H1> - -<H2>GNU General Public License</H2> - -<P>MRTG is available under the terms of the <A -HREF="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</A>. -This means you can do most things you want with this software as long as you -do not claim you created the software and don't sell it (or modified version -of it) under a license other than the GNU GPL.</P> - -<H2>Give Credit</H2> - -<P>One of the things I get out of MRTG is 'Being Known in the Industry'. -This only works if you give credit. This means that you -mention MRTG on webpages and other publications containing graphs -created with MRTG. If possible, a link should be included in the -publication, pointing to the MRTG homepage.</p> diff --git a/web/logos/kanetix.png b/web/logos/kanetix.png Binary files differdeleted file mode 100644 index 9c16aa8..0000000 --- a/web/logos/kanetix.png +++ /dev/null diff --git a/web/logos/logo_plixer_blue101x51.gif b/web/logos/logo_plixer_blue101x51.gif Binary files differdeleted file mode 100644 index 88de46b..0000000 --- a/web/logos/logo_plixer_blue101x51.gif +++ /dev/null diff --git a/web/logos/mrtg_sensorgateway.png b/web/logos/mrtg_sensorgateway.png Binary files differdeleted file mode 100644 index 8bdf18f..0000000 --- a/web/logos/mrtg_sensorgateway.png +++ /dev/null diff --git a/web/logos/nagios.png b/web/logos/nagios.png Binary files differdeleted file mode 100644 index 7a9929c..0000000 --- a/web/logos/nagios.png +++ /dev/null diff --git a/web/logos/opennmscolorgroup.png b/web/logos/opennmscolorgroup.png Binary files differdeleted file mode 100644 index 7abf57b..0000000 --- a/web/logos/opennmscolorgroup.png +++ /dev/null diff --git a/web/logos/poweradmin_server_monitor.png b/web/logos/poweradmin_server_monitor.png Binary files differdeleted file mode 100644 index 2880ba4..0000000 --- a/web/logos/poweradmin_server_monitor.png +++ /dev/null diff --git a/web/logos/psw.jpg b/web/logos/psw.jpg Binary files differdeleted file mode 100644 index 91d4d1a..0000000 --- a/web/logos/psw.jpg +++ /dev/null diff --git a/web/logos/serverscheck.png b/web/logos/serverscheck.png Binary files differdeleted file mode 100644 index 3426025..0000000 --- a/web/logos/serverscheck.png +++ /dev/null diff --git a/web/logos/terreactive.png b/web/logos/terreactive.png Binary files differdeleted file mode 100644 index 9d5e6c8..0000000 --- a/web/logos/terreactive.png +++ /dev/null diff --git a/web/logos/zenoss.png b/web/logos/zenoss.png Binary files differdeleted file mode 100644 index c66039f..0000000 --- a/web/logos/zenoss.png +++ /dev/null diff --git a/web/mirror.html b/web/mirror.html deleted file mode 100644 index f6b0c32..0000000 --- a/web/mirror.html +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -export PATH=/usr/bin:/bin -echo Content-Type: text/html -echo -cat <<HEAD -<html> -<head> -<title>website mirror instructions</title> -</head> -<h1>MRTG Mirror Source</h1> -<p>Run the following commands once a day.</p> -<pre> -#!/bin/sh -cd /YOUR/MIRROR/TREE -wget --no-host-directories --timestamping --recursive --level=1 http://oss.oetiker.ch/mrtg/mirror.html -</pre> - -<p>Create a file called <b>hoster.html</b> like that:</p> -<pre> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -<head> -<style type="text/css"> -body { - margin: 0px; - padding: 0px; - background-color: #909090; - font-family: sans-serif; - font-size: 10px; -} - -#hoster a { - color: black; - text-decoration: none; -} -</style> -</head> -<body> -<div id="hoster"> -mirror by <a target="_top" href="http://YOUR.SITE">Company</a> -</div> -</body> -</html> -</pre> - -HEAD - -( for xt in html png jpg gif ico css js gz txt zip patch pgp md5 pdf CHANGES; do - find . \( -name "*$xt" -not -name "stat*" -not -name "hoster*" \) -exec printf '<a href="{}">.</a>\n' \; | grep -v /.svn |egrep -v 'pub/.*html' - done ) | sort -u - -echo "</body></html>" diff --git a/web/mrtg-l.gif b/web/mrtg-l.gif Binary files differdeleted file mode 100644 index 733ac06..0000000 --- a/web/mrtg-l.gif +++ /dev/null diff --git a/web/mrtg-l.png b/web/mrtg-l.png Binary files differdeleted file mode 100644 index fc0b967..0000000 --- a/web/mrtg-l.png +++ /dev/null diff --git a/web/mrtg-m.gif b/web/mrtg-m.gif Binary files differdeleted file mode 100644 index bc78d5c..0000000 --- a/web/mrtg-m.gif +++ /dev/null diff --git a/web/mrtg-m.png b/web/mrtg-m.png Binary files differdeleted file mode 100644 index 743e495..0000000 --- a/web/mrtg-m.png +++ /dev/null diff --git a/web/mrtg-r.gif b/web/mrtg-r.gif Binary files differdeleted file mode 100644 index 2022c7b..0000000 --- a/web/mrtg-r.gif +++ /dev/null diff --git a/web/mrtg-r.png b/web/mrtg-r.png Binary files differdeleted file mode 100644 index 5fbbd45..0000000 --- a/web/mrtg-r.png +++ /dev/null diff --git a/web/mrtgbook.jpg b/web/mrtgbook.jpg Binary files differdeleted file mode 100644 index 891bf58..0000000 --- a/web/mrtgbook.jpg +++ /dev/null diff --git a/web/nabble-mrtg.wml b/web/nabble-mrtg.wml deleted file mode 100644 index 8484253..0000000 --- a/web/nabble-mrtg.wml +++ /dev/null @@ -1,8 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "nable"> -<title>MRTG Mailinglists</title> -{#H1#: -<a id="nabblelink" href="http://mrtg-mailinglists.795376.n2.nabble.com/">MRTG Mailinglists</a> -<script src="http://mrtg-mailinglists.795376.n2.nabble.com/embed/f795376"></script> -:#H1#} - diff --git a/web/navbar.inc b/web/navbar.inc deleted file mode 100644 index 4d0b039..0000000 --- a/web/navbar.inc +++ /dev/null @@ -1,19 +0,0 @@ -<nav:bar 0 main ""> - <nav:but welcome "Welcome" index /> - <nav:but down "Download" download /> - <nav:but license "License" license /> - <nav:but demo "Demo" http://www.six.sk/mrtg/aggregated.html /> - <nav:but doc "Documentation" doc/index doc /> - <nav:but 3party "3rd Party Docs" 3party /> - <nav:but doc_mrtg-forum "Support" support/index forum /> - <nav:but trac "Bug Reports, Wiki" http://oss.oetiker.ch/mrtg-trac/ /> - <nav:but sponsor "Project Sponsors" sponsor /> - <nav:but cast "Cast" cast/index /> -</nav:bar> - -<nav:bar 1 doc "doc/"> -#include "doc/navbar.inc" -</nav:bar> -<nav:bar 1 forum "./"> - <nav:but nable "MRTG Web Forum" nabble-mrtg /> -</nav:bar> diff --git a/web/site-sync b/web/site-sync deleted file mode 100755 index b3c90c4..0000000 --- a/web/site-sync +++ /dev/null @@ -1 +0,0 @@ -rsync --exclude="bin/lib/**" --copy-unsafe-links --verbose --times --delete --exclude pub --exclude='*~' --exclude=".svn" --exclude=".condor" -r . oposs@freddie:public_html/mrtg diff --git a/web/snmpv1-is-too-slow.png b/web/snmpv1-is-too-slow.png Binary files differdeleted file mode 100644 index b3d98df..0000000 --- a/web/snmpv1-is-too-slow.png +++ /dev/null diff --git a/web/sponsor.wml b/web/sponsor.wml deleted file mode 100644 index de4dfbd..0000000 --- a/web/sponsor.wml +++ /dev/null @@ -1,68 +0,0 @@ -<PAGE AUTHOR = "Tobias Oetiker <tobi@oetiker.ch>" - PAGE = "sponsor"> - - -<h1>Sponsorship</h1> - -<p>These days I finance my work on MRTG by developing <a -href="http://it.oetiker.ch/monitoring/support.var">customer specific add-on -features and support contracts</a>. Since this work is focused towards the -customers requirements this does not leave much room for general improvement. -If you profit from MRTG and want to support the project as a whole, you -could <a href="http://it.oetiker.ch/monitoring/sponsoring.var">become a -sponsor</a>!</p> - -<h2>2012 Gold Sponsors</h2> - -<p>you?</p> - -<h2>2012 Silver Sponsors</h2> -# Tarus Balog <tarus@opennms.org> rt#14393 -<a href="http://www.opennms.org"><img border="0" title="openNMS" alt="openNMS" src="$(ROOT)/logos/opennmscolorgroup.png"/></a> -# Ethan Galstad <egalstad@nagios.com> Tue, 28 Sep 2010 23:18:27 +0200 -<a href="http://www.nagios.com"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/nagios.png"/></a> -# christian@heutger.net -<a href="http://www.psw.net"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/psw.jpg"/></a> - -<h2>2011 Gold Sponsors</h2> - -<p> -#maarten.vanlaere@serverscheck.com -<a href="http://www.serverscheck.com/sensors/sensorgateway_availability.asp"><img border="0" title="ServersCheck" alt="ServersCheck" src="$(ROOT)/logos/mrtg_sensorgateway.png"/></a> -#Erik A. Dahl <edahl@zenoss.org> -#<a href="http://www.zenoss.com/?mrtg"><img border="0" title="Zenoss Open Source IT Monitoring" alt="Zenoss Open Source IT Monitoring" src="$(ROOT)/logos/zenoss.png"/></a> -</p> - -<h2>2011 Silver Sponsors</h2> - -<p> -# Ethan Galstad <egalstad@nagios.com> Tue, 28 Sep 2010 23:18:27 +0200 -<a href="http://www.nagios.com"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/nagios.png"/></a> -# Dan Munteanu <dmunte@kanetix.com> -<a href="http://www.kanetix.ca/"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/kanetix.png"/></a> -# Michael Patterson <mike@plixer.com> Mon, 29 Oct 2007 15:13:31 -0400 -<a href="http://www.plixer.com"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/logo_plixer_blue101x51.gif"/></a> -# christian@heutger.net -<a href="http://www.psw.net"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/psw.jpg"/></a> -# Doug Nebeker <doug@poweradmin.com> -<a href="http://www.poweradmin.com/servermonitor/?ref=mrtg"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/poweradmin_server_monitor.png"/></a> -<a href="http://it.oetiker.ch/monitoring/sponsoring.var"><img border="0" alt="Silver Sponsor" src="$(ROOT)/inc/silver-logo.png"/></a> -</p> - -#<h2>2010 Silver Sponsors</h2> - -#<p> -# Michael Patterson <mike@plixer.com> Mon, 29 Oct 2007 15:13:31 -0400 -#<a href="http://www.plixer.com"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/logo_plixer_blue101x51.gif"/></a> -# Ethan Galstad <egalstad@nagios.com> Tue, 28 Sep 2010 23:18:27 +0200 -#<a href="http://www.nagios.com"><img border="0" alt="Silver Sponsor" src="$(ROOT)/logos/nagios.png"/></a> -#</p> - - -<h2>Other means for making Tobi happy</h2> - -<p>If you like MRTG and want to show me your appreciation personally, have a look -at my <a HREF="http://tobi.oetiker.ch/wish">media wishlist</a>. -Please put your <b>eMail</b> address into the the message area, so that I -can thank you for your present. I do keep a list of people who sent me -stuff. You can look at it <a href="http://tobi.oetiker.ch/webtools/appreciators.txt">here</a>.</p> diff --git a/web/support/build.sh b/web/support/build.sh deleted file mode 100755 index 67459d0..0000000 --- a/web/support/build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -sect=doc -src=/home/oetiker/checkouts/mrtg/src/ -. ../bin/pod2wml.sh - -pod2descr() { - pod=$1.pod - descr=`egrep "$1 *- " $pod|head -1|sed 's/.*- //'` - menu=`egrep "$1 *- " $pod|head -1|sed 's/ -.*//'` -} - - -# build probe list -rm -f navbar.inc -rm -f index.inc - -for pod in mrtg-forum.pod; do - base=`echo $pod |sed 's,.pod,,'` - echo $base - cat $src/doc/$pod > $base.pod - pod2descr $base - pod2wml $base -done - -mv mrtg-forum.wml index.wml diff --git a/web/support/index.inc b/web/support/index.inc deleted file mode 100644 index ab36c86..0000000 --- a/web/support/index.inc +++ /dev/null @@ -1,2 +0,0 @@ -<dt><a href="mrtg-forum.en.html">mrtg-forum</a></dt><dd>Interactive Help for MRTG users -</dd> diff --git a/web/support/index.wml b/web/support/index.wml deleted file mode 100644 index 3210498..0000000 --- a/web/support/index.wml +++ /dev/null @@ -1,154 +0,0 @@ -<page page="doc_mrtg-forum" -author="Tobias Oetiker <tobi@oetiker.ch>"/> -<?xml version="1.0" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title></title> -<meta http-equiv="content-type" content="text/html; charset=utf-8" /> -<link rev="made" href="mailto:root@localhost" /> -</head> - -<body> - - - -<ul id="index"> - <li><a href="#NAME">NAME</a></li> - <li><a href="#SYNOPSIS">SYNOPSIS</a></li> - <li><a href="#MAILING-LIST">MAILING-LIST</a> - <ul> - <li><a href="#THE-RULES">THE RULES</a></li> - <li><a href="#SUBSCRIBING">SUBSCRIBING</a></li> - </ul> - </li> - <li><a href="#NEWSGROUP">NEWSGROUP</a></li> - <li><a href="#IRC-Channel">IRC Channel</a></li> - <li><a href="#MRTG-Japan">MRTG Japan</a></li> - <li><a href="#AUTHOR">AUTHOR</a></li> -</ul> - -<h1 id="NAME">NAME</h1> - -<p>mrtg-forum - Interactive Help for MRTG users</p> - -<h1 id="SYNOPSIS">SYNOPSIS</h1> - -<p>There is a lot of written documentation for mrtg, but nevertheless you may have a problem where you can't find the solution. In this case some Human Help may be necessary. With MRTG there are several ways to get Humans to help you.</p> - -<h1 id="MAILING-LIST">MAILING-LIST</h1> - -<p>There are three mailing lists for MRTG available.</p> - -<dl> - -<dt id="mrtg">mrtg</dt> -<dd> - -<p>for discussion among mrtg users.</p> - -</dd> -<dt id="mrtg-announce">mrtg-announce</dt> -<dd> - -<p>for announcements regarding new versions of mrtg related software.</p> - -</dd> -<dt id="mrtg-developers">mrtg-developers</dt> -<dd> - -<p>for discussion among people who write software in connection with mrtg or who hack mrtg itself.</p> - -</dd> -</dl> - -<h2 id="THE-RULES">THE RULES</h2> - -<p>Please note that the memebers of the mrtg mailinglist value politeness highly. This means behave in a way you would like others to behave towards you.</p> - -<ul> - -<li><p>No shouting. (NO CAPS)</p> - -</li> -<li><p>No rude language</p> - -</li> -<li><p>No demands. everybody is on the list out of their own free will. If you do not get an answer to your question, chances are high that you did not give sufficent details about the nature of your problem or that the answer to your problem is in the documentation.</p> - -</li> -<li><p>If you do not follow the rules you will be unsubscribed from the list with no further questions asked.</p> - -</li> -<li><p>Decisions about your unsubscription from the list will be taken by</p> - -<protect><pre><code> Alex van den Bogaerdt <alex at ergens.op.het.net> - Paul C. Williamson <pwilliamson at MANDTBANK.COM></code></pre></protect> - -<p>If you feel that you have been treated unfairly, you may send mail to me and explain the situation.</p> - -<protect><pre><code> Tobi Oetiker <tobi@oetiker.ch></code></pre></protect> - -</li> -</ul> - -<h2 id="SUBSCRIBING">SUBSCRIBING</h2> - -<p>These lists are managed by a mailing-list management program (listar). It allows you to subscribe to these lists by sending a message with the subject: <b>subscribe</b> to the following address:</p> - -<protect><pre><code> listname-request@lists.oetiker.ch</code></pre></protect> - -<p>You will then get a message asking you to confirm your subscription.</p> - -<p>For posting to the lists use the following address</p> - -<protect><pre><code> listname@lists.oetiker.ch</code></pre></protect> - -<p>Note that only people who are subscribed to the list can post.</p> - -<p>Further information about the usage of the mailing lists is available by sending a message with the subject line <b>help</b> to either one of the request addresses.</p> - -<p>There is also a webinterface to the lists on</p> - -<protect><pre><code> http://lists.oetiker.ch</code></pre></protect> - -<p>List archives are on</p> - -<protect><pre><code> http://www.mail-archive.com/index.php?hunt=mrtg</code></pre></protect> - -<p>and</p> - -<protect><pre><code> http://gmane.org/find.php?list=mrtg</code></pre></protect> - -<h1 id="NEWSGROUP">NEWSGROUP</h1> - -<p>For discussion of MRTG or related topics on the Usenet, please send your posts to:</p> - -<protect><pre><code> news:comp.dcom.net-management</code></pre></protect> - -<p>Many MRTG users are in this forum and will help you. You can also find an archive of past activity from this Newsgroup on:</p> - -<protect><pre><code> http://groups.google.com/group/comp.dcom.net-management</code></pre></protect> - -<h1 id="IRC-Channel">IRC Channel</h1> - -<p>For discussion of MRTG and related topics on IRC, the `#mrtg' channel on EFNet has been created.</p> - -<p>More information can be found at</p> - -<protect><pre><code> http://mrtg.easymac.org</code></pre></protect> - -<h1 id="MRTG-Japan">MRTG Japan</h1> - -<p>There is a special Mailinglist for MRTG Users in Japan. It carries translations of the traffic from MRTG-ANNOUNCE as well as updates on the Japanese Translation of the MRTG documentation. Go to http://www.mrtg.jp/ for further Information.</p> - -<h1 id="AUTHOR">AUTHOR</h1> - -<p>Tobias Oetiker <tobi@oetiker.ch> and many contributors</p> - - -</body> - -</html> - - diff --git a/web/support/navbar.inc b/web/support/navbar.inc deleted file mode 100644 index cb13af8..0000000 --- a/web/support/navbar.inc +++ /dev/null @@ -1 +0,0 @@ -<nav:but doc_mrtg-forum "mrtg-forum" mrtg-forum/> diff --git a/web/trac.wml b/web/trac.wml deleted file mode 100644 index 89a1b27..0000000 --- a/web/trac.wml +++ /dev/null @@ -1,4 +0,0 @@ -<PAGE AUTHOR = "Tobi Oetiker <tobi@oetiker.ch>" - PAGE = "trac"> - -__TRAC__ |
