Fancy AJAX MediaWiki code reference

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

Fancy AJAX MediaWiki code reference

Bugzilla from andrew@epstone.net
Hi all,

Usually, for code documentation, we've either grepped the code for the
method we wanted to look for, or used doxygen. I'm sure many of us
have found doxygen a little too clunky, with too many clicks to find
the required information.

For fun, I ran a perl script to parse our source code and pick out
function data. Then I wrote a simple web-interface that searches for
functions as you type, displaying a list of declaration lines, with a
[show] link to show the full code of the function.

I thought this might be useful to some people who constantly grep
through the code to find out the arguments to a function.

The site is available at:
<http://mwref.werdn.us>

The source code for the Perl script, and the website, is available in
the 'mwref' directory on my git repository. Patches are most welcome!
<http://gitweb.werdn.us/?p=scripts/.git;a=summary> (web interface)
<git://werdn.us/scripts/> (git repository)

A database dump of the extracted function data is available to
download (~1 MB) from my server:
<http://werdn.us/~andrew/mw_reference.sql.gz>

Enjoy!

--
Andrew Garrett

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bryan Tong Minh
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett <[hidden email]> wrote:
[...]
>
> Enjoy!
>

The only thing it spits out are errors in my JavaScript console... (FF3)


Bryan

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bugzilla from andrew@epstone.net
On Sun, Nov 9, 2008 at 10:58 PM, Bryan Tong Minh
<[hidden email]> wrote:
>
> The only thing it spits out are errors in my JavaScript console... (FF3)
>

It was tested in FF3. What errors?

--
Andrew Garrett

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bryan Tong Minh
On Sun, Nov 9, 2008 at 1:00 PM, Andrew Garrett <[hidden email]> wrote:

> On Sun, Nov 9, 2008 at 10:58 PM, Bryan Tong Minh
> <[hidden email]> wrote:
>>
>> The only thing it spits out are errors in my JavaScript console... (FF3)
>>
>
> It was tested in FF3. What errors?
>
> --
> Andrew Garrett
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
Fout: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]"
nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS
frame :: http://mwref.werdn.us/mwref.js :: doSearch :: line 110"
data: no]
Bronbestand: http://mwref.werdn.us/mwref.js
Regel: 110

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bugzilla from andrew@epstone.net
On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh
<[hidden email]> wrote:
> Fout: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]"
> nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS
> frame :: http://mwref.werdn.us/mwref.js :: doSearch :: line 110"
> data: no]
> Bronbestand: http://mwref.werdn.us/mwref.js
> Regel: 110

I've attempted a fix. Try now.

--
Andrew Garrett

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bryan Tong Minh
On Sun, Nov 9, 2008 at 1:35 PM, Andrew Garrett <[hidden email]> wrote:

> On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh
> <[hidden email]> wrote:
>> Fout: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]"
>> nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS
>> frame :: http://mwref.werdn.us/mwref.js :: doSearch :: line 110"
>> data: no]
>> Bronbestand: http://mwref.werdn.us/mwref.js
>> Regel: 110
>
> I've attempted a fix. Try now.
>
> --
> Andrew Garrett
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
Works and looks handy. Syntax highlighting would be nice.


Bryan

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Nicolas Dumazet
Looks good !

Maybe the parsing could be improved so the function documentation can
be included with the full code too ? Currently we do get documentation
at the end of the code, but the documentation from the _next_ function
=) (as an example, see the behavior for wfMsg code display)

Also what about adding the filepath somewhere ?

2008/11/9 Bryan Tong Minh <[hidden email]>:

> On Sun, Nov 9, 2008 at 1:35 PM, Andrew Garrett <[hidden email]> wrote:
>> On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh
>> <[hidden email]> wrote:
>>> Fout: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]"
>>> nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  location: "JS
>>> frame :: http://mwref.werdn.us/mwref.js :: doSearch :: line 110"
>>> data: no]
>>> Bronbestand: http://mwref.werdn.us/mwref.js
>>> Regel: 110
>>
>> I've attempted a fix. Try now.
>>
>> --
>> Andrew Garrett
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> [hidden email]
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
> Works and looks handy. Syntax highlighting would be nice.
>
>
> Bryan
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>



--
Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Bugzilla from andrew@epstone.net
On Mon, Nov 10, 2008 at 12:26 AM, Nicolas Dumazet <[hidden email]> wrote:
> Looks good !
>
> Maybe the parsing could be improved so the function documentation can
> be included with the full code too ? Currently we do get documentation
> at the end of the code, but the documentation from the _next_ function
> =) (as an example, see the behavior for wfMsg code display)

