AutoHotkey Community

It is currently May 25th, 2012, 3:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

How would you like to document StdLib Functions?
Documentation in the code?
Create documentation in a web form/gui?
Option to do both?
Should there be only one way and everyone must stick with it?
You may select 1 option

View results
Author Message
PostPosted: August 18th, 2007, 8:35 pm 
Offline

Joined: August 4th, 2007, 10:58 pm
Posts: 21
AutoHotkey Standard Library Functions
With the blessing of the AHK community, I'd like to help administer a centralized location for StdLib functions. I'm thinking Autohotkey.net would be the perfect place for function storage. In order to effectively organize and document a task such as this, a set of standards needs to be implemented for submitted functions.

StdLib Function Standards Suggestions
1. If a script for stdlib inclusion contains multiple functions, any functions that would only be called from within that script could have the prefix private_ or scriptname_. This will ensure that more complex scripts with backend functions won't interfere with functions contained in other StdLib scripts. Just a thought.

Steps for Function Submission to the StdLib
1. Identify strong candidate scripts and functions for the stdlib in this thread
2. The author or a volunteer should document each candidate.
3. Someone other than the author should perform some type of quality-assurance review of that item's function(s). This includes basic testing, but more importantly a review of the design to see that the syntax is efficient, user-friendly, and as future-proof as possible. This is because script-breaking changes made to the stdlib items after they're released could/would cause a lot of problems for users.

I'll be more than happy to help with testing and the like to the best of my abilities, but I'll be honest, some things slung around in this forum are just WAY over my head.

Todo:
Determine the best way to standardize the documentation process. We could create a link in the wiki with documentation for each function submitted for the stdlib. I personally tend to think that this would be a tedious process and might be asking too much from the stdlib function authors. Another possibility ( maybe easier ) would be to document each function inside of the code and use a tool ( such as Natural Docs ) to format the comments in each file into a nice organized html file. If all are willing to accept this as a documentation standard, I would be more than happy to keep the documentation file up to date and in an easily accessible place.

This simple sample function below demonstrates proper documentation as outlined using Natural Docs. Again, this is just a suggestion, I would definitely like some feedback on everyone's preferred documentation practices.

The original script that I have adapted for the standard library was originally referenced here.

Code:
; Function:      AutoReload
;            Automatically reload a changed script
;
; Parameters:
;            switch   - Switch to turn AutoReload on or off.  Defaults to "on"
;            time   - Determines how often (in milliseconds) the function will check to see if the script has changed.
;                         Defaults to 1000 milliseconds .
;
; Examples:   
;            AutoReload() - turns AutoReload on
;            AutoReload("off") - turns AutoReload off
;
AutoReload(switch="on", time=1000) {

  SetTimer, AutoReloadScriptIfChanged, %time%
  SetTimer, AutoReloadScriptIfChanged, %switch%
  Return %switch%

  AutoReloadScriptIfChanged:
  {
    FileGetAttrib, FileAttribs, %A_ScriptFullPath%
    IfInString, FileAttribs, A
    {
      FileSetAttrib, -A, %A_ScriptFullPath%
      TrayTip, Reloading Script..., %A_ScriptName%, , 1
      Sleep, 500
      Reload
      TrayTip
    }
    Return
  }
}


Since this function is simple enough and has worked in all of my testing, I'd like to officially suggest AutoReload as the first function ( referenced in this thread anyway ) to be submitted to the StdLib. Hey, you gotta start somewhere.

Questions/Comments/Suggestions about stdlib candidates, documentation practices, and function organization and storage for easy access are required in order to expand this wonderful feature of Autohotkey.

Thanks,

thefunnyman


Last edited by thefunnyman on August 31st, 2007, 4:49 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 12:14 am 
Offline

Joined: August 4th, 2007, 10:58 pm
Posts: 21
I think another good function for the StdLib would be Titan's Anchor.

This is a well-documented, very handy, script for automatic control resizing for your AHK Gui. I'm sure that if there were a way to determine hits/downloads of that script, one would notice that it's probably been thoroughly tested. Any comments/suggestions?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 3:52 pm 
Offline

