comment_ch_cmd

View page source

Comment Character Command

Syntax

{xrst_comment_ch ch }

Purpose

Some languages have a special character that indicates the rest of the line is a comment. If you embed sphinx documentation in this type of comment, you need to inform xrst of the special character so it does not end up in your .rst output file.

ch

The value of ch must be one non white space character. There must be at least one white space character between xrst_comment_ch and ch. Leading and trailing white space around ch is ignored.

Input Stream

Spaces and tabs before the special character, the special character, and one space directory after the special character (if present), are removed from the input stream before any xrst processing. For example, if # is the special character, the following input has the heading Factorial and the def token indented the same amount:

# Factorial
# ---------
def factorial(n) :
   if n == 1 :
      return 1
   return n * factorial(n-1)

Indentation

The indent commands are processed before removing the special character and its white space.

Example

comment_ch_example