home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _a1ddb161aa2b898d204e203dbdbdd827 < prev    next >
Encoding:
Text File  |  2004-06-01  |  11.4 KB  |  325 lines

  1. package ActivePerl::DocTools::TOC::RDF;
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. use base ('ActivePerl::DocTools::TOC');
  7.  
  8. my $_section=1; #section identifier
  9. my $_subsection=0;
  10.  
  11. # constructs the simpler methods
  12. sub text {
  13.     my ($text) =  join '', map { "$_\n" } @_;
  14.     return sub { $text };
  15. }
  16.  
  17. #my @begin_subhead = ("<nc:subheadings>","<rdf:Seq>");
  18. my @begin_subhead = (" ");
  19.  
  20. #*end_subhead = text("</rdf:Seq>","</nc:subheadings>");
  21. #*end_subhead = text("    </rdf:Seq>", "  </nc:subheadings>", "</rdf:Description>");
  22. *end_subhead = text (" ");
  23.  
  24. *boilerplate = text(<<HERE);
  25. <?xml version="1.0"?>
  26.  
  27. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  28.          xmlns:nc="http://home.netscape.com/NC-rdf#"
  29.          xmlns:kc="http://www.activestate.com/KC-rdf#">
  30.  
  31.   <rdf:Description about="urn:root">
  32.     <nc:subheadings>
  33.       <rdf:Seq>
  34.         <rdf:li>
  35.           <rdf:Description ID="ActivePerl-doc-top" nc:name="ActivePerl Documentation" nc:link="ActivePerl/perlmain.html">
  36.             <nc:subheadings>
  37.               <rdf:Seq>
  38.                 <rdf:li>
  39.                   <rdf:Description ID="ActivePerl-GS" nc:name="Getting Started"/>
  40.                   <rdf:Description ID="ActivePerl-IN" nc:name="Install Notes"/>
  41.                   <rdf:Description ID="ActivePerl-AC" nc:name="ActivePerl Components"/>
  42.                   <rdf:Description ID="ActivePerl-AF" nc:name="ActivePerl FAQ"/>
  43.                   <rdf:Description ID="ActivePerl-WS" nc:name="Windows Scripting"/>
  44.                   <rdf:Description ID="ActivePerl-1" nc:name="Core Perl"/>
  45.                   <rdf:Description ID="ActivePerl-2" nc:name="Programs"/>
  46.                   <rdf:Description ID="ActivePerl-3" nc:name="Pragmas"/>
  47.                   <rdf:Description ID="ActivePerl-4" nc:name="Libraries"/>
  48.                 </rdf:li>
  49.               </rdf:Seq>
  50.             </nc:subheadings>
  51.         </rdf:Description>
  52.         </rdf:li>
  53.       </rdf:Seq>
  54.     </nc:subheadings>
  55.   </rdf:Description>
  56.  
  57.   <rdf:Description about="#ActivePerl-GS" nc:name="Getting Started">
  58.     <nc:subheadings>
  59.       <rdf:Seq>
  60.         <rdf:li>
  61.           <rdf:Description nc:name="Welcome To ActivePerl" nc:link="ActivePerl/perlmain.html"/>
  62.           <rdf:Description nc:name="Release Notes" nc:link="ActivePerl/RELEASE.html"/>
  63.           <rdf:Description nc:name="Readme" nc:link="ActivePerl/readme.html"/>
  64.           <rdf:Description nc:name="ActivePerl Change Log" nc:link="ActivePerl/CHANGES.html"/>
  65.         </rdf:li>
  66.       </rdf:Seq>
  67.     </nc:subheadings>
  68.   </rdf:Description>
  69.  
  70.   <rdf:Description about="#ActivePerl-IN" nc:name="Install Notes">
  71.     <nc:subheadings>
  72.       <rdf:Seq>
  73.         <rdf:li>
  74.           <rdf:Description nc:name="Linux" nc:link="ActivePerl/faq/Linux/Install.html"/>
  75.           <rdf:Description nc:name="Solaris" nc:link="ActivePerl/faq/Solaris/Install.html"/>
  76.           <rdf:Description nc:name="Windows" nc:link="ActivePerl/faq/Windows/Install.html"/>
  77.         </rdf:li>
  78.       </rdf:Seq>
  79.     </nc:subheadings>
  80.   </rdf:Description>
  81.  
  82.   <rdf:Description about="#ActivePerl-AF" nc:name="ActivePerl FAQ">
  83.     <nc:subheadings>
  84.       <rdf:Seq>
  85.         <rdf:li>
  86.           <rdf:Description nc:name="Introduction" nc:link="ActivePerl/faq/ActivePerl-faq.html"/>
  87.           <rdf:Description nc:name="Availability & Install" nc:link="ActivePerl/faq/ActivePerl-faq1.html"/>
  88.           <rdf:Description nc:name="Availability & Install" nc:link="ActivePerl/faq/ActivePerl-faq1.html"/>
  89.           <rdf:Description nc:name="Using PPM" nc:link="ActivePerl/faq/ActivePerl-faq2.html"/>
  90.           <rdf:Description nc:name="Docs & Support" nc:link="ActivePerl/faq/ActivePerl-faq3.html"/>
  91.         </rdf:li>
  92.       </rdf:Seq>
  93.     </nc:subheadings>
  94.   </rdf:Description>
  95.  
  96. HERE
  97.  
  98. *header = text(<<HEAR);
  99.  
  100. HEAR
  101.  
  102.  
  103. # *before_pods = text("<!-- Core Perl Documentation -->",@begin_subhead);
  104. sub before_pods {
  105.     my ($self, $file) = @_;
  106.  
  107.     return
  108.     "  <rdf:Description about=\"#ActivePerl-$_section\">\n".
  109.     "    <nc:subheadings>\n".
  110.     "      <rdf:Seq>\n";
  111. }
  112.  
  113.  
  114. #*pod_separator = text(" <rdf:li>"," </rdf:li>");
  115. *pod_separator = sub { $_subsection++;    return
  116.     "        <rdf:li>\n".
  117.     "          <rdf:Description ID=\"ActivePerl-$_section-$_subsection\"\n".
  118.     "                           nc:name=\" \"/>\n".
  119.     "        </rdf:li>\n";
  120.  
  121. };
  122.  
  123. sub pod { 
  124.     my ($self, $file) = @_;
  125.     return
  126.     "        <rdf:li>\n".
  127.     rdf_li_desc($file, 'Perl/' . $self->{'podz'}->{"Pod::$file"}).    
  128.     "          </rdf:Description>\n".
  129.     "        </rdf:li>\n";
  130. };
  131.  
  132. sub rdf_li_desc {
  133.     my ($name, $link) = @_;
  134.     $_subsection++;
  135.     my $str = 
  136.     "          <rdf:Description ID=\"ActivePerl-$_section-$_subsection\"\n".
  137.     "                           nc:name=\"$name\"\n".
  138.     "                           nc:link=\"$link\">\n";
  139.  
  140.     return $str;       
  141. };
  142.  
  143. #*after_pods = \&end_subhead;
  144. sub after_pods {
  145.     $_section++;
  146.     return 
  147.     "    </rdf:Seq>\n".
  148.     "  </nc:subheadings>\n".
  149.     "</rdf:Description>\n";
  150. }
  151.  
  152. #*before_scripts = text("<!-- Programs -->",@begin_subhead);
  153. sub before_scripts {
  154.     return
  155.     "  <rdf:Description about=\"#ActivePerl-$_section\">\n".
  156.     "    <nc:subheadings>\n".
  157.     "      <rdf:Seq>\n";
  158.  
  159. }
  160.  
  161. sub script {
  162.     my ($self, $file) = @_;
  163.     return
  164.     "        <rdf:li>\n".
  165.     rdf_li_desc($file, 'Perl/' . $self->{'pragmaz'}->{$file}).
  166.     "          </rdf:Description>\n".
  167.     "        </rdf:li>\n";
  168. };
  169.  
  170. #*after_scripts = \&end_subhead;
  171. sub after_scripts {
  172.     $_section++;
  173.     return 
  174.     "    </rdf:Seq>\n".
  175.     "  </nc:subheadings>\n".
  176.     "</rdf:Description>\n";
  177. }
  178.  
  179. #*before_pragmas = text("<!-- Pragmas -->",@begin_subhead);
  180. sub before_pragmas {
  181.     return
  182.     "  <rdf:Description about=\"#ActivePerl-$_section\">\n".
  183.     "    <nc:subheadings>\n".
  184.     "      <rdf:Seq>\n";
  185.  
  186. }
  187.  
  188. sub pragma {
  189.     my ($self, $file) = @_;
  190.     return
  191.     "        <rdf:li>\n".
  192.     rdf_li_desc($file, 'Perl/' . $self->{'pragmaz'}->{$file}).
  193.     "          </rdf:Description>\n".
  194.     "        </rdf:li>\n";
  195. };
  196.  
  197. #*after_pragmas = \&end_subhead;
  198. sub after_pragmas {
  199.     $_section++;
  200.     return 
  201.     "    </rdf:Seq>\n".
  202.     "  </nc:subheadings>\n".
  203.     "</rdf:Description>\n";
  204. }
  205.  
  206. #*before_libraries = text("<!-- Libraries -->",@begin_subhead);
  207. sub before_libraries {
  208.     return
  209.     "  <rdf:Description about=\"#ActivePerl-$_section\">\n".
  210.     "    <nc:subheadings>\n".
  211.     "      <rdf:Seq>\n";
  212. }
  213.  
  214.  
  215. #*library_indent_open = text(@begin_subhead);
  216. #*library_indent_close = \&end_subhead;
  217.  
  218. sub library_indent_open {
  219.     return
  220.     "    <nc:subheadings>\n".
  221.     "      <rdf:Seq>\n";
  222. }
  223.  
  224. sub library_indent_close {
  225.     return
  226.     "          </rdf:Description>\n".
  227.     "        </rdf:li>\n".
  228.     "      </rdf:Seq>\n".
  229.     "    </nc:subheadings>\n".
  230.     "          </rdf:Description>\n".
  231.     "        </rdf:li>\n";
  232. }
  233.  
  234. sub library_indent_same {
  235.     return
  236.     "          </rdf:Description>\n".
  237.     "        </rdf:li>\n";
  238. }
  239.  
  240. sub library {
  241.     my ($self, $file, $showfile) = @_;
  242.     return
  243.     "        <rdf:li>\n".
  244.     rdf_li_desc($showfile, 'Perl/' . $self->{'filez'}->{$file});
  245. }
  246.  
  247. sub library_container {
  248.     my ($self, $file, $showfile) = @_;
  249.     return 
  250.     " <rdf:li>\n".
  251.     "  <rdf:Description nc:name=\"$showfile\">\n";
  252. }
  253.  
  254. #*after_libraries = \&end_subhead;
  255. sub after_libraries {
  256.     $_section++;
  257.     return 
  258.     "    </rdf:Seq>\n".
  259.     "  </nc:subheadings>\n".
  260.     "</rdf:Description>\n";
  261. }
  262.  
  263.  
  264.  
  265. *footer = text("</rdf:RDF>");
  266.  
  267. __END__
  268.  
  269. #=head1 NAME
  270.  
  271. ActivePerl::DocTools::TOC::RDF - Perl extension for Documentation TOC Generation in RDF
  272.  
  273. #=head1 SYNOPSIS
  274.  
  275.   use ActivePerl::DocTools::TOC::RDF();
  276.  
  277.   my $foo = ActivePerl::DocTools::TOC::RDF->new();
  278.   print $x->TOC();
  279.  
  280. #=head1 DESCRIPTION
  281.  
  282. Generates an RDF file. Uses the base class ActivePerl::DocTools::TOC.
  283.  
  284. #=head2 EXPORTS
  285.  
  286. Nothing.
  287.  
  288. #=head1 AUTHOR
  289.  
  290. Neil Kandalgaonkar, NeilK@ActiveState.com
  291.  
  292. #=head1 SEE ALSO
  293.  
  294. L<ActivePerl::DocTools::TOC>
  295.  
  296. #=cut
  297.  
  298.  
  299. <img src="images/folder.gif" width="15" height="13" alt="*"> ActivePerl Components<br>
  300.     <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Components/Descriptions.html">Overview</a><br>
  301.     <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/ActivePerl-faq2.html">PPM</a><br>
  302.     <img src="images/folder.gif" width="15" height="13" alt="*"> Windows Specifics<br>
  303.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="site/lib/Win32/OLE/Browser/Browser.html" target="_blank">OLE Browser</a><br>
  304.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Components/Windows/PerlScript.html">PerlScript</a><br>
  305.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="../eg/IEExamples/index.htm">PerlScript Examples</a><br>
  306.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Components/Windows/PerlISAPI.html">Perl for ISAPI</a><br>
  307.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="site/lib/Pod/PerlEz.html">PerlEz</a><br>
  308.  
  309.  
  310.     <img src="images/folder.gif" width="15" height="13" alt="*"> Windows Specifics<br>
  311.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq2.html">Perl for ISAPI</a><br>
  312.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq4.html">Windows 9X/NT/2000</a><br>
  313.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq5.html">Quirks</a><br>
  314.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq6.html">Web Server Config</a><br>
  315.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq7.html">Web programming</a><br>
  316.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq8.html">Programming</a><br>
  317.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq9.html">Modules & Samples</a><br>
  318.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq10.html">Embedding & Extending</a><br>
  319.        <img src="images/page.gif" width="12" height="15" alt="*"> <a href="faq/Windows/ActivePerl-Winfaq12.html">Using OLE with Perl</a><br>
  320. <img src="images/folder.gif" width="15" height="13" alt="*"> Windows Scripting<br>
  321.     <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Windows/ActiveServerPages.html">Active Server Pages</a><br>
  322.     <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Windows/WindowsScriptHost.html">Windows Script Host</a><br>
  323.     <img src="images/page.gif" width="12" height="15" alt="*"> <a href="Windows/WindowsScriptComponents.html">Windows Script Components</a><br>
  324.  
  325.