 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
thefunnyman
Joined: 04 Aug 2007 Posts: 22
|
Posted: Mon Sep 10, 2007 12:26 am Post subject: |
|
|
Just my 2 cents.
Will you be providing additional css options, such as the one that matches current AutoHotkey function documentation? I would think using that css for AHK StdLib functions would be the easiest to integrate into the current AHK Documentation structure. Very good option for StdLib documentation though. I do tend to agree with corrupt about allowing for the OPTIONAL use of a web form, although I wouldn't be the one to ask about writing it.
thanks. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2421
|
Posted: Mon Sep 10, 2007 2:22 am Post subject: |
|
|
| Titan wrote: | | corrupt wrote: | | A Natural Docs converter sounds like a great idea. | Glad to hear it. Would you like to work on it or shall I? | The ironic thing about that is that I would need to learn the syntax in order to put together a form that generates the correct syntax . I would be interested in putting together an AHK script with a GUI and a function and/or functions for processing the data entered in the GUI to produce the required data for Natural Docs to process. I haven't worked on html based forms for a while though and, unfortunately, I don't have a lot of experience in that area in general so it would probably take me considerably longer to produce anything useful. |
|
| Back to top |
|
 |
Elevator_Hazard
Joined: 28 Oct 2006 Posts: 302 Location: US
|
Posted: Mon Sep 10, 2007 2:36 am Post subject: |
|
|
Natural docs is hard in my opinion. It has less rules it seems, and the rules it has aren't uniform all around like xml is. _________________ Changed siggy at request of ahklerner  |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5376 Location: /b/
|
Posted: Mon Sep 10, 2007 9:42 am Post subject: |
|
|
| thefunnyman wrote: | | Will you be providing additional css options | As you can see there are place holders for 'AutoHotkey' and 'Plain' templates so I will most definitely add them soon.
| corrupt wrote: | | The ironic thing about that is that I would need to learn the syntax in order to put together a form that generates the correct syntax | Then I'll do it.
| Elevator_Hazard wrote: | | Natural docs is hard in my opinion. It has less rules it seems, and the rules it has aren't uniform all around like xml is. | Thanks for the feedback. majkinetor and I are the only ones who seem to be comfortable with this. _________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3644 Location: Belgrade
|
Posted: Mon Sep 10, 2007 10:56 am Post subject: |
|
|
Thx Titan for this work, and for nice idea that NaturalDoc web compiler will motivate ppl to standardize their comments.
I am really annoyed by comments and "ideas" you received here, and after reading all that, my desire to continue posting contributions to ahk community exponentionaly droped (again). _________________
 |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Mon Sep 10, 2007 11:47 am Post subject: |
