GenDocs v3.0-alpha002 - Create StdLib documentation easily!
This is a complete rewrite of GenDocs 2.0. It now supports classes with methods, properties, constructors and embedded classes, as well as a Markdown-like syntax for formatting. There's even support for standalone custom pages!
For example: this script produces this output.
Download latest sources
Git repository
Don't forget to test!
I can't await to uninstall NDocs.
Can't test it today, but I will do tomorrow. Keep up the great stuff.
Visit me on github
Win7 HP SP1 64bit | AHK_L U 64bit
[*:7s4squpe]Are the ! at the beginning of the comment really necessary?
[*:7s4squpe]Some auto-detection feature of members or class ends would be coolI realize this is alpha, don't hurry
Visit me on github
Win7 HP SP1 64bit | AHK_L U 64bit
@maul.esel
It is not meant as offending, wanted just share my thoughts about your points:
[*:1qdpu5d2]resizable GUI looks nice, but I don`t care, as I would use this in an automated way with the commandline (hope its possible!)
[*:1qdpu5d2]I can live with the bang. It makes it very clear, what comment should be parsed and what not. Its ok for me, if this helps the parser. Also, there could be some comments, which should not be showed in the documentation (in example describing implementation details and workarounds).
[*:1qdpu5d2]Auto detection of members and classes sounds difficult.
My first thoughts after looking shortly in the example:
1. Auto detection of "function header". The user should just note the name, instead all parameters in "Function: something(a, b [, c])". The parameters can be extracted from the function definition itself and formatted like you did in this example. Would be much nicer and less error prone for the one who writes the documentation and forget to update the header. Just a little thing less to think about.
2. What is "Throws:"?
3. My suggestion is, that it accepts any header. Only some predefined headers like "function:" and so on have special meaning, but if it encounters unknown header name, it should accept it too.
4. Inline HTML/CSS/JS would be cool to have.
5. I think I am only interested in standalone single html file pages.
No signature.
[*:2j5ibss3]It's okay, I'm just very lazy and don't want to rewrite all my NDocs comments
[*:2j5ibss3]This is something that I think is really important. I can't say how difficult it is, however, some regexs already exist (TillaGoTo maybe).And I guess "Throws" contains the exceptions that might be thrown ;-)
I really (would) like the possibility to define custom pages. But [*:2j5ibss3]it should be also possible to put it all in one file, as Tuncay suggested.I think I am only interested in standalone single html file pages.
[*:2j5ibss3]I didn't look into your "page" keyword, but does it allow to define a new page from within the current document?I don't know anything about HTML, CSS, JavaScript etc (gonna learn this year ), but wouldn't there be the possibility to "simulate" pages without using separate files? Just a thought.
Visit me on github
Win7 HP SP1 64bit | AHK_L U 64bit
Command line already supported 8)I would use this in an automated way with the commandline (hope its possible!)
GenDocs.ahk scriptFile.ahk
The bang is neccessary, because it signals GenDocs to process this comment. doxygen does exactly the same.Are the ! at the beginning of the comment really necessary?
Some auto-detection feature of members or class ends would be cool
Those aren't possible without a full-blown AHK parser. Sorry (I already tried to look into removing the "End of class" section, but I couldn't come up with anything.)Auto detection of "function header".
What is "Throws:"
Exception throwing. The section is used to document the exceptions a function/whatever might throw.And I guess "Throws" contains the exceptions that might be thrown
I should really get that implemented. What would you like them to do? Currently it's nothing, they are ignoredMy suggestion is, that it accepts any header.
Indeed.Inline HTML/CSS/JS would be cool to have.
The way this new GenDocs is structured should make it easy to change the documentation generation backend.I think I am only interested in standalone single html file pages.
Already supported, see Test Page.I really (would) like the possibility to define custom pages.
Yes:but does it allow to define a new page from within the current document?
/*! Page: Test Page Filename: TestPage Contents: # Your Markdown markup here */
The markdown parser is there, it should be really easy to dump the generated HTML anywherebut wouldn't there be the possibility to "simulate" pages without using separate files?
Oh, if I think about it, you are right.Those aren't possible without a full-blown AHK parser. Sorry Sad (I already tried to look into removing the "End of class" section, but I couldn't come up with anything.)
Uh yes... I am silly!What is "Throws:"
About the "any header" implementation. I mean with any header the names with colon like "function:", "Filename:" ... I dont see any point why you should maintain explicitly so many header names. You have just a default handling, for unknown headers: Just convert the description to a paragraph without special fancy things, like in "Remarks:". Those who have special meaning, have special handling like "Page:".
A simple conversion script could help you.I'm just very lazy and don't want to rewrite all my NDocs comments
The reason for support of inline HTML and CSS (and probably, just probably JavaScript) is not to create new pages. It allows some simple structures you have in your mind, without GenDocs handling. In example, you need a table and GenDocs have no support for tables, but HTML. You just create a HTML Table and integrate it. Thats all. Or you just use some markups like <b> or other stuff.I don't know anything about HTML, CSS, JavaScript etc (gonna learn this year Smile), but wouldn't there be the possibility to "simulate" pages without using separate files? Just a thought.
Just an idea how it could look: Look whole block for html
/*!HTML Library: Test library, version 1.0 This library does something or maybe not! <i style="">In</i>-paragraph line breaks work Author: fincs License: WTFPL */Or there is a settings header for HTML, to enable or disable (positional) without need for marking each comment block.
/*! Settings: HTML=1, KEY=0 */ /*! Library: Test library, version 1.0 This library does something or maybe not! <i style="">In</i>-paragraph line breaks work Author: fincs License: WTFPL */Off course, HTML is excluded from code sections. These are just some brainstorming thoughts and not deliberate wishes.
No signature.
I like the ideaJust an idea how it could look: Look whole block for html
(...)
Or there is a settings header for HTML, to enable or disable (positional) without need for marking each comment block.
BTW, what does KEY=0 mean?
I just found some minutes to test it. I cant say much now, but it should get rid of the "End of class" declaration! The generated doc looks really nice.
No signature.
If you like, look at my library para - Paragraph beautifier (a text formatter) for text (not code).
Also I miss a header for ErrorLevel. (Could be easily solved with "any header" support.)
No signature.
Yes, although you should be able to use any type of indentation. I think that even nothing is supported as indentation for the header lines, haven't tested it out thoughthe indentation of headers (like "Constructor:") are important. Is this by design?
/*! Function: whatever(...) Blah blah blah ... */
That is part of the Markdown spec: if a line ends with two spaces, it should generate a <br/>.Also found out, if a line ends with two spaces, a newline is generated in the html. Same in Firefox and Internet Explorer.
I don't see how it could be used. Text indentation is done through CSS, and the rest is done automatically by the rendering engine AFAIK...If you like, look at my library para - Paragraph beautifier (a text formatter) for text (not code).
No signature.
/*! Class: MyClass This is a description. Variables: path - contains the file path associated with the object. data - the bare data. Example: @file:myclass_example.ahk */Or is there any other place where these should be put to? Also a Remarks section should be there too. I like your tool. It is going to replace Natural Docs. Hope it gets the standard in our community. I would encourage everyone to use it!
No signature.
Obsoleted by throwAlso I miss a header for ErrorLevel.
You can do all of that already: (gen'd HTML)I would like to describe and list the member this.variables in the Class description.
...
Also a Remarks section should be there too.
/*! Class: MyClass This is a description. Extra: ## Remarks Your remarks go here Example: @file:myclass_example.ahk @UseShortForm */ /*! Property: path [get/set] Contains the file path associated. */ /*! Property: data [get/set] The bare data. */ /*! End of class */I do agree though that it would be a good idea to have the Class docu generator support the Remarks section. I'll add it
Thank you for your support! :oops:It is going to replace Natural Docs. Hope it gets the standard in our community. I would encourage everyone to use it!
About ErrorLevel. It is part of AutoHotkey and what if someone with AutoHotkey prior to 1.1 want use your documentation tool? We have many users who use Basic still... you know. And what if someone is new to AHK and do not want to use Throw. Also, I have my own usage with ErrorLevel still. It is not obsolete, so please support it!
In example, if Throw is used, the function have to use Try... Catch block. Otherwise he gets a runtime Error. But I like to describe errors through ErrorLevel, if they are not that important. The script can work still and will not be aborted then.
No signature.