code: def fetch_contents(self, source):
          
          slides = []
  
          if type(source) is list:
              for entry in source:
                  slides.extend(self.fetch_contents(entry))
          elif os.path.isdir(source):
              self.log(u"Entering %s" % source)
              entries = os.listdir(source)
              entries.sort()
              for entry in entries:
                  slides.extend(self.fetch_contents(os.path.join(source, entry)))
          else:
              try:
                  parser = Parser(os.path.splitext(source)[1], self.encoding,
                      self.extensions)
              except NotImplementedError:
                  return slides
  
              self.log(u"Adding   %s (%s)" % (source, parser.format))
  
              try:
                  with codecs.open(source, encoding=self.encoding) as file:
                      file_contents = file.read()
              except UnicodeDecodeError:
                  self.log(u"Unable to decode source %s: skipping" % source,
                           'warning')
              else:
                  inner_slides = re.split(r'<hr.+>', parser.parse(file_contents))
                  for inner_slide in inner_slides:
                      slides.append(self.get_slide_vars(inner_slide, source))
  
          if not slides:
              self.log(u"Exiting  %s: no contents found" % source, 'notice')
  
          return slides
docs: Recursively fetches Markdown contents from a single file or
              directory containing itself Markdown files.