|
|
| Quote: | | I am really annoyed by comments and "ideas" you received here, and after reading all that, my desire to continue posting contributions to ahk community exponentionaly droped (again). | Hey mate, to (re)act like that wouldn't much be much different to the actions which are annoying you. DON'T even think about it.*
* btw. I've accomplished to work with your GetTextSize() function. But haven't had the time to thank you for that. Thx & well done, Mr. finance clerk majkinetor
Go on Titan!  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6223
|
Posted: Mon Sep 10, 2007 12:10 pm Post subject: |
|
|
| majkinetor wrote: | | my desire to continue posting contributions to ahk community exponentionaly droped (again). |
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2421
|
Posted: Mon Sep 10, 2007 12:52 pm Post subject: |
|
|
| majkinetor wrote: | | I am really annoyed by comments and "ideas" you received here, and after reading all that, my desire to continue posting contributions to ahk community exponentionaly droped (again). | It's interesting that the "ideas" (suggestions) that Titan said in the first post had "inspired" this project have annoyed you. Since this project seems likely to continue to support Natural Docs comments in the code along with possibly other methods (a form for users to optionally fill in instead, hopefully), it sounds like this will end up appealing to the majority of people here that might be interested in contributing. I'm not sure I understand why that annoys you. It's a shame though since you seem to have experience with Natural Docs. Do you get motivated to contribute constructive ideas when you get annoyed? If so, I can provide a bit of additional motivation for fun . |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5376 Location: /b/
|
Posted: Mon Sep 10, 2007 4:02 pm Post subject: |
|
|
| majkinetor wrote: | | my desire to continue posting contributions to ahk community exponentionaly droped (again). | Now you know how Chris must feel lol. Although I'm disappointed in the lack of initiative people have with stdlib compliance I appreciate the honest feedback I get as it helps me develop the right set of tools that majority will be willing to use.
After a tiresome half hour of power PHP coding I'm pleased to announce the availability of Natural Docs Converter. _________________
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2421
|
Posted: Mon Sep 10, 2007 10:26 pm Post subject: |
|
|
Very nice work so far . Thanks
A few things I noticed:
- The version number is printed at the top where it says Function Reference instead of being printed after the title for the function.
- Returns is listed as the last param. in the function call in the blue area where the function call syntax is printed.
- The data I had entered in the Returns field did not end up in the generated documentation.
- The data I had entered in the Description field did not end up in the documentation
What would you think of adding an additional field at the end for Misc. information where the user could add additional details, known issues, requirements, etc... This section wouldn't need to follow any specific formatting (unless certain elements are not allowed due to Natural Docs formatting requirements). Just a general purpose area for adding additional text, something like the Description field. ...or is the Description field designed for this ? (I'm not sure where the description text is designed to appear as it didn't show here).
Another field that might be handy to have is a field for pasting a code example but that could probably also go in a Misc. field with the other Misc. information... |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Mon Sep 10, 2007 10:33 pm Post subject: |
|
|
Yes....Very very Nice....
However, with the below script, it is only giving me option to document the functions BGRtoRGB and ColorPicker.....
Any Ideas????
| Code: | #include GdiPlusHelper.ahk
Gui, +Lastfound ; +Resize
hGui := WinExist()
BGColor := 0xc0c0c0, FGColor := 0x000000
thispic := Grid_New(hGui, 20, BGColor, FGColor)
Gui, Add, GroupBox, x6 y10 w110 h110 , Background Color
Gui, Add, Progress, x76 y40 w30 h20 vBGColorProg c%BGColor%, 100
Gui, Add, Button, x16 y40 w50 h20 gSetBG_Color, Set
Gui, Add, GroupBox, x6 y130 w110 h50 , Foreground Color
Gui, Add, CheckBox, x16 y80 w90 h30 vUseGuiBGColor, Use Gui Color
Gui, Add, GroupBox, x6 y190 w110 h50 , Grid Size
Gui, Add, Button, x16 y150 w50 h20 gSetFG_Color, Set
Gui, Add, Progress, x76 y150 w30 h20 vFGColorProg c%FGColor%, 100
Gui, Add, Edit, x16 y210 w70 h20 vGrid_Size gGrid_Set
Gui, Add, UpDown, x86 y210 w20 h20 Range1-100, 25
Gui, Add, GroupBox, x126 y10 w220 h230 , Preview
Gui, Add, Picture, x136 y30 w200 h200 vPic1, %thispic%
; Generated using SmartGUI Creator 4.0
Gui, Show, x288 y258 h251 w358, New GUI Window
Return
;Gui, Add, CheckBox, ym vUseGuiBGColor, Use Gui color`n for Background
Gui, Add, Button, w100 gSetBG_Color, Set BG Color
Gui, Add, Button, w100 gSetFG_Color, Set FG Color
Gui, Add, Text, xm w100 , Set Grid Size
Gui, Add, Progress, ym w30 h20 vBGColorProg c%BGColor%, 100
Gui, Add, Progress, w30 h20 vFGColorProg c%FGColor%, 100
Gui, Add, Edit, vGrid_Size gGrid_Set, 100
Gui, Add, UpDown, Range1-100, 25
Gui, Add, Pic, x15 vPic1, %thispic%
;WinSet, TransColor, 0xC0C0C0, ahk_id %ThisPic_hwnd%
Gui, Show
Gosub, Grid_Set
return
SetBG_Color:
Gui, Submit, NoHide
BGColor := ColorPicker(hGui,BGColor)
If BGColor = -1
Return
ThisPic := Grid_New(hGui, Grid_Size, BGColor, FGColor)
GuiControl, , Pic1, %ThisPic%
BGColor2 := BGRtoRGB(BGColor)
GuiControl, +C%BGColor2%, BGColorProg
return
SetFG_Color:
Gui, Submit, NoHide
FGColor := ColorPicker(hGui,FGColor)
If FGColor = -1
Return
ThisPic := Grid_New(hGui, Grid_Size, BGColor, FGColor)
GuiControl, , Pic1, %ThisPic%
FGColor2 := BGRtoRGB(FGColor)
GuiControl, +C%FGColor2%, FGColorProg
return
BGRtoRGB(oldValue)
{
Value := (oldValue & 0x00ff00)
Value += ((oldValue & 0xff0000) >> 16)
Value += ((oldValue & 0x0000ff) << 16)
return Value
}
ColorPicker(OwnerGui,CurrentHexColor="")
{
SizeOfStructForChooseColor = 0x24
VarSetCapacity(StructForChooseColor, SizeOfStructForChooseColor, 0)
VarSetCapacity(StructArrayForChooseColor, 64, 0)
NumPut(SizeOfStructForChooseColor, StructForChooseColor, 0) ; DWORD lStructSize
NumPut(OwnerGui, StructForChooseColor, 4) ; HWND hwndOwner (makes dialog "modal").
NumPut(0x0 , StructForChooseColor, 8) ; HINSTANCE hInstance
NumPut(0x0 , StructForChooseColor, 12) ; clr.rgbResult = 0;
NumPut(&StructArrayForChooseColor , StructForChooseColor, 16) ; COLORREF *lpCustColors
NumPut(0x00000100 , StructForChooseColor, 20) ; Flag: Anycolor
NumPut(0x0 , StructForChooseColor, 24) ; LPARAM lCustData
NumPut(0x0 , StructForChooseColor, 28) ; LPCCHOOKPROC lpfnHook
NumPut(0x0, StructForChooseColor, 32) ; LPCTSTR lpTemplateName
nRC := DllCall("comdlg32\ChooseColorA", str, StructForChooseColor) ; Display the dialog.
if (errorlevel <> 0)
{
MsgBox error while calling ChooseColor Errorlevel: %errorlevel% - RC: %nRC%
return
}
If (nRC = 0)
return -1
; Otherwise, the user pressed OK in the dialog, so determine what was selected.
;GuiControl,, Color, % BGRtoRGB(ExtractInteger(StructForChooseColor, 12))
SetFormat, integer, hex ; Show RGB color extracted below in hex format.
return NumGet(StructForChooseColor, 12)
}
GetCurrentGuiBG()
{
;Retrieve from properties list
return 0xC0C0C0
}
#a::
Grid_Size += 10
#z::
Grid_Size -= 5
ThisPic := Grid_New(hGui, Grid_Size, BGColor, FGColor)
GuiControl, , Pic1, %ThisPic%
return
Grid_Set:
Gui, Submit, NoHide
ThisPic := Grid_New(hGui, Grid_Size, BGColor, FGColor)
GuiControl, , Pic1, %ThisPic%
return
Grid_New(hGui, $Size = 0, $BgColor = "0xC0C0C0", $FgColor="0x000000",$Weight=1) {
#GDIplus_mimeType_BMP = image/bmp
;GetGuiWidth()/Height
@OutWidth = 200
@OutHeight =200
fileName := "c:\_grid_.bmp"
;create grid in memory
;rect for background....same size as bitmap
VarSetCapacity(Rect, 16, 0)
DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&rect+ 8, UInt,4, UInt, @OutWidth)
DllCall("ntoskrnl.exe\RtlFillMemoryUlong", UInt,&rect+12, UInt,4, UInt, @OutHeight)
;Get the device context (DC) of the User GUI
hDc := API_GetDC(hGui)
;Create a DC in memory
memDC := API_CreateCompatibleDC( hDc )
;Create a bitmap compatible with the user gui
memBM := API_CreateCompatibleBitmap(hDC, @OutWidth, @OutHeight)
;Select the bitmap into the memory DC
DllCall( "gdi32.dll\SelectObject", "uint", memDC, "uint", memBM )
;Fill the background with the current background color..to give the appearance of tranparency
hBrush := DllCall("CreateSolidBrush", UInt, $BgColor) ; create the brush
DllCall("SelectObject", UInt,memDC, UInt,hBrush) ; select he brush
DllCall("FillRect", UInt,MemDC, Str,Rect, UInt,hBrush) ; Fill it
DllCall("DeleteObject", "UInt", hBrush) ; done with bg.....kill it
; Create a pen to draw with
hPen := DllCall("CreatePen", "UInt", 0, "UInt", $Weight, "UInt", $FgColor)
DllCall("SelectObject", "UInt", memDC, "UInt", hPen)
Loop, % @OutHeight / $Size ;vertical
{
; increase the x position by the Grid size
Line_x += $Size
; Set the begining of the line
DllCall("gdi32.dll\MoveToEx", "UInt", memDC, "Uint", Line_x, "Uint", 0, "Uint", 0 )
; Set the end of the line
DllCall("gdi32.dll\LineTo", "UInt", memDC, "UInt", Line_x, "UInt", 2000)
}
Loop,% @OutWidth / $Size ;horizontal
{
; increase the y position by the Grid size
Line_y += $Size
; Set the beginning of the line
DllCall("gdi32.dll\MoveToEx", "UInt", memDC, "UInt",0, "UInt", Line_y, "UInt", 0 )
; Set the end of the line
DllCall("gdi32.dll\LineTo", "UInt", memDC, "UInt", 2000, "UInt", Line_y)
}
DllCall("ReleaseDC", "UInt", 0, "UInt", memDc) ; Clean-up.
DllCall("DeleteObject", "UInt", hPen)
;save grid to file
If (GDIplus_Start() != 0)
Goto GDIplusError
DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", "UInt", memBM, "UInt", 0, "UIntP", bitmap )
DllCall("DeleteObject", "UInt", memBM)
If (GDIplus_GetEncoderCLSID(pngEncoder, #GDIplus_mimeType_BMP) != 0)
Goto GDIplusError
noParams = NONE
If (GDIplus_SaveImage(bitmap, fileName, pngEncoder, noParams) != 0)
Goto GDIplusError
Gosub GDIplusStop
return fileName
}
GDIPlus_CreateBitmapFromHBITMAP(hbm, hPal, Bitmap) {
return DllCall( "GDIplus\GdipCreateBitmapFromHBITMAP", "uint", hbm, "uint", hPal, "uintp", Bitmap )
}
API_GetDC( hwnd ){
return DllCall("GetDC", "uint", hwnd)
}
API_CreateCompatibleDC(hDC){
return DllCall("CreateCompatibleDC", "uint", hDC)
}
API_CreateCompatibleBitmap(hDC, hWidth, hHeight){
return DllCall( "gdi32.dll\CreateCompatibleBitmap" , "uint", hDC, "int", hWidth, "int", hHeight )
}
GDIplusError:
GDIplusStop:
If (#GDIplus_lastError != "")
MsgBox 16, GDIplus Test, Error in %#GDIplus_lastError%
GDIplus_Stop()
Return
esc::exitapp
|
EDIT:::: is it the opening bracket on the first function line causing it? |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5376 Location: /b/
|
Posted: Mon Sep 10, 2007 11:14 pm Post subject: |
|
|
| corrupt wrote: | - The version number is printed at the top where it says Function Reference instead of being printed after the title for the function.
- Returns is listed as the last param. in the function call in the blue area where the function call syntax is printed.
| Those are errors in the XSLT which I'll fix tomorrow.
| corrupt wrote: | - The data I had entered in the Returns field did not end up in the generated documentation.
- The data I had entered in the Description field did not end up in the documentation
|
| ahklearner wrote: | | However, with the below script, it is only giving me option to document the functions BGRtoRGB and ColorPicker..... | Thanks I think they're all fixed now.
| corrupt wrote: | | What would you think of adding an additional field at the end for Misc. information where the user could add additional details, known issues, requirements, etc... This section wouldn't need to follow any specific formatting (unless certain elements are not allowed due to Natural Docs formatting requirements). | I've added a 'Remarks' section. The XN1 template already allows direct embedding of HTML however the RDF needs to be hacked to declare the text/html type first. I'll throw in a few more regexes in the parser so this will happen automatically if HTML code is entered.
| corrupt wrote: | | Another field that might be handy to have is a field for pasting a code example but that could probably also go in a Misc. field with the other Misc. information... | It may sound overzealous but by using regex from PhiLho and toralf I think I could create a syntax highlighter for really good looking examples similar to the xpath 2.0 documentation. _________________
 |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Mon Sep 10, 2007 11:20 pm Post subject: |
|
|
Sweeeeeeeeeeeeeeeeeeeeeeeeeet......
Thaaaaaaaaaaaaaaaaaaaaaaanks Titan.
 |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5376 Location: /b/
|
Posted: Wed Sep 12, 2007 4:47 pm Post subject: |
|
|
With some advice from majkinetor I rewrote major parts of the script and made various enhancements. Take a look at the new examples or try uploading a script of your own. _________________
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2421
|
Posted: Thu Sep 13, 2007 6:16 am Post subject: |
|
|
The examples look great (except for the Example sections). A few things I noticed wih the current version:- The Returns field and the data I had entered in the Returns field did not end up in the generated documentation.
- The last param in the function call is not listed in the blue area showing the function call
- The last param and the data entered for the last param does not appear in the generated documentation.
- The Returns data seems to appear in the generated text but Returns section and data does not appear in the generated html
- The Remarks section seems to misalign text if the text contains long lines and carriage returns. It also seems to ignore the carriage returns in some cases (pasted from Notepad).
Would it be possible to add an option to upload a separate documentation file for processing instead of processing the file containing the script? This would remove the need for someone to have to either add the text to their script every time (which ends up having the documentation in 2 places - in the script and in the html) or having to specify the documentation file instead of the script then manually add their script to the zip file and remove the documentation text file.
When I had accidentally selected a copy of a script that did not contain the generated documentation the following was displayed: | Quote: | <br />
<b>Warning</b>: domxml_open_mem(): StartTag: invalid element name
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Opening and ending tag mismatch: link line 3 and head
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Opening and ending tag mismatch: td line 13 and table
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Opening and ending tag mismatch: tr line 11 and body
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag table line 11
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag body line 3
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag head line 3
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag html line 3
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag table line 1
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: domxml_open_mem(): Premature end of data in tag body line 1
in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>151</b><br />
<br />
<b>Warning</b>: process() expects parameter 1 to be object, boolean given in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>162</b><br />
<br />
<b>Fatal error</b>: Call to a member function on a non-object in <b>/share/storage/02/in/inspiration3/ahk/xn-docs/index.php</b> on line <b>163</b><br /> | Would it be possible to give the user an option to either return to the form and select a different file or open the Converter window to enter the help data if the help data was not found in the script that was specified? |
|
| 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
|