www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - dpldocs.info - easy redirect to phobos docs

reply Adam Ruppe <destructionator gmail.com> writes:
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.
Feb 20 2010
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"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"!
Feb 20 2010
next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Feb 20 2010
prev sibling next sibling parent Philippe Sigaud <philippe.sigaud gmail.com> writes:
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
Feb 21 2010
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Feb 21 2010
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Feb 21 2010
prev sibling next sibling parent Philippe Sigaud <philippe.sigaud gmail.com> writes:
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
Feb 22 2010
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Mon, Feb 22, 2010 at 10:47:01PM +0100, Philippe Sigaud wrote:
 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.
I'll probably want people's suggestions for tagging functions. Though it is working well enough already that I might be able to handle it myself. What would probably be most valuable is collecting data from searches that didn't work - if you punched in some terms that came up with nothing or garbage instead of what you expected. I think I can automate this to some degree. Log people's searches and what page they ultimately went to, then eyeball those logs to fix up the search rankings. Anyway, I'll post to the group and/or write a note on the dpldocs homepage if I need more than that. In the mean time, if anyone searches for an intuitive term and it doesn't work, let me know. Experienced users are invaluable for that.
 Trick question: what about the changes in Phobos coming with each new DMD
 version?
To generate the database I have now, I wrote a small program (in D - http://dpldocs.info/src/gen.d ) to pull the <a name> tags out of the generated Phobos docs and put them in a database. Pulling it out of the ddoc generated html ensures I get everything that has a page I can link to, and nothing that doesn't, avoiding 404s on Digital Mars. When the new dmd comes out, I'll just run that program again. Then, I just have to fix up the tags part of database, to ensure they are still associated with the right functions. That should be easy enough to automate too, though I'm just doing it by hand so far, since there are so few tags in there. -- Adam D. Ruppe http://arsdnet.net
Feb 22 2010
prev sibling next sibling parent reply Michal Minich <michal.minich gmail.com> writes:
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.
Feb 21 2010
parent "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Feb 21 2010
prev sibling parent =?ISO-8859-1?Q?Pelle_M=E5nsson?= <pelle.mansson gmail.com> writes:
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!
Feb 21 2010