DocGen - Open Source

Blitz3D Forums/Blitz3D Programming/DocGen - Open Source

Paul "Taiphoz"(Posted 2004) [#1]
Document Generator

Front End


Sample of the HTML it outputs.
http://www.teamrebellion.com/DocGen/Output/Doc.htm

Sample of one of the source files used in the above. to show you the simple and easy to insert tags the parser looks for.
Function Move%(x,y)
	;<Arguments>
	;  	X% : Integer - Players X Position
	;	Y% : Integer - Players Y Position
	;</Arguments>
	
	Local help_x,help_y

	
End Function


Function Move.Player(x%,y%,speed#,Direction#)
	;<Arguments>
	;  	X% 			: 	Integer - 	Players X Position
	;	Y% 			: 	Integer - 	Players Y Position
	;	Speed#		:	Real	-	The Speed to move the player
	;	Direction	:	Real	-	The Angle in which to move the player.
	;</Arguments>
	
	;<Description>
	;	This functions takes the players current X and Y position
	;	And then uses this along with the Speed and anlge the player
	;	is facing to calculate the new position the player will be in.
	;</Description>

	Local someVar	;	This variable is used for something.
	Local ExtraVar	;	This is another var used in this function for something.
	
	For looper=1 To 100
		moveplayer(x,y)
	Next
	
End Function



The >>> OLD SOURCE JUST NOW <<< - new stuff will go up soon.
http://www.teamrebellion.co.uk/DocGen.zip

The Bottom line : This applications takes a list of source files from your blitz3D or Plus projects, it strips away all of your funstions globals locals arrays types and it strips out all of your comments from each of those by using a simple tagging system.

I hope that when this is finished it will be able to scan through upto 100(array size i set) source files and create nice fully customizable html documention from them.

If you work in a programming team, and you have more than one person working on the same source, then this is what you want, it will create a base set of documentation for your entire application or game and enable you to upload it to the net allow all your team members easy access to it, allowing them to quickly find functions or variables.

:)


the_cre8or(Posted 2004) [#2]
great tool, i love the idea, great about it being open source, this will be amazing for my projects, thanks!


Paul "Taiphoz"(Posted 2004) [#3]
I think Im going to try and add some sort of GUI front end to it.

that will allow you to select the files you want to parse, but im crap with GUI's in blitz.


ckob(Posted 2004) [#4]
I tried it out and its pretty far along I was thinking why not use Blitzplus for the GUI?


Paul "Taiphoz"(Posted 2004) [#5]
Well I dont have blitz plus. :/

We could make the parser and frontend different exe's. and have a nice Blitz Plus front end just pass the parser.exe file the filepath to the file its going to parse.

I think whats important is that it should be able to parse a list of source files. so it can handle a full project.


N(Posted 2004) [#6]
I already wrote two DocGen scripts (both open source):

http://s87776868.onlinehome.us/stuff/DocGen.zip (Output)
http://s87776868.onlinehome.us/stuff/DocGen2.zip (Output)

Both're Ruby scripts.

Just thought I'd let you know, in case you want to avoid any name conflicts (not that it makes any difference to me).


ckob(Posted 2004) [#7]
well in Bltzplus just throw this line right before the commandline command and comment that out
path$=RequestFile$("source to load","bb,b+,bp")


Paul "Taiphoz"(Posted 2004) [#8]
@ Noel, you the output looks like what I would be aiming for with this project.

It looks to me like you could help a lot..


N(Posted 2004) [#9]
Yavin: If you have any questions on how to do one thing or another, don't hesitate to ask.


Paul "Taiphoz"(Posted 2004) [#10]
Well first of all, im trying to get you on msn. Ion gave me your msn name but cant seem to get you aded.

Anyway, Yeah I have a few questions, would you be willing to help me rework the code I have just now to produce the output thats got the dark theme ?

This is my first attempt at something like this which is why iv gone open source with it. ie I hope some peeps will jump in and help out with the code.


N(Posted 2004) [#11]
would you be willing to help me rework the code I have just now to produce the output thats got the dark theme ?


Mostly it's just the CSS/HTML doing the dark coloring. As long as you've got a fairly robust knowledge of how to use the two, it's easy as pie.


Paul "Taiphoz"(Posted 2004) [#12]
I was meaning more the parsing of the blitz souce file.

How did you structure your comments and did you use tags ?


Paul "Taiphoz"(Posted 2004) [#13]
HTML and CSS has now been updated.

I will upload them along with some code tweaks and tag changes once its done. some time tonight with luck if I can slot the time in.

I have also now decided to change the current tags in use, After having a close look at Noel's Ruby version I have realised that there is only need for about 3 mby 4 tags. these being.

<Arguments>
player ID - the player to hit.
</Arguments>

<Description>
This function takes damage from player and returns
player helth
</Description>

<Return Value>
Integer - The number of health left
</Return Value>

<uses>
player.bb
colour.bb
</uses>

above is a little example of the tags. and how they would be used.

I am going to try and stream line these a little more once the app can generate a list of globals and comments and output that to the new theme.


Paul "Taiphoz"(Posted 2004) [#14]
Added a much better way editing the look and feel of the decuments the app generates.

Just need to work on the parsing of functions and stuff a but more now.


Paul "Taiphoz"(Posted 2004) [#15]
Im now ready to make a start on the GUI, can anyone recomend one thats free and easy to use ?


Bot Builder(Posted 2004) [#16]
I would suggest Blitz UI but I can't seem to find it. It might have been on blitzcoder, and that's down.


Spinduluz(Posted 2004) [#17]
BlitzUI


Paul "Taiphoz"(Posted 2004) [#18]
Ahh thanks.

FYI this app is now 40% done, the main function parser is now done and the tags are the same for the other code types. so the parsing code is about 80% done now.

Im now going to use BlitzUI to code up a nice little UI, from this, providing BUI has an editbox you will be able to edit your header and footer html data and then test the output.

Unless anyone asks for it I am going to wait till its finished now before uploading anything new.

As it dosent seem to be getting much attention.


N(Posted 2004) [#19]
Use BlitzUI, it's without a doubt the easiest to use for free.


Paul "Taiphoz"(Posted 2004) [#20]
WOOHOO.

lol Im getting right into this now.

OK so now I have a front end Written in Delphi for speed an ease of use, The Front End is seperate from the Parser so you guys can code your own front end if you want.

The Parser then takes a text file which holds a list of all of the files that are to be parsed, it then goes through them all ripping out all of the functions and the function tag data.

It then Generates a nice looking HTML page with all the documentation on it.

I will upload the test iv been working on along with some screen shots of the front end and a link to the html it creates.


Paul "Taiphoz"(Posted 2004) [#21]
I have updated my top post.