⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 template.pl

📁 精通tomcat书籍原代码,希望大家共同学习
💻 PL
📖 第 1 页 / 共 2 页
字号:
            <br>
            <table width="100%" cellspacing="0" cellpadding="2" border="1">
              <tr>
                <td bgcolor="eeeeff" align="left">
                  <font face="arial,helvetica,sans serif">
                    <b>Global Functions</b>
                  </font>
                </td>
              </tr>
        <<
        foreach $e ($p->globalfuncs()) {
            $_ = $e->url;
            s/\s/_/g;
            y/[A-Z]/[a-z]/;
            >>
                  <tr>
                    <td>
                      <font face="arial,helvetica,sans serif">
                        <nobr><a href="doc.$_">$(e.fullname)</a></nobr>
                      </font>
                    </td>
                  </tr>
            <<
        }
    }

    # And then finish with the global variables TOC
    if ($p->globalvars()) {
        >>
            </table>
            <br>
            <table width="100%" cellspacing="0" cellpadding="2" border="1">
              <tr>
                <td bgcolor="eeeeff" align="left">
                  <font face="arial,helvetica,sans serif">
                    <b>Global Variables</b>
                  </font>
                </td>
              </tr>
        <<
        foreach $e ($p->globalvars()) {
            $_ = $e->url;
            s/\s/_/g;
            y/[A-Z]/[a-z]/;
            >>
                  <tr>
                    <td>
                      <font face="arial,helvetica,sans serif">
                        <nobr><a href="doc.$_">$(e.fullname)</a></nobr>
                      </font>
                    </td>
                  </tr>
            <<
        }
    }

    >>
        </table>
        <br>
    <<

    # Then generate the detail for each class in this package
    foreach $e ($p->classes()) {
        $_ = $e->url;
        s/\s/_/g;
        y/[A-Z]/[a-z]/;
        >>
            <table width="100%" cellspacing="0" cellpadding="2" border="1">
              <tr>
                <td bgcolor="ccccff" align="left">
                  <font size="+1" face="arial,helvetica,sans serif">
                    <a name="$(e.name)">
                      <b>Class &quot;$(e.name)&quot; Detail:</b>
                    </a>
                  </font>
                </td>
              </tr>
            </table>
              <font size="+1" face="arial,helvetica,sans serif">
                <b>$(e.name)</b>
              </font>
            <dl>
              <dt><code>$(e.fullname) {</code></dt>
        <<

        # Generate a code-like representation of the class
        if ($e->members()) {
            foreach $m ($e->members()) {
                >>
                      <dd><code>$(m.fullname);</code></dd>
                <<
            }
        }
        >>
              <dt><code>};</code></dt>
            </dl>
            <p>
              <font face="arial,helvetica,sans serif">
                $(e.description)
              </font>
            </p>
        <<

        # If we have functions, output them
        if ($e->memberfuncs()) {
            >>
                <table width="100%" cellspacing="0" cellpadding="2" border="1">
                  <tr>
                    <td bgcolor="eeeeff" align="left">
                      <font face="arial,helvetica,sans serif">
                        <b>Class &quot;$(e.name)&quot; Functions:</b>
                      </font>
                    </td>
                  </tr>
                </table>
            <<
            foreach $m ($e->memberfuncs()) {
                $_ = join("-",$e->name,$m->name);
                s/\s/_/g;
                y/[A-Z]/[a-z]/;
                >>
                    <a name="$_">
                <<
                &function($m);
            }
        }

        # If we have variables, output them
        if ($e->membervars()) {
            >>
                <table width="100%" cellspacing="0" cellpadding="2" border="1">
                  <tr>
                    <td bgcolor="eeeeff" align="left">
                      <font face="arial,helvetica,sans serif">
                        <b>Class &quot;$(e.name)&quot; Variables:</b>
                      </font>
                    </td>
                  </tr>
                </table>
            <<
            foreach $m ($e->membervars()) {
                $_ = join("-",$e->name,$m->name);
                s/\s/_/g;
                y/[A-Z]/[a-z]/;
                >>
                    <a name="$_">
                <<
                &variable($m);
            }
        }
    }

    # Output detailed information for each global function
    if ($p->globalfuncs()) {
        >>
            <table width="100%" cellspacing="0" cellpadding="2" border="1">
              <tr>
                <td bgcolor="ccccff" align="left">
                  <font size="+1" face="arial,helvetica,sans serif">
                    <b>Global Functions Detail:</b>
                  </font>
                </td>
              </tr>
            </table>
        <<
        foreach $e ($p->globalfuncs()) {
            $_ = $e->name;
            s/\s/_/g;
            y/[A-Z]/[a-z]/;
            >>
                <a name="$_">
            <<
            &function($e);
        }
    }

    # Then write detailed information for each global variable
    if ($p->globalvars()) {
        >>
            <table width="100%" cellspacing="0" cellpadding="2" border="1">
              <tr>
                <td bgcolor="ccccff" align="left">
                  <font size="+1" face="arial,helvetica,sans serif">
                    <b>Global Variables Detail:</b>
                  </font>
                </td>
              </tr>
            </table>
        <<
        foreach $e ($p->globalvars()) {
            $_ = $e->name;
            s/\s/_/g;
            y/[A-Z]/[a-z]/;
            >>
                <a name="$_">
            <<
            &variable($e);
        }
    }

    >>
        <font size="-2" face="arial,helvetica,sans serif">
          <div align="center">
            Copyright &copy; $copyright.<br>
            All Rights Reserved.<br>
            Generated with <a href="$scandocURL">ScanDoc
            $majorVersion.$minorVersion</a> on $date
          </div>
        </font>
      </body>
    </html>
    <<
}

