docs: def ftdetect(filename):
      """Determine if filename is markdown or notebook,
      based on the file extension.
      """
      _, extension = os.path.splitext(filename)
      md_exts = ['.md', '.markdown', '.mkd', '.mdown', '.mkdn', '.Rmd']
      nb_exts = ['.ipynb']
      if extension in md_exts:
          return 'markdown'
      elif extension in nb_exts:
          return 'notebook'
      else:
          return None