Now available as a PyCharm plugin.
Open html documentation from PyCharm.
This is the code for website to redirect to external documentation from the View external documentation
feature in Pycharm (or other Jetbrains IDEs with the Python plugin).
PyCharm hardly gives the correct URL for the documentation of 3rd party libraries. e.g. PY-30970, PY-36368, PY-36306, PY-43736
Since most external documentation for 3rd party libraries do not follow a fixed pattern, it is impossible to use a template to give the correct URL for the documentation. This website uses a documentation mapping to redirect to the documentation URL.
There are 2 methods to configure, by editing IDE config files or changing settings with the IDE
Go to your configuration directory, open options/other.xml
.
Look for
<component name="PythonDocumentationMap">
<option name="entries">
<map>
<entry key="..." value="..." />
...
<entry key="..." value="..." />
</map>
</option>
</component>
put the following after the last entry
tag.
<entry key="_pytest" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="django" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="keras" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="matplotlib" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="numpy" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="pandas" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="scipy" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="sklearn" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="tensorflow" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
<entry key="torch" value="https://guoci.github.io/external_documentation_redirect/?qname={element.qname}" />
In Settings
➡️ Tools
➡️ (Python) External Documentation
, change URLs for the supported modules to:
https://guoci.github.io/external_documentation_redirect/?qname={element.qname}
Press Shift+F1
to get external documentation of the symbol under the cursor.
Currently supported modules:
-
django
-
matplotlib
-
numpy
-
pandas
-
pytest
add the URL pattern to
_pytest
-
pytorch
-
scipy
-
sklearn
-
tensorflow
,tensorflow.keras
Requires adding
keras
andtensorflow
URL pattern, see screenshot for an example.For
keras
, do import fromtensorflow.keras
instead ofkeras
, for example:import tensorflow.keras as keras
instead ofimport keras
Users from China may want to override the default documentation site with:
https://guoci.github.io/external_documentation_redirect/?qname={element.qname}&docsite=https%3A%2F%2Ftensorflow.google.cn
You can copy the files this repository and use http.server to serve.