 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| How would you like to document StdLib Functions? |
| Documentation in the code? |
|
33% |
[ 4 ] |
| Create documentation in a web form/gui? |
|
16% |
[ 2 ] |
| Option to do both? |
|
33% |
[ 4 ] |
| Should there be only one way and everyone must stick with it? |
|
16% |
[ 2 ] |
|
| Total Votes : 12 |
|
| Author |
Message |
thefunnyman
Joined: 04 Aug 2007 Posts: 21
|
Posted: Sat Aug 18, 2007 7:35 pm Post subject: Standard Library Functions |
|
|
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 Fri Aug 31, 2007 3:49 pm; edited 3 times in total |
|
| Back to top |
|
 |
thefunnyman
Joined: 04 Aug 2007 Posts: 21
|
Posted: Sat Aug 18, 2007 11:14 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
thefunnyman
Joined: 04 Aug 2007 Posts: 21
|
Posted: Sun Aug 19, 2007 2:52 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Sun Aug 19, 2007 9:43 pm Post subject: |
|
|
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? _________________
(Common Answers) |
|
| Back to top |
|
 |
thefunnyman
Joined: 04 Aug 2007 Posts: 21
|
Posted: Sun Aug 19, 2007 9:57 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Aug 20, 2007 4:56 pm Post subject: |
|
|
| The stdlib and userlib don't currently support subfolders. However, that capability is under consideration for a future version. |
|
| Back to top |
|
 |
Andreone
Joined: 20 Jul 2007 Posts: 257 Location: Paris, France
|
Posted: Thu Aug 23, 2007 12:29 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Aug 23, 2007 4:27 pm Post subject: |
|
|
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. _________________
(Common Answers) |
|
| Back to top |
|
 |
thefunnyman
Joined: 04 Aug 2007 Posts: 21
|
Posted: Thu Aug 23, 2007 5:30 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1162 Location: Seville, Spain
|
Posted: Mon Aug 27, 2007 11:44 am Post subject: |
|
|
Hi,
I've seen this topic and I don't want to install a 60MB program (Natural Docs), because I use AHK in a 512MB USB flash drive and I normally got 3 MB of free space. For my submissions I would use a documentation style like AHK's helpfile. _________________ fincs
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list] |
|
| Back to top |
|
 |
Andreone
Joined: 20 Jul 2007 Posts: 257 Location: Paris, France
|
Posted: Mon Aug 27, 2007 3:09 pm Post subject: |
|
|
| Quote: | | I've seen this topic and I don't want to install a 60MB Shocked program (Natural Docs) |
NaturalDocs-1.35.zip = 344 357 bytes |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Mon Aug 27, 2007 3:16 pm Post subject: |
|
|
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
Conclusion
RTFM and inform yourself before trying to be "creative".  _________________

Last edited by majkinetor on Mon Aug 27, 2007 3:27 pm; edited 5 times in total |
|
| Back to top |
|
 |
Boo Guest
|
Posted: Mon Aug 27, 2007 3:22 pm Post subject: |
|
|
| Andreone wrote: | 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... |
|
| Back to top |
|
 |
fincs
Joined: 05 May 2007 Posts: 1162 Location: Seville, Spain
|
Posted: Mon Aug 27, 2007 4:08 pm Post subject: |
|
|
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
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list] |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Mon Aug 27, 2007 4:50 pm Post subject: |
|
|
| 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.  _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|