<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def apply(self):
 """Apply the transformation by configuration."""

        source = self.document['source']

        self.reporter.info('AutoStructify: %s' % source)

        # only transform markdowns
        if not source.endswith(tuple(self.config['commonmark_suffixes'])):
            return

        self.url_resolver = self.config['url_resolver']
        assert callable(self.url_resolver)

        self.state_machine = DummyStateMachine()
        self.current_level = 0
        self.file_dir = os.path.abspath(os.path.dirname(self.document['source']))
        self.root_dir = os.path.abspath(self.document.settings.env.srcdir)
        self.traverse(self.document)