Skip to content

Commit

Permalink
Embedding Content From Your Documentation, blog post
Browse files Browse the repository at this point in the history
We have covered most of this feature in our guide at
https://docs.readthedocs.io/en/stable/guides/embedding-content.html, so I don't
think there is too much to add here. However, I think the blog is the right
place to promote this feature and share a little of its story.

I'd like to have an example of in-app UI tooltip, but the tool we built does not
look nice and I don't think we want to promote that as is.
  • Loading branch information
humitos committed Jun 16, 2020
1 parent ef1a5df commit df8707e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
Binary file added _static/sphinx-hoverxref-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions embedding-content-from-your-docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. post:: June 23, 2020
:tags: embed, sphinx, sphinx-extension, api
:author: Manuel
:location: BCN

.. meta::
:description lang=en:
Read the Docs allows you to embed content from any of the projects we host.
This allows reuse of content across sites, making sure the content is always up to date.


Embedding Content From Your Documentation
=========================================

We are happy to announce we have built a solid Embed API.
You can use it to embed content from any of the project we host, *anywhere*.
The Embed API is a very simple but super powerful idea:
*returns the content of a specific section from a particular document in a project*.

This functionality brought us the ability to work in two different projects:

:Contextualized tooltips on documentation pages:

We thought it would be awesome if we could add some extra context to a link within the same page.
This would help the reader to understand in a better way the concept linked,
without switching context and jumping into another completely different page,
and maybe getting lost or distracted with lot of new content in the document opened.

We had the concept already highlighted by a link,
we had the Embed API that could return the exact content of the referenced section...
*Let's add a tooltip with this content when the reader hovers the link!*
--and that's how `sphinx-hoverxref`_ was born.

``sphinx-hoverxref`` allows the author of the documentation to easily add these tooltips,
customize their style, decide which elements will show tooltips and more!

.. figure:: sphinx-hoverxref-demo.gif

Example of ``sphinx-hoverxref`` on Read the Docs documentation.

.. _sphinx-hoverxref: https://sphinx-hoverxref.readthedocs.io/

:Inline help on our application website:

Usually, we think that adding a text in the UI is not great and we are tempted to avoid it if possible.
We try to reduce the words there and, in case the feature is big enough, add a link to the full documentation.
This pattern has worked fine over time, but it has the same problem of context switching to a completely different page.

Since we've started working on a new re-design of our entire application UI (more on this coming soon!),
we thought we could introduce the usage of the Embed API to add this extra documentation,
with small links next to the feature we want to explain without overloading UI
but giving the user the ability to have the exact contextualized paragraph for that particular feature.


If you liked the Embed API and the use cases we presented here,
you can `read its full documentation`_ to learn more about it.

.. _read its full documentation: https://docs.readthedocs.io/en/stable/guides/embedding-content.html

We think it's a super powerful feature and we encourage you to use the extension we built on top of it,
or even better, build your owns and share them with us!

0 comments on commit df8707e

Please sign in to comment.