astoff / devdocs.el

Emacs viewer for DevDocs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API for deep anchor lookup

jdtsmith opened this issue · comments

Is there an API conceived (other than search) for drilling down to sub-topics? For example, suppose you are writing a bit of matplotlib, and are reaching for the fillstyle property in some method or another. It would be superb if there were a way to connect this topic to an individual anchor on a relevant page. In the long past my IDLWAVE mode had deep links into the HTML documentation for IDL, and you could right/alt-click on completions to pull up the docs directly to a keyword.

I'm not quite sure I understand what you mean, could you make it more concrete? In any case, all the information we have to work with is the sanitized HTML from devdocs.io. AFAICT the format is not not fully documented anywhere and it varies a bit across documents. So one would have to spend some time inspecting the HTML files to see what's possible.

BTW, I was toying with a full-text search feature, which I more or less dropped because of bad performance. The issue is taht you have to render every page of the document to reliably find line locations... See #15.

Suppose I'm in some mode™ and have written:

>>> ax.plot(x, y, fillstyle=

and I can't remember what fillstyle options are available. I can pull up the docstring for plot, search down through it, and see Here is a list of available `.Line2D` properties, but with no additional information (or links).

But imagine instead that with the press of a magic key, I am transported directly to devdocs/matplotlib/lines.lines2D.set_fillstyle, because the plot doc knows what properties it exposes, and where they are documented.

I recognize this is probably wishful thinking. I had managed to get the makers of IDL to produce an XML help index file, with entries like:

  <ROUTINE name="CV_COORD" link="CV_COORD.htm" alias_to="" classname="">
    <SYNTAX name="Result = CV_COORD( [, /DEGREES] [, /DOUBLE] [, FROM_CYLIN=cyl_coords | , FROM_POLAR=pol_coords | , FROM_RECT=rect_coords | , FROM_SPHERE=sph_coords] [, /TO_CYLIN | , /TO_POLAR | , /TO_RECT | , /TO_SPHERE] )" type="func" />
    <KEYWORD name="DEGREES" link="CV_COORD.htm#C_854643309_756965" />
    <KEYWORD name="DOUBLE" link="CV_COORD.htm#C_854643309_1025482" />
    <KEYWORD name="FROM_CYLIN" link="CV_COORD.htm#C_854643309_756968" />
    <KEYWORD name="FROM_POLAR" link="CV_COORD.htm#C_854643309_756971" />
    <KEYWORD name="FROM_RECT" link="CV_COORD.htm#C_854643309_756974" />
    <KEYWORD name="FROM_SPHERE" link="CV_COORD.htm#C_854643309_756977" />
    <KEYWORD name="TO_CYLIN" link="CV_COORD.htm#C_854643309_1109055" />
    <KEYWORD name="TO_POLAR" link="CV_COORD.htm#C_854643309_756983" />
    <KEYWORD name="TO_RECT" link="CV_COORD.htm#C_854643309_756986" />
    <KEYWORD name="TO_SPHERE" link="CV_COORD.htm#C_854643309_756989" />
  </ROUTINE>

that link directly into the documentation. It was brilliant.

Such a thing would probably require buy-in and effort on the devdocs and project (e.g. matplotlib) side. But maybe there's an approximate solution that would work much of the time, which is why I was asking (well, that and the wishful thinking thing).