# Write out the detailed description of a function
sub function {
    local ($m) = @_;

    # Output the function name and description
    >>
        <font size="+1" face="arial,helvetica,sans serif">
          <b>$(m.name)</b>
        </font>
        <dl>
          <dt><code>$(m.fullname);</code></dt>
          <dd>
            <dl>
              <dt>
                <font face="arial,helvetica,sans serif">
                  $(m.description)
                </font>
              </dt>
    <<

    # Process all parameters (one by one)
    if ($m->params()) {
        >>
                  <dt>
                    <font face="arial,helvetica,sans serif">
                      <b>Parameters</b>
                    </font>
                  </dt>
        <<
        foreach $a ($m->params()) {
            >>
                      <dd>
                        <code>$(a.name)</code> -
                        <font face="arial,helvetica,sans serif">
                          $(a.description)
                        </font>
                      </dd>
            <<
        }
    }

    # Check for a return value
    if ($m->returnValue()) {
        >>
                  <dt>
                    <font face="arial,helvetica,sans serif">
                      <b>Return Value</b>
                    </font>
                  </dt>
                  <dd>
                    <font face="arial,helvetica,sans serif">
                      $(m.returnValue)
                    </font>
                  </dd>
        <<
    }

    # Dig in for exceptions
    if ($m->exceptions()) {
        >>
                  <dt>
                    <font face="arial,helvetica,sans serif">
                      <b>Exceptions</b>
                    </font>
                  </dt>
        <<
        foreach $a ($m->exceptions()) {
            >>
                      <dd>
                        <code>$(a.name)</code>
                        <font face="arial,helvetica,sans serif">
                          $(a.description)
                        </font>
                      </dd>
            <<
        }
    }

    # Close the list
    >>
            </dl>
          </dd>
        </dl>
        <hr>
    <<
}

# Write out the detailed description of a variable
sub variable {
    local ($m) = @_;

    # Output the variable name and description
    >>
        <font size="+1" face="arial,helvetica,sans serif">
          <b>$(m.name)</b>
        </font>
        <dl>
          <dt><code>$(m.fullname);</code></dt>
          <dd>
            <dl>
              <dt>
                <font face="arial,helvetica,sans serif">
                  $(m.description)
                </font>
              </dt>
            </dl>
          </dd>
        </dl>
        <hr>
    <<
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -