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 "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
prev sibling 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 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
prev sibling next sibling 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 next 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
prev sibling next sibling parent Philippe Sigaud <philippe.sigaud gmail.com> writes:
--0003255558f6828f0d04801c68a9
Content-Type: text/plain; charset=ISO-8859-1

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.

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 --0003255558f6828f0d04801c68a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Sun, Feb 21, 2010 at 05:43, Adam D. Ruppe <sp= an dir=3D"ltr">&lt;<a href=3D"mailto:destructionator gmail.com">destruction= ator gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s= tyle=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204= ); padding-left: 1ex;"> <div class=3D"im">On Sat, Feb 20, 2010 at 08:47:03PM -0500, Nick Sabalausky= wrote:<br></div> <a href=3D"http://dpldocs.info/phobos" target=3D"_blank">http://dpldocs.inf= o/phobos</a> or <a href=3D"http://dpldocs.info/std" target=3D"_blank">http:= //dpldocs.info/std</a> brings you to the<br> Phobos homepage.<br> <br></blockquote><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"m= argin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); paddin= g-left: 1ex;"> <br> You can also type any of these into the box on the homepage, of course.<br> <br></blockquote><div><br>Thanks Adam, that&#39;s definitely useful and it&= #39;s now part of my bookmarks!<br><br>Would it be difficult for it to say = &#39;no match, sorry&#39; and stay on your page when we make a mistake, ins= tead of doing a 404 on digitalmars?<br> <br><br>Philippe <br></div></div> --0003255558f6828f0d04801c68a9--
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:
--0003255528ce94c1800480375f3f
Content-Type: text/plain; charset=ISO-8859-1

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,

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 --0003255528ce94c1800480375f3f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Mon, Feb 22, 2010 at 03:45, Adam D. Ruppe <sp= an dir=3D"ltr">&lt;<a href=3D"mailto:destructionator gmail.com">destruction= ator gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" s= tyle=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204= ); padding-left: 1ex;"> <div class=3D"im"><br> </div>Well, I&#39;m happy with it. More than I thought I&#39;d be too - my = simple<br> algorithm is giving decent results with just a minimal number of hand<br> edits! And, of course, the results should only get better with more tweakin= g.<br> <br> <a href=3D"http://dpldocs.info/" target=3D"_blank">http://dpldocs.info/</a>= <br> <br> Thanks for all the encouragement everyone.<br> <div><div></div><br></div></blockquote><div>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&#39;t know existed and had writte= n by myself :-)<br> =A0<br>What kind of help would you need? It&#39;s already quite efficient a= nd would complement quite well the search already present on the Phobos pag= es.<br><br>Trick question: what about the changes in Phobos coming with eac= h new DMD version? There are indicated in the version notes and&#39;d be ea= sy to add in your list, but can you be sure they are the only ones?<br> <br>Philippe<br><br></div></div> --0003255528ce94c1800480375f3f--
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