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!
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett andrew@epstone.net wrote: [...]
Enjoy!
The only thing it spits out are errors in my JavaScript console... (FF3)
Bryan
On Sun, Nov 9, 2008 at 10:58 PM, Bryan Tong Minh bryan.tongminh@gmail.com wrote:
The only thing it spits out are errors in my JavaScript console... (FF3)
It was tested in FF3. What errors?
On Sun, Nov 9, 2008 at 1:00 PM, Andrew Garrett andrew@epstone.net wrote:
On Sun, Nov 9, 2008 at 10:58 PM, Bryan Tong Minh bryan.tongminh@gmail.com 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 Wikitech-l@lists.wikimedia.org 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
On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh bryan.tongminh@gmail.com 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.
On Sun, Nov 9, 2008 at 1:35 PM, Andrew Garrett andrew@epstone.net wrote:
On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh bryan.tongminh@gmail.com 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 Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Works and looks handy. Syntax highlighting would be nice.
Bryan
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 bryan.tongminh@gmail.com:
On Sun, Nov 9, 2008 at 1:35 PM, Andrew Garrett andrew@epstone.net wrote:
On Sun, Nov 9, 2008 at 11:31 PM, Bryan Tong Minh bryan.tongminh@gmail.com 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 Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Works and looks handy. Syntax highlighting would be nice.
Bryan
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Mon, Nov 10, 2008 at 12:26 AM, Nicolas Dumazet nicdumz@gmail.com 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.
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett andrew@epstone.net 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
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)
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 andrew@epstone.net wrote:
From: Andrew Garrett andrew@epstone.net Subject: [Wikitech-l] Fancy AJAX MediaWiki code reference To: "Wikimedia developers" wikitech-l@lists.wikimedia.org 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 Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Sun, Nov 9, 2008 at 12:17 PM, Andrew Garrett andrew@epstone.net 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.
wikitech-l@lists.wikimedia.org