code: def _init_modeldef(self):
      # TODO: do file paths needs to be quoted for the shell?
      qmd_path = os.path.relpath(self.script_path)
      assert qmd_path.endswith(".qmd")
      op_data = get_qmd_frontmatter(qmd_path)
  
      op_data["sourcecode"] = {"dest": "."}
      op_data["exec"] = f"quarto render {qmd_path}"
  
      if "params" in op_data:
          op_data["flags"] = op_data.pop("params")
          params_yml_path = qmd_path[:-4] + "-flags.yml"
          op_data["flags-dest"] = f"config:{params_yml_path}"
          op_data["exec"] += f" --execute-params {params_yml_path}"
  
      ## TODO: add scalar-outputs support.
      ## 2 approaches:
      ## - write lua quarto filter that extracts stdout from render ast,
      ##   tee/print in to actual stdout or somewhere where the guild parsers sees it.
      ##   Invoke from the exec call like:
      ##     quarto render foo.qmd --lua-filter extract-scalar-ouputs.lua
      ## - make quarto render a json, like:
      ##      quarto render foo.qmd --to all,json
      ##    make guild go into the json post run and then be aware of how
      ##    to extract cell-output-stdout divs from the rendered json.
      ## - maybe call out to a subprocess to
      ##    f"quarto inspect {qmd_path}" for additional info?
  
      op_data["exec"] += " --to all,json"
  
      # lua_filter_path = get_quarto_filter("extract-scalar-outputs")
      # op_data["exec"] += f" --lua-filter {lua_filter_path}"
  
      data = [
          {
              "model": self.name,
              "operations": {self.op_name: op_data},
          }
      ]
  
      gf = guildfile.Guildfile(
          data, dir=os.getcwd()
      )  # dir = GUILD_PROJECT
      return gf.models[self.name]
  
file_path: guildai/guild/plugins/quarto_document.py
imports: import logging
  import os
  import yaml
  from guild import config
  from guild import guildfile
  from guild import model
  from guild import plugin
label_desc: Use image node_id 2 for calling the QuartoDocumentModelProxy obj's underlying member method code with example usage: obj._init_modeldef() and returns: gf