Blender API Docs, generic search path that resolves to the most up to date.

Is there any chance blender.org gets a search portal that only returns the most recent api docs? like:

blender.org/documentation/search?q=

Now this stuff " blender_python_api_2_63_17/search.html? " is hardcoded into the blender help menu, but if i build my own version that url is taken from bpy.app.version_string. There’s no way to automate the search string using bpy.app.version_string, and be confident that the url will exist, because that will return a newer version than is present on the server.

Any suggestions appreciated
ie: http://www.blender.org/documentation/blender_python_api_2_63_19 doesn’t exist

Right now I have a Text Editor Addon with a search function that can search python docs for the string that is currently selected, which is great (open opens the system default webbrowser if it can). It would be neat to be able to select any portion of a bpy script and perform a search in the API docs.

maybe for now


from urllib.request import urlopen
d = urlopen('http://www.blender.org/documentation/250PythonDoc')
d = d.read()

>>> d
b'<html><head><title>Redirecting...</title><meta http-equiv="REFRESH" content="0;url=../blender_python_api_2_63_17/"></head><body>Redirecting...</body></html>
'

>>> str(d).split("/")[2]
'blender_python_api_2_63_17'

#

will suffice, which can be scraped - but surely there have to be nicer more web aware solutions.

zeffii,

the op is in scripts/startup/bl_operators/wm.py


class WM_OT_doc_view(Operator):
    """Load online reference docs"""
    bl_idname = "wm.doc_view"
    bl_label = "View Documentation"

    doc_id = doc_id
    if bpy.app.version_cycle == "release":
        _prefix = ("http://www.blender.org/documentation/blender_python_api_%s%s_release" %
                   ("_".join(str(v) for v in bpy.app.version[:2]), bpy.app.version_char))
    else:
        _prefix = ("http://www.blender.org/documentation/blender_python_api_%s" %
                   "_".join(str(v) for v in bpy.app.version))

    def execute(self, context):
        url = _wm_doc_get_id(self.doc_id, do_url=True, url_prefix=self._prefix)
        if url is None:
            return {'PASS_THROUGH'}

        import webbrowser
        webbrowser.open(url)

        return {'FINISHED'}


You can override it. I build my own blender too… the 404 not found is a little annoying for sure. I’d also like to see a link button to icon types, makes the UILayout page a scrollathon.