Re: svn: /web/php/trunk/ include/header.inc js/common.js js/jquery.autocomplete.js js/jquery.autocomplete.pack.js styles/structure.css
styles/theme.css
| From: | Stewart Lord | Date: | Wed, 29 Dec 2010 19:30:32 +0000 |
| Subject: | Re: svn: /web/php/trunk/ include/header.inc js/common.js js/jquery.autocomplete.js js/jquery.autocomplete.pack.js styles/structure.css styles/theme.css |
||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-9952@lists.php.net to get a copy of this message | ||
On 2010-12-29, at 12:47 AM, Hannes Magnusson wrote:
> The generated index comes directly from the Docbook sources, so as
> long as the src is correct, the capitalization will be correct.
>
> I did look into supporting variable search, constants, etc etc.
>
> array(
> "refentry" => array(
> array("strpos" => "function.strpos"),
> ),
> "phpdoc:varentry" => array(
> array("$http_response_headers" =>
> "reserved.variables.httpresponseheader"),
> ),
> "phpdoc:classref" => array(
> array("DOMDocument" => "class.domdocument")
> ),
> "appendix" => array(
> array("Userland Naming Guide" => "userlandnamgin.global")
> ),
> )
> would be the structure of the searchIndex..
What about something more like this:
array(
array("strpos", "function.strpos", "function"),
array("DOMDocument", "class.domdocument", "class"),
array("Userland Naming Guide", "userlandnamgin.global", "appendix")
)
I think this would give us the biggest bang-for-buck.
It would allow the user to match a lot more stuff via the auto-complete (with minimal changes) and
we could add a poor man's categorization by simply appending the type/category to the end of
the entry when we display it in the drop-down, e.g.:
strpos (function)
DOMDocument (class)
Userland Naming Guide (appendix)
The parenthesized text could be greyed out.
> Or provide multiple index files, one per type. Then we could decide
> not to push examples, or callouts, or whatever types to the user by
> simply commenting it out..
I think this would add a fair bit of complexity and would require a rewrite of the current JS.
> I didn't spend much time on it in javascript land after I figured out
> it actually sorts the entire index everytime :P
Ya, that seemed like the shortest way to get the desired effect. We will always have to scan through
every entry in the index (not much of an index is it!), but it could be made more efficient by not
sorting everything. Still, it seems pretty much instantaneous on my machine. JS is so damn fast
these days!
> Was more looking at what kind of data we can get for free from PhD
> without needing specific runs.. Looks like we can extract prettymuch
> whateverwe want in under a second while generating the docs.
That's awesome!
Cheers,
Stew