Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 20, 2010 dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
One of the (few) things I like about PHP is the ease with which you can get to the docs. You can just put the name into your browser, and it comes right up: php.net/strpos I set up something similar for D today: dpldocs.info. (I tried to find a better name, but everything else I thought up was already taken.) dpldocs.info/std.string.indexOf Will automatically redirect you to the right place on the Digital Mars website. I do this with a simple script manipulating the string. You have to do a full name - std.string.chop rather than just chop. Future directions for it would be to make it a smart searcher, so you wouldn't need to use perfect fully qualified names anymore. It would be nice to have a category listing of functions in Phobos too, so you can find things without knowing the module or function names. But, I'm short on time, so the simple redirect is all I'll have for now. |
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Ruppe | "Adam Ruppe" <destructionator@gmail.com> wrote in message news:mailman.75.1266687820.4461.digitalmars-d-announce@puremagic.com... > One of the (few) things I like about PHP is the ease with which you can get to the docs. You can just put the name into your browser, and it comes right up: > > php.net/strpos > > I set up something similar for D today: dpldocs.info. (I tried to find a better name, but everything else I thought up was already taken.) > > dpldocs.info/std.string.indexOf > > Will automatically redirect you to the right place on the Digital Mars website. I do this with a simple script manipulating the string. You have to do a full name - std.string.chop rather than just chop. > > Future directions for it would be to make it a smart searcher, so you wouldn't need to use perfect fully qualified names anymore. It would be nice to have a category listing of functions in Phobos too, so you can find things without knowing the module or function names. > > But, I'm short on time, so the simple redirect is all I'll have for now. Sounds great! Another neat thing would be jumping to documentation on D's predefined tokens, identifiers and operators. I can't tell you how many times I've gone nuts trying to search for the documentation on "is"! |
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Sat, Feb 20, 2010 at 08:47:03PM -0500, Nick Sabalausky wrote: > Sounds great! > > Another neat thing would be jumping to documentation on D's predefined tokens, identifiers and operators. I can't tell you how many times I've gone nuts trying to search for the documentation on "is"! Yes, it would definitely be nice. It is a bit harder to find the right page for them though. I eyeballed a handful of ones I look up a lot and special cased them in the website. When I write the full search and have the time to index up some keywords (some can be automatically pulled out of ddoc, but some will have to be done by humans to give decent results), it will get better. Here's the ones I just added: is() expressions: http://dpldocs.info/is traits: http://dpldocs.info/traits array literals: http://dpldocs.info/array function literals: http://dpldocs.info/function structs: http://dpldocs.info/struct classes: http://dpldocs.info/class operator overloading: http://dpldocs.info/op templates: http://dpldocs.info/template I also just changed it to direct you to the module page if you don't give a function: http://dpldocs.info/std.traits <-- brings you to the traits page http://dpldocs.info/std.traits.isIntegral <-- to the function specifically And: http://dpldocs.info/phobos or http://dpldocs.info/std brings you to the Phobos homepage. You can also type any of these into the box on the homepage, of course. -- Adam D. Ruppe http://arsdnet.net |
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Ruppe | On Sat, 20 Feb 2010 12:15:35 -0500, Adam Ruppe wrote: > Future directions for it would be to make it a smart searcher http://www.haskell.org/hoogle/?hoogle=Int+->+String This is quite advanced doc search for Haskell. In the example link I search for function that convert int to string, but generally it takes any part of of the function signature, and tries to return best matches. |
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michal Minich | On Sun, Feb 21, 2010 at 11:59:25AM +0000, Michal Minich wrote: > This is quite advanced doc search for Haskell. In the example link I search for function that convert int to string, but generally it takes any part of of the function signature, and tries to return best matches. A complication with this for Phobos is templates. Given a signature like: T to(T, S)(S s); What would match that? The search engine perhaps could understand templates and their constraints, but I'd still expect a lot of false positives or false negatives. If it is just input and output, I'd expect int indexOf(string); To get a higher score than the to!() template, too but that isn't accurate for what the user intended. It'd be cool if it worked, but I think it would take a lot of time to code up something that works well. What I have in mind here is a list of weighted keywords - an easy implementation that will hopefully give good enough results after the initial database population. -- Adam D. Ruppe http://arsdnet.net |
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam Ruppe | On 02/20/2010 06:15 PM, Adam Ruppe wrote:
> One of the (few) things I like about PHP is the ease with which you
> can get to the docs. You can just put the name into your browser, and
> it comes right up:
>
> php.net/strpos
>
> I set up something similar for D today: dpldocs.info. (I tried to find
> a better name, but everything else I thought up was already taken.)
>
> dpldocs.info/std.string.indexOf
>
> Will automatically redirect you to the right place on the Digital Mars
> website. I do this with a simple script manipulating the string. You
> have to do a full name - std.string.chop rather than just chop.
>
> Future directions for it would be to make it a smart searcher, so you
> wouldn't need to use perfect fully qualified names anymore. It would
> be nice to have a category listing of functions in Phobos too, so you
> can find things without knowing the module or function names.
>
> But, I'm short on time, so the simple redirect is all I'll have for now.
Thank you for this!
|
February 21, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Attachments:
| On Sun, Feb 21, 2010 at 05:43, Adam D. Ruppe <destructionator@gmail.com>wrote: > On Sat, Feb 20, 2010 at 08:47:03PM -0500, Nick Sabalausky wrote: http://dpldocs.info/phobos or http://dpldocs.info/std brings you to the Phobos homepage. > > > > You can also type any of these into the box on the homepage, of course. > > Thanks Adam, that's definitely useful and it's now part of my bookmarks! Would it be difficult for it to say 'no match, sorry' and stay on your page when we make a mistake, instead of doing a 404 on digitalmars? Philippe |
February 22, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
On Sun, Feb 21, 2010 at 02:36:47PM +0100, Philippe Sigaud wrote: > Thanks Adam, that's definitely useful and it's now part of my bookmarks! Primitive, but I coded up a basic keyword search, with the database populated from names of all the functions pulled out of the phobos docs on my local box. They are a couple versions behind - I'll update at the next dmd. It should be good enough for now anyway. http://dpldocs.info/search.php You can punch in some keywords, and it dumps a sorted list at you. The matches are based on function name, module name, then a list of tags (currently empty - I'll probably need help filling them out!). Exact matches give higher scores, but it dumps just about anything that remotely seems close. Once I'm happy with it, I'll merge its functionality right into the homepage. > Would it be difficult for it to say 'no match, sorry' and stay on your page when we make a mistake, instead of doing a 404 on digitalmars? Should be good now. Once I merge the new search function in to the homepage, I'm hoping to give /something/ helpful on every search, so this shouldn't happen anymore. > > > Philippe -- Adam D. Ruppe http://arsdnet.net |
February 22, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
On Sun, Feb 21, 2010 at 07:23:49PM -0500, Adam D. Ruppe wrote: > Once I'm happy with it, I'll merge its functionality right into the homepage. Well, I'm happy with it. More than I thought I'd be too - my simple algorithm is giving decent results with just a minimal number of hand edits! And, of course, the results should only get better with more tweaking. http://dpldocs.info/ Thanks for all the encouragement everyone. -- Adam D. Ruppe http://arsdnet.net |
February 22, 2010 Re: dpldocs.info - easy redirect to phobos docs | ||||
---|---|---|---|---|
| ||||
Attachments:
| On Mon, Feb 22, 2010 at 03:45, Adam D. Ruppe <destructionator@gmail.com>wrote: > > Well, I'm happy with it. More than I thought I'd be too - my simple algorithm is giving decent results with just a minimal number of hand edits! And, of course, the results should only get better with more tweaking. > > http://dpldocs.info/ > > Thanks for all the encouragement everyone. > > It works quite well! I tried a few keywords (tuple, range, front, frot, cons...) and it gave good results. Heck, I even discovered functions I didn't know existed and had written by myself :-) What kind of help would you need? It's already quite efficient and would complement quite well the search already present on the Phobos pages. Trick question: what about the changes in Phobos coming with each new DMD version? There are indicated in the version notes and'd be easy to add in your list, but can you be sure they are the only ones? Philippe |
Copyright © 1999-2021 by the D Language Foundation