docs: def walk(x, action, format, meta):
      """Walk a tree, applying an action to every object.
      Returns a modified tree.  An action is a function of the form
      `action(key, value, format, meta)`, where:
  
      * `key` is the type of the pandoc object (e.g. 'Str', 'Para') `value` is
      * the contents of the object (e.g. a string for 'Str', a list of
        inline elements for 'Para')
      * `format` is the target output format (as supplied by the
        `format` argument of `walk`)
      * `meta` is the document's metadata
  
      The return of an action is either:
  
      * `None`: this means that the object should remain unchanged
      * a pandoc object: this will replace the original object
      * a list of pandoc objects: these will replace the original object; the
        list is merged with the neighbors of the orignal objects (spliced into
        the list the original object belongs to); returning an empty list deletes
        the object
      """
      if isinstance(x, list):
          array = []
          for item in x:
              if isinstance(item, dict) and 't' in item:
                  res = action(item['t'],
                               item['c'] if 'c' in item else None, format, meta)
                  if res is None:
                      array.append(walk(item, action, format, meta))
                  elif isinstance(res, list):
                      for z in res:
                          array.append(walk(z, action, format, meta))
                  else:
                      array.append(walk(res, action, format, meta))
              else:
                  array.append(walk(item, action, format, meta))
          return array
      elif isinstance(x, dict):
          for k in x:
              x[k] = walk(x[k], action, format, meta)
          return x
      else:
          return x