class_docstr: Class for embedding local file links in an IPython session, based on path
  
  e.g. to embed links to files that were generated in the IPython notebook
  under ``my/data``, you would do::
  
      local_files = FileLinks("my/data")
      display(local_files)
  
  or in the HTML notebook, just::
  
      FileLinks("my/data")
class_docstr_tok: ["Class","for","embedding","local","file","links","in","an","IPython","session",",","based","on","path","e.g",".","to","embed","links","to","files","that","were","generated","in","the","IPython","notebook","under","``","my\/data","``",",","you","would","do",":",":","local_files","=","FileLinks","(","``","my\/data","''",")","display","(","local_files",")","or","in","the","HTML","notebook",",","just",":",":","FileLinks","(","``","my\/data","''",")"]
docstr: generate function to use for notebook formatting
          
docstr_tok: ["generate","function","to","use","for","notebook","formatting"]
code: def _get_notebook_display_formatter(self, spacer="&nbsp;&nbsp;"):
      """generate function to use for notebook formatting"""
      dirname_output_format = (
          self.result_html_prefix + "%s/" + self.result_html_suffix
      )
      fname_output_format = (
          self.result_html_prefix
          + spacer
          + self.html_link_str
          + self.result_html_suffix
      )
      fp_format = self.url_prefix + "%s/%s"
      if sep == "\\":
          # Working on a platform where the path separator is "\", so
          # must convert these to "/" for generating a URI
          def fp_cleaner(fp):
              # Replace all occurences of backslash ("\") with a forward
              # slash ("/") - this is necessary on windows when a path is
              # provided as input, but we must link to a URI
              return fp.replace("\\", "/")
  
      else:
          fp_cleaner = None
  
      return self._get_display_formatter(
          dirname_output_format,
          fname_output_format,
          fp_format,
          fp_cleaner,
      )
  
imports: from os.path import exists, isfile, splitext, abspath, join, isdir
  from os import walk, sep
  from IPython.core.display import DisplayObject
label_desc: Use image node_id 3 for calling the FileLinks obj's underlying member method code with example usage: obj._get_notebook_display_formatter(spacer) and returns: self, fp