code: def new_document(self, filename, url=None):
      
  
      if not filename.endswith('.md'):
        raise ValueError('filename must end with `.md`')
      if os.path.isabs(filename):
        raise ValueError('filename must be relative')
      if filename in self.documents:
        raise ValueError('document filename {!r} already used'.format(filename))
      if not url:
        url = filename[:-3]
  
      doc = Document(self, url)
      self.documents[filename] = doc
      return doc
docs: Create a new document.
  
      # Arguments
      filename (str): The filename of the document. Must end with `.md`.
      url (str): The relative URL of the document. If omitted, will be
        automatically deduced from *filename* (same without the `.md` suffix).
  
      # Raises
      ValueError: If *filename* does not end with `.md`.
      ValueError: If *filename* is not a relative path.
      ValueError: If a document with the specified *filename* already exists.