The behaviour for wfMsg et al was a bug, which I've fixed.

Adding the documentation is an excellent idea, which I'll try to work
into the parser.

> Also what about adding the filepath somewhere ?

At the moment, the parser works by having the code piped through to it
on stdio, which isn't conducive to file locations; but the idea has
certainly been on my radar.

--
Andrew Garrett

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Marco Schuster-2
In reply to this post by Bugzilla from andrew@epstone.net
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett <[hidden email]> wrote:
> For fun, I ran a perl script to parse our source code and pick out
> function data. Then I wrote a simple web-interface that searches for
> functions as you type, displaying a list of declaration lines, with a
> [show] link to show the full code of the function.
Can you please make a double-click on the function name also show the code?

Marco

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Roan Kattouw
In reply to this post by Bugzilla from andrew@epstone.net
Andrew Garrett schreef:

> Hi all,
>
> Usually, for code documentation, we've either grepped the code for the
> method we wanted to look for, or used doxygen. I'm sure many of us
> have found doxygen a little too clunky, with too many clicks to find
> the required information.
>
> For fun, I ran a perl script to parse our source code and pick out
> function data. Then I wrote a simple web-interface that searches for
> functions as you type, displaying a list of declaration lines, with a
> [show] link to show the full code of the function.
>
> I thought this might be useful to some people who constantly grep
> through the code to find out the arguments to a function.
>
> The site is available at:
> <http://mwref.werdn.us>
I get this funny bug when searching for "getUserPermiss", which lists
Title::getUserPermissionsErrorsInternal(), but not
Title::getUserPermissionsErrors(). Also, function global::wfMsg( $key )
is kind of confusing, the global:: part should be dropped.

There's also some buggy behavior that seems to be intermittent, and I
think I know what causes it. When I type "getdb", for instance, I'll get
a list of everything that starts with "getdb", but a few seconds later I
get a list of everything starting with "get". What I *think* is
happening here is that the request for "get" takes longer than the
requests for "getd" and "getdb" and overwrites their results.

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

David Vandervort
In reply to this post by Bugzilla from andrew@epstone.net
At the exact moment I was reading this message I was grepping through the code. Your page was faster.

Thank you.



--- On Sun, 11/9/08, Andrew Garrett <[hidden email]> wrote:

> From: Andrew Garrett <[hidden email]>
> Subject: [Wikitech-l] Fancy AJAX MediaWiki code reference
> To: "Wikimedia developers" <[hidden email]>
> Date: Sunday, November 9, 2008, 6:17 AM
> Hi all,
>
> Usually, for code documentation, we've either grepped
> the code for the
> method we wanted to look for, or used doxygen. I'm sure
> many of us
> have found doxygen a little too clunky, with too many
> clicks to find
> the required information.
>
> For fun, I ran a perl script to parse our source code and
> pick out
> function data. Then I wrote a simple web-interface that
> searches for
> functions as you type, displaying a list of declaration
> lines, with a
> [show] link to show the full code of the function.
>
> I thought this might be useful to some people who
> constantly grep
> through the code to find out the arguments to a function.
>
> The site is available at:
> <http://mwref.werdn.us>
>
> The source code for the Perl script, and the website, is
> available in
> the 'mwref' directory on my git repository. Patches
> are most welcome!
> <http://gitweb.werdn.us/?p=scripts/.git;a=summary>
> (web interface)
> <git://werdn.us/scripts/> (git repository)
>
> A database dump of the extracted function data is available
> to
> download (~1 MB) from my server:
> <http://werdn.us/~andrew/mw_reference.sql.gz>
>
> Enjoy!
>
> --
> Andrew Garrett
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l


     

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Tei-2
In reply to this post by Bugzilla from andrew@epstone.net
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett <[hidden email]> wrote:
..

>
> I thought this might be useful to some people who constantly grep
> through the code to find out the arguments to a function.
>
> The site is available at:
> <http://mwref.werdn.us>
>
> The source code for the Perl script, and the website, is available in
> the 'mwref' directory on my git repository. Patches are most welcome!
> <http://gitweb.werdn.us/?p=scripts/.git;a=summary> (web interface)
> <git://werdn.us/scripts/> (git repository)
>
> A database dump of the extracted function data is available to
> download (~1 MB) from my server:
> <http://werdn.us/~andrew/mw_reference.sql.gz>

Is great!.

But maybe you can make so clicking on the function name open the body.
Now you have to look to the right colum figure what is the correct
[show function] link.


--
--
ℱin del ℳensaje.
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Fancy AJAX MediaWiki code reference

Sylvain Brunerie
Really great! Thanks! =)
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l