Skip to content

[wip] Added inline documentation feature in xeus-cpp docs #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The Xeus-Cpp is a Jupyter kernel for the C++ programming language
UsingXeus-Cpp
tutorials
magics
inline_help
dev-build-options
debug
FAQ
Expand Down
65 changes: 65 additions & 0 deletions docs/source/inline_help.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Inline documentation
--------------------

The standard library
====================

The ``xeus-cpp`` kernel allows users to access help on functions and classes
of the standard library.

In a code cell, typing ``?std::vector`` will simply display the help page on
vector from the cppreference_ website.

.. image:: vector_help.png

Enabling the quick-help feature for third-party libraries
=========================================================

The quick help feature can be enabled for other libraries. To do so, a doxygen
tag file for your library must be placed under the ``xeus-cpp`` "data"
directory of the installation prefix, namely

.. code::

PREFIX/share/xeus-cpp/tagfiles

For ``xeus-cpp`` to be able to make use of that information, a JSON
configuration file must be placed under the ``xeus-cpp`` `configuration`
directory of the installation prefix, namely

.. code::

PREFIX/etc/xeus-cpp/tags.d

.. note::

For more information on how to generate tag files for a doxygen
documentation, check the `relevant section`_ of the doxygen documentation.

The format for the JSON configuration file is the following

.. code:: json

{
"url": "Base URL for the documentation",
"tagfile": "Name of the doxygen tagfile"
}

For example the JSON configuration file for the documentation of the standard
library is

.. code:: json

{
"url": "https://en.cppreference.com/w/",
"tagfile": "cppreference-doxygen-web.tag.xml"
}

.. note::

We recommend that you only use the ``https`` protocol for the URL. Indeed,
when the notebook is served over ``https``, content from unsecure sources
will not be rendered.

.. _cppreference: https://en.cppreference.com
.. _`relevant section`: https://www.doxygen.nl/manual/external.html
Binary file added docs/source/vector_help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading