(self, text, skip_if_exists=False)
Add a text block to the Story.

        Args:
            text (str): text (markdown is supported) to add to the story.
            skip_if_exists (boolean): if set to True then the text
                will not be added if a block with this text already exists.
Add a text block to the Story.
Add a text block to the Story .
def add_text(self, text, skip_if_exists=False):
        """Add a text block to the Story.

        Args:
            text (str): text (markdown is supported) to add to the story.
            skip_if_exists (boolean): if set to True then the text
                will not be added if a block with this text already exists.
        """
        if skip_if_exists and self.data:
            for block in self.data:
                if not block:
                    continue
                if not isinstance(block, dict):
                    continue
                old_text = block.get('content')
                if not old_text:
                    continue
                if text == old_text:
                    return

        block = self._create_new_block()
        block['content'] = text
        self._commit(block)
def add_text ( self , text , skip_if_exists = False ) : if skip_if_exists and self . data : for block in self . data : if not block : continue if not isinstance ( block , dict ) : continue old_text = block . get ( 'content' ) if not old_text : continue if text == old_text : return block = self . _create_new_block ( ) block [ 'content' ] = text self . _commit ( block )