Loading ...
Sorry, an error occurred while loading the content.

How to do this in a clip

Expand Messages
  • brandon@devgateway.com
    hi, I d like to make a clip to help me automatically create comments for my PHP classes. They are generally in this format: /** * Class name * * Short
    Message 1 of 1 , Feb 4, 2006
    • 0 Attachment
      hi,

      I'd like to make a clip to help me automatically create comments for my PHP classes.

      They are generally in this format:

      /**
      * Class name
      *
      * Short description
      *
      * Long description,
      * often on multiple lines
      *
      * @author Dev Gateway <development@...
      * @version v1.0, last update on 2/4/2006 12:17:27
      * @package packagename.subpackage
      */

      I need a way to create that long description. It should be a multiline field, so the comment can be entered on a few lines.

      However, if a line of text is longer than 80 characters in length, it should be split onto a second line at the closest word boundary within that 80 character limit.

      So this line:

      this is a very very very very very long line, which contains more than 80 characters, and should be split onto a second line

      should be turned to:

      this is a very very very very very long line, which contains more than 80
      characters, and should be split onto a second line

      The space between 80 and characters should be deleted, and a linebreak inserted.

      Further, every line, including blank lines, should have a space, and then an asterisk (*), plus another space, inserted.

      so:

      This is the first line describing the class

      This is another line

      Should be turned to

      *
      This is the first line describing the class
      *
      * This is another line

      This should also happen for the text wrapped to a second line as described above.

      * this is a very very very very very long line, which contains more than 80
      * characters, and should be split onto a second line

      Is this possible? I thought I had something like this working before, but not perfectly, and it took a lot of time to figure it out, and now I've lost it. Does anyone here know a way to do this?

      Thanks,
      Brandon

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.