Joined: August 4th, 2007, 10:58 pm
Posts: 21
There is a nice sticky at the top of this forum with a list of custom gui controls. I'd like everyone's opinion on whether a script with external dll dependencies ( ie. dll's not currently supplied with the OS ) should be included in the StdLib.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 10:43 pm 
Online
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8657
Location: Salem, MA
Another useful one would be XPath by Titan. It does not quite conform to the standard library format, but could be easily updated.

I vote that a Lib function that needs an external DLL is fine, as long as it is packaged nicely. it may be tricky to get the relative paths worked out.

I wonder - does the standard library allow subfolders?

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 19th, 2007, 10:57 pm 
Offline

Joined: August 4th, 2007, 10:58 pm
Posts: 21
engunneer wrote:
Another useful one would be XPath by Titan. It does not quite conform to the standard library format, but could be easily updated.

I vote that a Lib function that needs an external DLL is fine, as long as it is packaged nicely. it may be tricky to get the relative paths worked out.

I wonder - does the standard library allow subfolders?


Thank you very much for your suggestions..I was beginning to wonder if I was the only one that could see this thread. I agree with you about XPath, although I have limited experience with XML and probably wouldn't be able to test it thoroughly. But, hey, maybe this could be a nice learning opportunity for me.

I tend to agree with your statement about external DLLs, so that's 2 votes for, none against.

Good question about subfolders...I'll have to test that out.

Keep the suggestions coming,

thefunnyman


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 20th, 2007, 5:56 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
The stdlib and userlib don't currently support subfolders. However, that capability is under consideration for a future version.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2007, 1:29 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
I really like the idea of a standard lib.

What about making this thread a sticky? It may be more visible and accessible for forum people. Maybe there will be more contribution this way.

What about providing the stdlib as an archive (kind of "official" library, easy to install and keep up to date)?

About the tool to format comments, you could consider Doxygen.
I use it regularly and it's a great documentation generation tool.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2007, 5:27 pm 
Online
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8657
Location: Salem, MA
I vote Natural Docs over DOxygen - I think it will be easier to learn for most.

I expect this thread will be sticky once it contains a number of functions. For now, I think it is not ready.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2007, 6:30 pm 
Offline

Joined: August 4th, 2007, 10:58 pm
Posts: 21
engunneer wrote:
I vote Natural Docs over DOxygen - I think it will be easier to learn for most.

I tend to agree, although I only know as much about DOxygen as I learned in the five minutes I was at it's site.

enguneer wrote:
I expect this thread will be sticky once it contains a number of functions. For now, I think it is not ready.

Functions are a work in progress. I should have a partial list for consideration by the week's end.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 12:44 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Hi,
I've seen this topic and I don't want to install a 60MB :shock: program (Natural Docs), because I use AHK in a 512MB USB flash drive and I normally got 3 MB :roll: of free space. For my submissions I would use a documentation style like AHK's helpfile.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 4:09 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Quote:
I've seen this topic and I don't want to install a 60MB Shocked program (Natural Docs)

:shock: NaturalDocs-1.35.zip = 344 357 bytes


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 4:16 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
2 fincs
First, its not 60MB, but 12MB. Second you don't have to install anything but download compiled documentation somebody else will surely create for you as Ndoc is for person who maintance StdLib pack, not you (thats right, you don't need to have Ndoc to create it, and to read it, only browser, much better then lousy CHM Viewer as you have all browser features there (nice bookmarks, zoom, better search...) Third, when you find yourself without documentation you will be able to read it from the source code, and if you happen to have that magical 12MB on your hard disk and you are bored reading help from the source code, you can unpack archive and type mkdoc to have HTML help there. and then you can safely delete natural docs.

Quote:
I vote Natural Docs over DOxygen - I think it will be easier to learn for most.

I looked over all available documentators before I choosed Natural Docs. Doxygen is not nearly as easy as NDoc, has custom tags that are harder to follow then NDoc natural syntax in source code in case you don't have the HTML. Furthermore, the most important thing about doxigen is:

Quote:
Doxygen is a documentation system for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors) and to some extent PHP, C#, and D.

And guess what, I don't see AHK in the list :roll:

Conclusion
RTFM and inform yourself before trying to be "creative". :idea:

_________________
Image


Last edited by majkinetor on August 27th, 2007, 4:27 pm, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 4:22 pm 
Andreone wrote:
:shock: NaturalDocs-1.35.zip = 344 357 bytes

NaturalDocs needs ActivePerl, almost 16 Mo. So not 60 M, but a little bit more than 344 357 bytes...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 5:08 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
First of all I'm going to tell you my situation: I got two computers: a desktop and a laptop. I work the majority of time in the laptop. Then the laptop isn't mine, is of my mum and my dad (yes, I am only a child). I cannot install or write anything on this laptop. So I got a USB flash drive where AHK, scripts, programs and stuff of mine are. But I always got my flash drive with a few MB's of free space (3 MB's or more). So I download Natural Docs and got it in my desktop or on the laptop? If I use Natural Docs I would got it in my flash drive, but this program occupies too much. For that I don't want (or rather: I cannot) install Natural Docs.

majkinetor wrote:
First, its not 60MB, but 12MB.

12 MB is the size of the installer that you provided. But 44 MB is the size when unpacked (sorry I have put 16 MB more when I said 60 MB).
majkinetor wrote:
Second you don't have to install anything but download compiled documentation somebody else will surely create for you as Ndoc is for person who maintance StdLib pack, not you

This would make me things easier :) , but I want to make the documentation myself.
majkinetor wrote:
Third, when you find yourself without documentation you will be able to read it from the source code, and if you happen to have that magical 12MB on your hard disk and you are bored reading help from the source code, you can unpack archive and type mkdoc to have HTML help there. and then you can safely delete natural docs.

Well, my mum gives me permission for creating a temp directory in the laptop with the condition that I would delete it. So I would download Natural Docs on the temp directory, unpack and make documentation. So I would delete the directory. OK?

Thanks for giving me a conclusion about this (I would use Natural Docs when neccesary).

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2007, 5:50 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
12 MB is the size of the installer that you provided. But 44 MB is the size when unpacked (sorry I have put 16 MB more when I said 60 MB).

I said on adequate place that it is big unpacked now, as I didn't remove all Perl modules NDoc doesn't use, ultimately, unpacked version of installer can approach <10MB.

Quote:
Well, my mum gives me permission for creating a temp directory in the laptop with the condition that I would delete it.

You better suggest your mom to learn to use computers. I have unpleasent feeling that some unknown woman side-influences one such important thing like stdlib design.

Honestly, the fact that you and mom have laptop war isn't our concern, nor you should post here "ideas" that rised out of that situation.

I know, you are just a kid.
But, guess what, I am just a kid too. :!:

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, JamixZol, mrhobbeys, MSN [Bot] and 25 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group