Modernize the console reference so it's site schemed and the 
instructions are stripped.

        Patch by rho. 

diffs (119 lines):

diff -r 59a3749375b7 -r aa9fef675f21 cgi-bin/LJ/Console.pm
--- a/cgi-bin/LJ/Console.pm     Mon May 18 00:28:26 2009 +0000
+++ b/cgi-bin/LJ/Console.pm     Mon May 18 00:31:50 2009 +0000
@@ -176,34 +176,29 @@ sub command_reference_html {
 sub command_reference_html {
     my $pkg = shift;
 
-    my $ret = "<dl>";
+    my $ret;
 
     foreach my $cmd (sort keys %cmd2class) {
         my $class = $cmd2class{$cmd};
         next if $class->is_hidden;
         next unless $class->can_execute;
 
-        $ret .= "<a name='cmd.$cmd'><dt><p><table width=100% 
cellpadding=2><tr><td bgcolor=#d0d0d0>";
+        $ret .= "<a name='cmd.$cmd'><h2><code><b>$cmd</b></a> ";
+        $ret .= LJ::ehtml($class->usage);
+        $ret .= "</code></h2>\n";
 
-        $ret .= "<tt><a style='text-decoration: none' 
href='#cmd.$cmd'><b>$cmd</b></a> ";
-        $ret .= LJ::ehtml($class->usage);
-        $ret .= "</tt></td></tr></table>";
-
-        $ret .= "</dt><dd><p>" . $class->desc;
+        $ret .= $class->desc;
 
         if ($class->args_desc) {
             my $args = $class->args_desc;
-            $ret .= "<p><dl>";
+            $ret .= "<dl>";
             while (my ($arg, $des) = splice(@$args, 0, 2)) {
-                $ret .= "<dt><b><i>$arg</i></b></dt><dd>$des</dd>";
+                $ret .= 
"<dt><strong><em>$arg</em></strong></dt><dd>$des</dd>\n";
             }
             $ret .= "</dl>";
         }
-
-        $ret .= "</dd></a>";
     }
 
-    $ret .= "</dl>";
 
     return $ret;
 }
diff -r 59a3749375b7 -r aa9fef675f21 htdocs/admin/console/reference.bml
--- a/htdocs/admin/console/reference.bml        Mon May 18 00:28:26 2009 +0000
+++ b/htdocs/admin/console/reference.bml        Mon May 18 00:31:50 2009 +0000
@@ -1,26 +1,35 @@
-<html><head><title>Console Reference</title></head>
-<body>
+<?page
+#
+# admin/console/reference.bml
+#
+# Reference for the Admin Console, listing commands and syntax.
+#
+# Authors:
+#      Rachel Walmsley <[email protected]>
+#
+# Copyright (c) 2009 by Dreamwidth Studios, LLC.
+#
+# This program is free software; you may redistribute it and/or modify it under
+# the same terms as Perl itself. For a copy of the license, please reference
+# 'perldoc perlartistic' or 'perldoc perlgpl'.
+#
+body<=
+<?_code
+{
+    use strict;
+    use vars qw( %cmd );
+    use LJ::Console;
 
-[ <a href="./">console</a> | reference ]
+    my $ret = "<p>" . BML::ml( ".paragraph1", { aopts => 
"href='$LJ::SITEROOT/admin/console/'" } ) . "</p> \n";
+    $ret .= "<p>$ML{'.paragraph2'}</p> \n";
+    $ret .= "<p>$ML{'.paragraph3'}</p> \n";
 
-<P><B>Grammar</B>
-<BR>Think of this like a DOS or <tt>bash</tt> prompt.  The first word is a 
command.  Every word after that is an argument to that command.  Every command 
has a different number of required and optional parameters.  White space 
delimits arguments.  If you need a space in an argument, put double quotes 
around the whole thing.  If you need double quotes and spaces in an argument, 
escape the quote with a backslash (\) first.  If you need to do a backslash, 
escape that with a backslash.
-<P>It's pretty straight-forward.  If you're confused, ask.
-
-<P><B>Command Reference</B>
-<BR>Arguments in &lt;angle brackets&gt; are required.  Arguments in [brackets] 
are optional.  If there is more than one optional argument, you can't skip one 
and provide one after it.  Once you skip one, you have to skip the rest.
-
-<?_code
-
- use strict;
- use vars qw(%cmd);
- use LJ::Console;
-
- my $ret;
- $ret .= LJ::Console->command_list_html;
- $ret .= LJ::Console->command_reference_html;
- return $ret;
-
+    $ret .= LJ::Console->command_list_html;
+    $ret .= LJ::Console->command_reference_html;
+    return $ret;
+}
 _code?>
 
-</body></html>
+<=body
+title=><?_code return $ML{'.title'};  _code?>
+page?>
diff -r 59a3749375b7 -r aa9fef675f21 htdocs/admin/console/reference.bml.text
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/admin/console/reference.bml.text   Mon May 18 00:31:50 2009 +0000
@@ -0,0 +1,8 @@
+;; -*- coding: utf-8 -*-
+.paragraph1=These are the commands you can use in the <a [[aopts]]>Admin 
Console</a>.
+
+.paragraph2=The first word is a command.  Every word after that is an argument 
to that command. Every command has a different number of required and optional 
parameters.  White space delimits arguments. If you need a space in an 
argument, put double quotes around the whole thing.   If you need double quotes 
and spaces in an argument, escape the quote with a backslash (\) first. If you 
need to do a backslash, escape that with a backslash.
+
+.paragraph3=Arguments in &lt;angle brackets&gt; are required.  Arguments in 
[brackets] are optional.  If there is more than one optional argument, you 
can't skip one and provide one after it.  Once you skip one, you have to skip 
the rest.
+
+.title=Admin Console Reference
\ No newline at end of file
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to