Skip to content

Commit

Permalink
Add youtube videos to docs
Browse files Browse the repository at this point in the history
This is possible thanks to a custom youtube tag. See
https://jasonstitt.com/youtube-in-restructured-text
  • Loading branch information
regisb committed Feb 25, 2020
1 parent a2f5020 commit fffc904
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
11 changes: 1 addition & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,10 @@ Extensive documentation is available online: https://docs.tutor.overhang.io/
Support
-------

To get community support, go to the official discussion forums: https://discuss.overhang.io.
To get community support, go to the official discussion forums: https://discuss.overhang.io. For official support, please subscribe to a Long Term Support (LTS) license at https://overhang.io/tutor/lts.

.. _readme_support_end:

.. _whats_tutor_start:

What is Tutor?
--------------

Tutor was presented at the 2019 Open edX conference in San Diego, CA. Here's the 7-minute talk: `video <https://www.youtube.com/watch?v=Oqc7c-3qFc4>`_, `slides <https://regisb.github.io/openedx2019/>`_.

.. _whats_tutor_end:

.. _readme_contributing_start:

Contributing
Expand Down
44 changes: 40 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,50 @@
epub_exclude_files = ['search.html']

# Custom variables
import io
import os
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with io.open(os.path.join(here, "..", "tutor", "__about__.py"), "rt", encoding="utf-8") as f:
with io.open(
os.path.join(here, "..", "tutor", "__about__.py"), "rt", encoding="utf-8"
) as f:
exec(f.read(), about)
rst_prolog = """
.. |tutor_version| replace:: {}
""".format(
about['__version__'],
about["__version__"],
)


# Custom directives
def youtube(
_name,
_args,
_options,
content,
_lineno,
_contentOffset,
_blockText,
_state,
_stateMachine,
):
""" Restructured text extension for inserting youtube embedded videos """
if not content:
return []
video_id = content[0]
return [
docutils.nodes.raw(
"",
"""
<iframe width="560" height="315"
src="https://www.youtube-nocookie.com/embed/{video_id}"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>""".format(
video_id=video_id
),
format="html",
)
]


youtube.content = True
docutils.parsers.rst.directives.register_directive("youtube", youtube)
11 changes: 7 additions & 4 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ Tutor simplifies the deployment of Open edX by:
1. Separating the configuration logic from the deployment platforms.
2. Running application processes in cleanly separated `docker containers <https://www.docker.com/resources/what-container>`_.

.. image:: https://overhang.io/images/openedx-plus-docker-is-tutor.png
.. image:: https://overhang.io/static/img/openedx-plus-docker-is-tutor.png
:alt: Open edX + Docker = Tutor
:width: 500px
:align: center

Because Docker containers are becoming an industry-wide standard, that means that with Tutor it becomes possible to run Open edX anywhere: for now, Tutor supports deploying on a local server, with `docker-compose <https://docs.docker.com/compose/overview/>`_, and in a large cluster, with `Kubernetes <http://kubernetes.io/>`_. But in the future, Tutor may support other deployment platforms.

.. include:: ../README.rst
:start-after: _whats_tutor_start:
:end-before: _whats_tutor_end:
What is Tutor?
--------------

Tutor was presented at the 2019 Open edX conference in San Diego, CA. Here's the 7-minute talk (with `slides <https://regisb.github.io/openedx2019/>`_):

.. youtube:: Oqc7c-3qFc4

How does Tutor work?
--------------------
Expand Down

0 comments on commit fffc904

Please sign in to comment.