idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

Miller Medeiros
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

tommedema
Automatic wrapper creation?

Very good idea. Would love to see this worked out.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

Justin Donaldson-2
I did something pretty similar... externing the google maps/earth api:
http://lib.haxe.org/p/google-js-api

I wrote a quick-and-dirty ruby script to scrape their site:
http://pastie.org/1067964

However, it involved a fair amount of manual tweaking.
I'm sure there's all sorts of jsdoc config settings that would cause problems for an html scrapers.  It would be nice to work from xml, if it can provide a dump.

haXe has two upcoming features that will be really nice for externing:
  • partial structural typedef:  These will work great for those "option" objects tacked onto the ends of some javascript methods, they look like:
    foo(arg_string, ***{bar:9, baz:10}***)
    You could formulate a concrete type, and then allow subset structural matches to pass.  That would be awesome.
  • multitypes : I see these pretty regularly in google's apis.  They basically let you pass an object that fits one of several defined types.  They look like:
    foo: Bar|Baz;

-Justin



On Fri, Jul 30, 2010 at 5:28 PM, Tom <[hidden email]> wrote:
Automatic wrapper creation?

Very good idea. Would love to see this worked out.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

tommedema
One problem with wrapper generation is that Javascript does not have typing while haXe does. So, you need to manually detect the type returned and add it to the wrapper.

- Tom

2010/7/31 Justin Donaldson <[hidden email]>
I did something pretty similar... externing the google maps/earth api:
http://lib.haxe.org/p/google-js-api

I wrote a quick-and-dirty ruby script to scrape their site:
http://pastie.org/1067964

However, it involved a fair amount of manual tweaking.
I'm sure there's all sorts of jsdoc config settings that would cause problems for an html scrapers.  It would be nice to work from xml, if it can provide a dump.

haXe has two upcoming features that will be really nice for externing:
  • partial structural typedef:  These will work great for those "option" objects tacked onto the ends of some javascript methods, they look like:
    foo(arg_string, ***{bar:9, baz:10}***)
    You could formulate a concrete type, and then allow subset structural matches to pass.  That would be awesome.
  • multitypes : I see these pretty regularly in google's apis.  They basically let you pass an object that fits one of several defined types.  They look like:
    foo: Bar|Baz;

-Justin




On Fri, Jul 30, 2010 at 5:28 PM, Tom <[hidden email]> wrote:
Automatic wrapper creation?

Very good idea. Would love to see this worked out.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

Miller Medeiros
I'm not saying to generate the wrapper based on the JavaScript code, but generate based on the inline JSDoc (that sometimes has types: http://code.google.com/closure/compiler/docs/js-for-compiler.html )

JSDoc toolkit already parses the whole JS file and inline documentation and output the documentation (Similar to Flex ASDoc generation) so my idea would be to create a "template" for JSDoc Toolkit that instead of outputting HTML documentation generated Wrappers.. if it doesn't recognize the type would just leave it as untyped.

I think it would be helpful.
 
PS: they should release a new version of JSDoc toolkit (3.0) on September that will include support to more stuff..



2010/7/31 Tom <[hidden email]>
One problem with wrapper generation is that Javascript does not have typing while haXe does. So, you need to manually detect the type returned and add it to the wrapper.

- Tom

2010/7/31 Justin Donaldson <[hidden email]>

I did something pretty similar... externing the google maps/earth api:
http://lib.haxe.org/p/google-js-api

I wrote a quick-and-dirty ruby script to scrape their site:
http://pastie.org/1067964

However, it involved a fair amount of manual tweaking.
I'm sure there's all sorts of jsdoc config settings that would cause problems for an html scrapers.  It would be nice to work from xml, if it can provide a dump.

haXe has two upcoming features that will be really nice for externing:
  • partial structural typedef:  These will work great for those "option" objects tacked onto the ends of some javascript methods, they look like:
    foo(arg_string, ***{bar:9, baz:10}***)
    You could formulate a concrete type, and then allow subset structural matches to pass.  That would be awesome.
  • multitypes : I see these pretty regularly in google's apis.  They basically let you pass an object that fits one of several defined types.  They look like:
    foo: Bar|Baz;

-Justin




On Fri, Jul 30, 2010 at 5:28 PM, Tom <[hidden email]> wrote:
Automatic wrapper creation?

Very good idea. Would love to see this worked out.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: idea for a project: generate wrapper based on JSDoc / PHPDoc / etc..

tommedema
I know you want to base it on the JSDoc generated output. The same thing applies here, the javascript file won't have typing which is why the JSDoc output won't have types either and thus your wrapper won't either.

I think preserving types is one of the mayor reasons to wrap something, so just "leaving it as untyped" seems to beat the point to me.

It would be nice to somehow detect possible types, but I guess that's not possible in a reliable way.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
I'm not saying to generate the wrapper based on the JavaScript code, but generate based on the inline JSDoc (that sometimes has types: http://code.google.com/closure/compiler/docs/js-for-compiler.html )

JSDoc toolkit already parses the whole JS file and inline documentation and output the documentation (Similar to Flex ASDoc generation) so my idea would be to create a "template" for JSDoc Toolkit that instead of outputting HTML documentation generated Wrappers.. if it doesn't recognize the type would just leave it as untyped.

I think it would be helpful.
 
PS: they should release a new version of JSDoc toolkit (3.0) on September that will include support to more stuff..



2010/7/31 Tom <[hidden email]>

One problem with wrapper generation is that Javascript does not have typing while haXe does. So, you need to manually detect the type returned and add it to the wrapper.

- Tom

2010/7/31 Justin Donaldson <[hidden email]>

I did something pretty similar... externing the google maps/earth api:
http://lib.haxe.org/p/google-js-api

I wrote a quick-and-dirty ruby script to scrape their site:
http://pastie.org/1067964

However, it involved a fair amount of manual tweaking.
I'm sure there's all sorts of jsdoc config settings that would cause problems for an html scrapers.  It would be nice to work from xml, if it can provide a dump.

haXe has two upcoming features that will be really nice for externing:
  • partial structural typedef:  These will work great for those "option" objects tacked onto the ends of some javascript methods, they look like:
    foo(arg_string, ***{bar:9, baz:10}***)
    You could formulate a concrete type, and then allow subset structural matches to pass.  That would be awesome.
  • multitypes : I see these pretty regularly in google's apis.  They basically let you pass an object that fits one of several defined types.  They look like:
    foo: Bar|Baz;

-Justin




On Fri, Jul 30, 2010 at 5:28 PM, Tom <[hidden email]> wrote:
Automatic wrapper creation?

Very good idea. Would love to see this worked out.

- Tom

2010/7/31 Listas | Miller Medeiros <[hidden email]>
the idea is to create a JsDoc Toolkit ( http://code.google.com/p/jsdoc-toolkit/ ) template or a new parser from scratch that output an haXe wrapper based on the JavaScript documentation.

since JsDoc Toolkit already does a good job parsing the javascript file and documentations (and has a active community) I would recommend to create a new template that outputs a wrapper instead of outputting the HTML documentation (should be way easier).

not sure if it's possible or not, but it's an idea.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
blog: http://www.scwn.net
aim: iujjd
twitter: jjdonald


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org