Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 

Conditionals:

See:  

 

 

re: conditional text. I agree we should work to design our docs so that we can use this tool sparingly. When we do use, it, though, I think that we should include a comment indicating at a minimum what the related feature is by referencing the PR or JIRA story. 

sample comment:  https://github.com/edx/edx-documentation/blame/DOCS/SaudiProjects/en_us/shared/building_and_running_chapters/developing_course/course_outline.rst#L133

.. the following note is for prerequisite exams, which are currently released in open edx only and not on edx.org.  when they are available on edx.org, this note should no longer be conditionalized.
 

 

To conditionalize a single paragraph, use either the .. only:: Partners or the .. only:: Open_edX directive, and indent the paragraph under the directive. You can add the conditional text as regular text or as a note.

.. only:: Partners
 Data about course enrollment is available from edX Insights. You can access
Insights from the Instructor Dashboard for your live course: after you select
**Instructor**, follow the link in the banner at the top of each page. For
more information, see `Using edX Insights`_.


.. only:: Open_edX
    .. note::
If you want to require an entrance exam for your course, you also create
the exam in the course outline. Before you can create an exam, you must
set your course to require an entrance exam in Studio. For more
information, see :ref:`Require an Entrance Exam`.


To conditionalize more than a paragraph, use either the .. only:: Partners or the .. only:: Open_edX directive, and then use an .. include:: directive indented under the only directive.

.. only:: Open_edX
   .. include:: ../../../shared/building_and_running_chapters/running_course/Section_course_student.rst

Notes

  • Text inside tables cannot be conditionalized.
  • Conditional text is still processed even if it isn't shown; that means you get build warnings for excluded text that has a link that's not actually shown. For example, in building partner doc, you get a warning that the link to prereq exams in the excluded paragraphs generates a warning even though it isn't shown.

Examples

.. Feature availability on the instructor dash applies to open edX installations only.
.. DOC-2218 A. Hodges 24 Aug 2015
.. only:: Open_edX
 Data about course enrollment is available from the Instructor Dashboard and
from Insights. For more information, see :ref:`view_enrollment_count`.
 
.. Feature has been turned off for edx.org and Edge (the data is available in Insights instead).
.. DOC-2218 A. Hodges 24 Aug 2015
.. only:: Partners
 Data about course enrollment is available from edX Insights. You can access
Insights from the Instructor Dashboard for your live course: after you select
**Instructor**, follow the link in the banner at the top of each page. For
more information, see `Using edX Insights`_.

 

More Information

The following lines show this setting in the config files for partner course author documentation and Open edX course author documentation.

edx-documentation/en_us/course_authors/source/conf.py

tags.add('Partners')
product = 'Partners'
def setup(app):
app.add_config_value('product', '', True)

 

edx-documentation/en_us/open_edx_course_authors/source/conf.py

tags.add('Open_edX')
product = 'Open_edX'
def setup(app):
app.add_config_value('product', '', True)


  • No labels