Re: not-so-plain documentation
I've seen pod2usage() and this would work, but most of these scripts have some defaults set for variables that can be changed with the GetOptions flags and I'd like to show these defaults at least in the help message. Take a look at, I believe, GetOpt::Declare. It's one of Damian's. xoxo, Andy -- Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance
Re: not-so-plain documentation
On 6/24/2004 11:11 PM, Eric Wilhelm wrote: Hi everybody! I'm going to be documenting a system of (30+) programs with is mostly scripts, rather than modules. I know you can just put pod text in your scripts, but I'd like to also integrate the usage messages into the pods (or get them from the pods.) I've seen pod2usage() and this would work, but most of these scripts have some defaults set for variables that can be changed with the GetOptions flags and I'd like to show these defaults at least in the help message. Example: my $rounding = 0.01; GetOptions( 'round=f' => \$rounding, 'help' => sub {usage()}, ); sub usage { print "usage: $0 \n"; print "options: --round(default $rounding)\n"; } END Since the strings printed by usage() in this case are generated on the fly, the values which have already been set are available to be printed. With pod2usage() and perldoc, this is not the case. Is there any way to make this work without having to maintain duplicate information? Preferably, something that would try to do() the file up to a certain point, gather the variables and perform a substitution (maybe on a tag like v<$rounding>.) Yeah, I alway thought that was a weakness of the core pod modules. Fortunately, it's easy to subclass them to do what you want. You'll want to subclass Pod::Text, override the proper method to add a new escape sequence (say $), then maybe override the constructor to take a hash with the values for the variables or possibly something more elaborate like evaling the variable name in the caller's context. I've done similary on several occasions and it is fairly trivial. If you have trouble, I can probably dig up an example. Randy.
not-so-plain documentation
Hi everybody! I'm going to be documenting a system of (30+) programs with is mostly scripts, rather than modules. I know you can just put pod text in your scripts, but I'd like to also integrate the usage messages into the pods (or get them from the pods.) I've seen pod2usage() and this would work, but most of these scripts have some defaults set for variables that can be changed with the GetOptions flags and I'd like to show these defaults at least in the help message. Example: my $rounding = 0.01; GetOptions( 'round=f' => \$rounding, 'help' => sub {usage()}, ); sub usage { print "usage: $0 \n"; print "options: --round(default $rounding)\n"; } END Since the strings printed by usage() in this case are generated on the fly, the values which have already been set are available to be printed. With pod2usage() and perldoc, this is not the case. Is there any way to make this work without having to maintain duplicate information? Preferably, something that would try to do() the file up to a certain point, gather the variables and perform a substitution (maybe on a tag like v<$rounding>.) Thanks, Eric -- "There are three terrible ages of childhood -- 1 to 10, 10 to 20, and 20 to 30." --Cleveland Amory
Re: New Module: HTML::DragDrop
On Fri, 25 Jun 2004, A. Pagaltzis wrote: > * Chris Josephes <[EMAIL PROTECTED]> [2004-06-24 19:50]: > > Also, I'm 90% sure there's no other method (besides JavaScript) > > to implement D&D. If some guy down the road manages to do it > > in VBScript, he can always register > > Html::DragAndDrop::VBScript". > > It can certainly be done in VBScript. Anything that's possible in > one is possible in the other. > > Maybe my proposition of ::DHTML:: was not so bad after all? I think HTML::DHTML would be a great sub-namespace for this sort of stuff. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Re: New Module: HTML::DragDrop
* Chris Josephes <[EMAIL PROTECTED]> [2004-06-24 19:50]: > Also, I'm 90% sure there's no other method (besides JavaScript) > to implement D&D. If some guy down the road manages to do it > in VBScript, he can always register > Html::DragAndDrop::VBScript". It can certainly be done in VBScript. Anything that's possible in one is possible in the other. Maybe my proposition of ::DHTML:: was not so bad after all? Regards, -- Aristotle "If you can't laugh at yourself, you don't take life seriously enough."
Re: New Module: HTML::DragDrop
* Mark Stosberg <[EMAIL PROTECTED]> [2004-06-24 17:11]: > I can't think of how drag'n'drop could be implemented without > JavaScript. Not possible. Tooltips are, because using CSS you can define reactions to hovering the mouse over something. But you can't define reactions to clicks. Regards, -- Aristotle "If you can't laugh at yourself, you don't take life seriously enough."
Re: New Module: HTML::DragDrop
On Thu, 24 Jun 2004, Mark Stosberg wrote: > > HTML::DragDrop::Javascript > > HTML::DragAndDrop::Javascript > > Is there a way to implement Drag and Drop with HTML /without/ using > JavaScript? I suspect not. Thus, I think it could be appropriate to drop > 'Javascript' from the name > > > HTML::DragDrop > > HTML::DragAndDrop My vote is for "HTML::DragAndDrop". Saving three characters is typing isn't worth the possible ambiguity in the title. I haven't seen the interface, but I'm guessing I only need to specify the module namespace once during with the "use" command. Also, I'm 90% sure there's no other method (besides JavaScript) to implement D&D. If some guy down the road manages to do it in VBScript, he can always register Html::DragAndDrop::VBScript". On another note, this sounds pretty cool. I'll have to look at this module once it's uploaded. Christopher Josephes [EMAIL PROTECTED]
Re: New Module: HTML::DragDrop
On Thu, Jun 24, 2004 at 12:12:05PM -0300, SilvioCVdeAlmeida wrote: > Hello, you all. > > I suspect that if drag_and_drop depends on javascript, so do tooltip. > That's of course in the HTML context. And also, I'm excluding from > "tooltip" the direct, obvious, plain . > > Please tell me if it isn't so. Tooltips can be implemented purely in CSS, as documented here: http://www.madaboutstyle.com/tooltip2.html I can't think of how drag'n'drop could be implemented without JavaScript. Mark
Re: New Module: HTML::DragDrop
Hello, you all. I suspect that if drag_and_drop depends on javascript, so do tooltip. That's of course in the HTML context. And also, I'm excluding from "tooltip" the direct, obvious, plain . Please tell me if it isn't so. Silvio Mark Stosberg wrote: > > > HTML::DragDrop::Javascript > > HTML::DragAndDrop::Javascript > > Is there a way to implement Drag and Drop with HTML /without/ using > JavaScript? I suspect not. Thus, I think it could be appropriate to drop > 'Javascript' from the name > > > HTML::DragDrop > > HTML::DragAndDrop > > Including 'And' in the name is how people usually refer to the > technique. However, for a module name I think it may be clear enough to > exclude the word 'And' in favor of a shorter name that is 'good enough'. > > Mark > > http://www.summersault.com/
Re: New Module: HTML::DragDrop
* Mark Stosberg <[EMAIL PROTECTED]> [2004-06-24 15:46]: > > HTML::DragDrop::Javascript > > HTML::DragAndDrop::Javascript > > Is there a way to implement Drag and Drop with HTML /without/ > using JavaScript? I suspect not. Thus, I think it could be > appropriate to drop 'Javascript' from the name I'm thinking the same, though it then seems wrong to me. Maybe HTML::Dynamic::DragDrop? Or maybe (the acronym soup for dinner version) HTML::DHTML::DragDrop, which is a tad shorter. > Including 'And' in the name is how people usually refer to the > technique. However, for a module name I think it may be clear > enough to exclude the word 'And' in favor of a shorter name > that is 'good enough'. Well, actually it's really "drag'n'drop", but DragNDrop looks more than a little ugly, DragnDrop looks awkward. Heh, it *could* actually be ::Drag'N'Drop! (Which is the same as Drag::N::Drop. C.f. the "D'oh" module.) But, that's not probably a good idea for "real" code. DragAndDrop looks and sounds a little awkward.. probably DragDrop then. Regards, -- Aristotle "If you can't laugh at yourself, you don't take life seriously enough."
Re: New Module: HTML::DragDrop
> HTML::DragDrop::Javascript > HTML::DragAndDrop::Javascript Is there a way to implement Drag and Drop with HTML /without/ using JavaScript? I suspect not. Thus, I think it could be appropriate to drop 'Javascript' from the name > HTML::DragDrop > HTML::DragAndDrop Including 'And' in the name is how people usually refer to the technique. However, for a module name I think it may be clear enough to exclude the word 'And' in favor of a shorter name that is 'good enough'. Mark http://www.summersault.com/
New Module: HTML::DragDrop
We're looking at releasing our new module HTML::DragDrop. Like the newly released HTML::Tooltip::Javascript, this module uses a Javascript library written by Walter Zorn http://www.walterzorn.com/dragdrop/dragdrop_e.htm. The library provides an elegant way to implement dragable objects (images, div tags etc) in your web page. However, in this case we have extended the library to allow 'containers' in which to catch the dragable objects. The perl module makes this very easy to use from a perl script, for example a CGI script. Following the advice we received for the HTML::Tooltip::Javascript module, we think one of the following names would be appropriate for this module: HTML::DragDrop HTML::DragAndDrop HTML::DragDrop::Javascript HTML::DragAndDrop::Javascript Which name is the most appropriate? Or are there any other suggestions? Regards Becky