You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by da...@apache.org on 2002/04/17 21:05:45 UTC

cvs commit: tcl-rivet/rivet/rivet-tcl rivet_command_document.tcl tclIndex

damonc      02/04/17 12:05:45

  Modified:    rivet/rivet-tcl tclIndex
  Added:       rivet/rivet-tcl rivet_command_document.tcl
  Log:
  Adding rivet_command_document command.  A command to display a standard
  documentation page for a command in Rivet.  Documentation will be added
  later. 0-]
  
  Revision  Changes    Path
  1.9       +1 -0      tcl-rivet/rivet/rivet-tcl/tclIndex
  
  Index: tclIndex
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/rivet/rivet-tcl/tclIndex,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- tclIndex	14 Mar 2002 21:59:10 -0000	1.8
  +++ tclIndex	17 Apr 2002 19:05:45 -0000	1.9
  @@ -22,3 +22,4 @@
   set auto_index(cookie) [list source [file join $dir cookie.tcl]]
   set auto_index(import_keyvalue_pairs) [list source [file join $dir import_keyvalue_pairs.tcl]]
   set auto_index(import_switch_args) [list source [file join $dir import_switch_args.tcl]]
  +set auto_index(rivet_command_document) [list source [file join $dir rivet_command_document.tcl]]
  
  
  
  1.1                  tcl-rivet/rivet/rivet-tcl/rivet_command_document.tcl
  
  Index: rivet_command_document.tcl
  ===================================================================
  proc rivet_command_document {list} {
      array set info $list
  
      puts "<HEAD>"
      puts "<TITLE>$info(name) Documentation</TITLE>"
      puts "</HEAD>"
      puts "<BODY BGCOLOR=WHITE VLINK=blue>"
  
      puts "<CENTER>"
      puts {<FONT SIZE="+3">}
      puts "$info(name) - $info(package)"
      puts "</FONT>"
      puts "<BR>"
      puts "<B>"
      puts {<A HREF="#synopsis">Synopsis</A>}
      puts " * "
      puts {<A HREF="#description">Description</A>}
      if {[info exists info(seealso)]} {
  	puts " * "
  	puts {<A HREF="#seealso">See Also</A>}
      }
      puts "</B>"
      puts "</CENTER>"
  
      puts {<H3><A NAME="name" HREF="#name">Name</A></H3>}
      puts "<B>$info(name) - $info(short)</B>"
  
      if {![info exists info(command)]} { set info(command) $info(name) }
  
      puts {<H3><A NAME="synopsis" HREF="#synopsis">Synopsis</A></H3>}
      puts "$info(command)"
      if {[info exists info(arguments)]} { puts "<I>$info(arguments)</I>" }
  
      puts {<H3><A NAME="description" HREF="#description">Description</A></H3>}
      puts $info(description)
  
      if {[info exists info(seealso)]} {
  	puts {<H3><A NAME="seealso" HREF="#seealso">See Also</A></H3>}
  	puts $info(seealso)
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: cvs commit: tcl-rivet/rivet/rivet-tcl rivet_command_document.tcl tclIndex

Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:

> > >   Adding rivet_command_document command.  A command to display a
> > >   standard documentation page for a command in Rivet.  Documentation
> > >   will be added later. 0-]

> > Hrm... I see... what is this really for?

>     I'm about to start re-writing the Rivet documentation more like
> NeoWebScript's docs.  Look at:

> http://www.unreality.com/neowebscript/commands/

>     Each command has its own document (man page like) instead of
> just all in one file like the current docs.  I want all the pages to
> be uniform, so I defined a command to produce them all.  It just
> makes the pages look uniform.  You'll see.  Check out my docs for
> dio and diodisplay.  You'll see what the docs look like.  They're
> both using this command to format themselves.

mmmmmmmm have you ever looked at docbook?  I am very uneasy about
'one-off' documentation.  We have been using docbook for websh, and
I'm pretty comfortable with it.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: cvs commit: tcl-rivet/rivet/rivet-tcl rivet_command_document.tcl tclIndex

Posted by Damon Courtney <da...@your.unreality.com>.
> >   Adding rivet_command_document command.  A command to display a
> >   standard documentation page for a command in Rivet.  Documentation
> >   will be added later. 0-]
> 
> Hrm... I see... what is this really for?

    I'm about to start re-writing the Rivet documentation more like
NeoWebScript's docs.  Look at:

http://www.unreality.com/neowebscript/commands/

    Each command has its own document (man page like) instead of just
all in one file like the current docs.  I want all the pages to be
uniform, so I defined a command to produce them all.  It just makes the
pages look uniform.  You'll see.  Check out my docs for dio and diodisplay.
You'll see what the docs look like.  They're both using this command to
format themselves.

> A few critiques:
> 
> >       puts "<HEAD>"
> 
> Missing the DTD line.

    Oops. 0-]

> >       puts "<TITLE>$info(name) Documentation</TITLE>"
> 
> Do you have any thoughts on the use of a big [format] to do work like
> this?  I kind of prefer it, because then I can put all the text in one
> big block between {}'s, and just use %s.

    That's not a bad idea.  I might convert the code to do that instead.

Damon


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: cvs commit: tcl-rivet/rivet/rivet-tcl rivet_command_document.tcl tclIndex

Posted by "David N. Welton" <da...@dedasys.com>.
damonc@apache.org writes:

>   Adding rivet_command_document command.  A command to display a
>   standard documentation page for a command in Rivet.  Documentation
>   will be added later. 0-]

Hrm... I see... what is this really for?

A few critiques:

>       puts "<HEAD>"

Missing the DTD line.

>       puts "<TITLE>$info(name) Documentation</TITLE>"

Do you have any thoughts on the use of a big [format] to do work like
this?  I kind of prefer it, because then I can put all the text in one
big block between {}'s, and just use %s.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org