Synopsis: adjust_mode( self, dest, context, mode_identifier )
This method adjusts m_linemode to a token representing insertion and itemization in item lists or enumeration lists. If mode_identifier is completely composed of the chars : , <*>, or # , then this string defines a new mode with referenze to the current mode. : is used to inherit the old mode. <*> either sets a new item or, if the old mode is not an item list, closes mode until this level and starts a new item list. # does the same on enumeration lists.
Please note that mode identifiers are only recognized at the beginning of a new line. Further, modes for emphasize, code extracts , and all others are cleared on starting a new line in the base text.
Parameter context is an instance of class FormattingContext describing the current context of the documentation.
Some samples: (Please note, that this line would begin a description list if starting with a single word before the colon.)
* The current mode is ["itemize"]: :# <mode_identifier> "::" tells this method to do nothing. So, the text of :: this line will be appended to the last item of the enumerate list. :# <mode_identifier> ":#" tells this method to start a new item in the inner ... :description_lists: This is an item in a description list within the first item of :: the item list. :on_items_in_lists: Description lists are started on descripton items that ...The functions returns a True iff mode_identifier defines a mode.
Type setting of lines compatible to module doctest :
>>> 3+4 # an expression to be evaluated by <doctest>
7
>>> 7-3 # another expression to be evaluated by <doctest>
4
Type setting of lines in python code with highlight but irrelevant to doctest .
|>> print FormattingContext("module", "class", "method").get_label()
This should be set as a normal line since we loose any formatting directive by the empty line above in the unformatted text.