class_docstr: FileArchive that can automatically capture notebook data via the
  display hooks and automatically adds a notebook HTML snapshot to
  the archive upon export.
class_docstr_tok: ["FileArchive","that","can","automatically","capture","notebook","data","via","the","display","hooks","and","automatically","adds","a","notebook","HTML","snapshot","to","the","archive","upon","export","."]
docstr: Similar to FileArchive.add but accepts html strings for substitution
docstr_tok: ["Similar","to","FileArchive.add","but","accepts","html","strings","for","substitution"]
code: def add(
      self, obj=None, filename=None, data=None, info=None, html=None
  ):
      "Similar to FileArchive.add but accepts html strings for substitution"
      if info is None:
          info = {}
      initial_last_key = (
          list(self._files.keys())[-1] if len(self) else None
      )
      if self._auto:
          exporters = self.exporters[:]
          # Can only associate html for one exporter at a time
          for exporter in exporters:
              self.exporters = [exporter]
              info = dict(info, notebook=self.notebook_name)
              super().add(obj, filename, data, info=info)
              # Only add substitution if file successfully added to archive.
              new_last_key = (
                  list(self._files.keys())[-1] if len(self) else None
              )
              if new_last_key != initial_last_key:
                  self._replacements[new_last_key] = html
  
          # Restore the full list of exporters
          self.exporters = exporters
  
imports: import os
  import sys
  import time
  import traceback
  import param
  from IPython.display import Javascript, display
  from nbconvert import HTMLExporter, NotebookExporter
  from nbconvert.preprocessors.clearoutput import ClearOutputPreprocessor
  from nbformat import reader
  from ..core.io import FileArchive, Pickler
  from ..plotting.renderer import HTML_TAGS, MIME_TYPES
  from .preprocessors import Substitute
label_desc: Use image node_id 6 for calling the NotebookArchive obj's underlying member method code with example usage: obj.add(obj, filename, data, info, html) without return types