#compdef quarto
# Quarto CLI completions, generated by quarto-completions.
# Quarto 1.9.38 (1.9 channel).
# Do not edit: https://github.com/mcanouil/quarto-completions

# _arguments re-evaluates a literal (a b c) action list at completion time,
# running any $(...) or `...` an enum value carries rather than treating it
# as inert text; verified against real zsh. Values instead reach compadd as
# ordinary, already-quoted arguments to this function, which is not
# re-evaluated the same way.
#
# _arguments calls an action command with the compadd options it built for the
# spec's message prepended to the arguments written here, so '--' marks where
# those end and the values begin. Without the split they are offered as
# candidates: '-J' and '-default-' always, and '-M' plus the matcher itself
# wherever a matcher-list style is set, which is any Oh My Zsh. With no '--'
# present every argument is taken for an option and nothing is offered, rather
# than the options being listed as values.
_quarto_enum() {
  local -i split=${argv[(i)--]}
  local -a options=("${(@)argv[1,split-1]}") candidates=("${(@)argv[split+1,-1]}")
  # -a, so a value is never read as an option of compadd's own.
  compadd "${(@)options}" -a candidates
}

_quarto() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(-V --version)'{-V,--version}'[Show the version number for this program.]' \
    '1: :->command' \
    '*:: :->argument'

  case $state in
    command)
      local -a subcommands
      subcommands=( \
      'render:Render files or projects to various document types.' \
      'preview:Render and preview a document or website project.' \
      'serve:Serve a Shiny interactive document.' \
      'create:Create a Quarto project or extension' \
      'use:Automate document or project setup tasks.' \
      'add:Add an extension to this folder or project' \
      'update:Updates an extension or global dependency (TinyTeX, Chromium, Chrome Headless Shell, VeraPDF).' \
      'remove:Removes an extension.' \
      'convert:Convert documents to alternate representations.' \
      'pandoc:Run the version of Pandoc embedded within Quarto.' \
      'typst:Run the version of Typst embedded within Quarto.' \
      'run:Run a TypeScript, R, Python, or Lua script.' \
      'list:Lists an extension or global dependency.' \
      'install:Installs a global dependency (TinyTeX, Chromium, Chrome Headless Shell, VeraPDF).' \
      'uninstall:Uninstalls a global dependency (TinyTeX, Chromium, Chrome Headless Shell, VeraPDF).' \
      'tools:Display the status of Quarto installed dependencies' \
      'publish:Publish a document or project to a provider.' \
      'check:Verify correct functioning of Quarto installation.' \
      'call:Access functions of Quarto subsystems such as its rendering engines.' \
      )
      _describe -t commands 'quarto command' subcommands
      ;;
    argument)
      case $words[1] in
        render) _quarto_render ;;
        preview) _quarto_preview ;;
        serve) _quarto_serve ;;
        create) _quarto_create ;;
        use) _quarto_use ;;
        add) _quarto_add ;;
        update) _quarto_update ;;
        remove) _quarto_remove ;;
        convert) _quarto_convert ;;
        pandoc) _quarto_pandoc ;;
        typst) _quarto_typst ;;
        run) _quarto_run ;;
        list) _quarto_list ;;
        install) _quarto_install ;;
        uninstall) _quarto_uninstall ;;
        tools) _quarto_tools ;;
        publish) _quarto_publish ;;
        check) _quarto_check ;;
        call) _quarto_call ;;
      esac
      ;;
  esac
}

_quarto_render() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(-t --to)'{-t,--to=}'[Specify output format(s).]:value:_quarto_enum -- '\''html'\'' '\''pdf'\'' '\''docx'\'' '\''odt'\'' '\''rtf'\'' '\''revealjs'\'' '\''beamer'\'' '\''pptx'\'' '\''typst'\'' '\''dashboard'\'' '\''epub'\'' '\''gfm'\'' '\''commonmark'\'' '\''markdown'\'' '\''markua'\'' '\''hugo-md'\'' '\''docusaurus-md'\'' '\''jats'\'' '\''asciidoc'\'' '\''asciidoctor'\'' '\''ipynb'\'' '\''context'\'' '\''docbook'\'' '\''dokuwiki'\'' '\''jira'\'' '\''mediawiki'\'' '\''man'\'' '\''ms'\'' '\''muse'\'' '\''opml'\'' '\''org'\'' '\''rst'\'' '\''texinfo'\'' '\''textile'\'' '\''xwiki'\'' '\''zimwiki'\''' \
    '(-o --output)'{-o,--output=}'[Write output to FILE (use '\''--output -'\'' for stdout).]:value:_files' \
    '(--output-dir)'--output-dir='[Write output to DIR (path is input/project relative)]:value:_files -/' \
    '(-M --metadata)'{-M,--metadata=}'[Metadata value (KEY:VALUE).]:value: ' \
    '(--site-url)'--site-url='[Override site-url for website or book output]:value: ' \
    '(--execute)'--execute'[Execute code (--no-execute to skip execution).]' \
    '(-P --execute-param)'{-P,--execute-param=}'[Execution parameter (KEY:VALUE).]:value: ' \
    '(--execute-params)'--execute-params='[YAML file with execution parameters.]:value:_files -g "*.(yml|yaml|json)"' \
    '(--execute-dir)'--execute-dir='[Working directory for code execution.]:value:_files -/' \
    '(--execute-daemon)'--execute-daemon='[Keep Jupyter kernel alive (defaults to 300 seconds).]:value: ' \
    '(--execute-daemon-restart)'--execute-daemon-restart'[Restart keepalive Jupyter kernel before render.]' \
    '(--execute-debug)'--execute-debug'[Show debug output when executing computations.]' \
    '(--use-freezer)'--use-freezer'[Force use of frozen computations for an incremental file render.]' \
    '(--cache)'--cache'[Cache execution output (--no-cache to prevent cache).]' \
    '(--cache-refresh)'--cache-refresh'[Force refresh of execution cache.]' \
    '(--no-clean)'--no-clean'[Do not clean project output-dir prior to render]' \
    '(--debug)'--debug'[Leave intermediate files in place after render.]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '(--no-execute)'--no-execute'[Negated form of --execute.]' \
    '(--no-cache)'--no-cache'[Negated form of --cache.]' \
    '(--toc)'--toc'[Include an automatically generated table of contents.]' \
    '(--toc-depth)'--toc-depth='[Number of section levels in the table of contents.]:value: ' \
    '(--number-sections)'--number-sections'[Number section headings.]' \
    '(--number-offset)'--number-offset='[Offset for section headings.]:value: ' \
    '(--top-level-division)'--top-level-division='[Treat top-level headings as this division.]:value:_quarto_enum -- '\''default'\'' '\''section'\'' '\''chapter'\'' '\''part'\''' \
    '(--standalone)'--standalone'[Produce a standalone document.]' \
    '(--template)'--template='[Use FILE as a custom template.]:value:_files' \
    '(--css)'--css='[Link to a CSS style sheet.]:value:_files -g "*.(css)"' \
    '(--bibliography)'--bibliography='[Bibliography file.]:value:_files -g "*.(bib|bibtex|json|yml|yaml)"' \
    '(--csl)'--csl='[Citation Style Language file.]:value:_files -g "*.(csl)"' \
    '(--citeproc)'--citeproc'[Process citations with citeproc.]' \
    '(--highlight-style)'--highlight-style='[Syntax highlighting style.]:value: ' \
    '(--pdf-engine)'--pdf-engine='[Engine used to produce PDF output.]:value:_quarto_enum -- '\''pdflatex'\'' '\''lualatex'\'' '\''xelatex'\'' '\''tectonic'\'' '\''latexmk'\'' '\''context'\'' '\''wkhtmltopdf'\'' '\''weasyprint'\'' '\''typst'\''' \
    '(--mathjax)'--mathjax'[Render mathematics with MathJax.]' \
    '(--katex)'--katex'[Render mathematics with KaTeX.]' \
    '(--wrap)'--wrap='[Text wrapping in the output.]:value:_quarto_enum -- '\''auto'\'' '\''none'\'' '\''preserve'\''' \
    '(--reference-doc)'--reference-doc='[Reference document for docx, pptx, or odt output.]:value:_files -g "*.(docx|pptx|odt)"' \
    '(--shift-heading-level-by)'--shift-heading-level-by='[Shift heading levels by this amount.]:value: ' \
    '1:input:_files -g "*.(qmd|ipynb|md|Rmd|rmd|markdown)"' \
    '2:args: ' \
    '*:pandoc-args: '

}

_quarto_preview() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--port)'--port='[Suggested port to listen on (defaults to random value between 3000 and 8000).]:port: ' \
    '(--host)'--host='[Hostname to bind to (defaults to 127.0.0.1)]:host: ' \
    '(--render)'--render='[Render to the specified format(s) before previewing (Default: "none")]:format:_quarto_enum -- '\''all'\'' '\''html'\'' '\''pdf'\'' '\''docx'\'' '\''odt'\'' '\''rtf'\'' '\''revealjs'\'' '\''beamer'\'' '\''pptx'\'' '\''typst'\'' '\''dashboard'\'' '\''epub'\'' '\''gfm'\'' '\''commonmark'\'' '\''markdown'\'' '\''markua'\'' '\''hugo-md'\'' '\''docusaurus-md'\'' '\''jats'\'' '\''asciidoc'\'' '\''asciidoctor'\'' '\''ipynb'\'' '\''context'\'' '\''docbook'\'' '\''dokuwiki'\'' '\''jira'\'' '\''mediawiki'\'' '\''man'\'' '\''ms'\'' '\''muse'\'' '\''opml'\'' '\''org'\'' '\''rst'\'' '\''texinfo'\'' '\''textile'\'' '\''xwiki'\'' '\''zimwiki'\''' \
    '(--no-serve)'--no-serve'[Don'\''t run a local preview web server (just monitor and re-render input files)]' \
    '(--no-navigate)'--no-navigate'[Don'\''t navigate the browser automatically when outputs are updated.]' \
    '(--no-browser)'--no-browser'[Don'\''t open a browser to preview the site.]' \
    '(--no-watch-inputs)'--no-watch-inputs'[Do not re-render input files when they change.]' \
    '(--timeout)'--timeout='[Time (in seconds) after which to exit if there are no active clients.]:value: ' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '(--toc)'--toc'[Include an automatically generated table of contents.]' \
    '(--toc-depth)'--toc-depth='[Number of section levels in the table of contents.]:value: ' \
    '(--number-sections)'--number-sections'[Number section headings.]' \
    '(--number-offset)'--number-offset='[Offset for section headings.]:value: ' \
    '(--top-level-division)'--top-level-division='[Treat top-level headings as this division.]:value:_quarto_enum -- '\''default'\'' '\''section'\'' '\''chapter'\'' '\''part'\''' \
    '(--standalone)'--standalone'[Produce a standalone document.]' \
    '(--template)'--template='[Use FILE as a custom template.]:value:_files' \
    '(--css)'--css='[Link to a CSS style sheet.]:value:_files -g "*.(css)"' \
    '(--bibliography)'--bibliography='[Bibliography file.]:value:_files -g "*.(bib|bibtex|json|yml|yaml)"' \
    '(--csl)'--csl='[Citation Style Language file.]:value:_files -g "*.(csl)"' \
    '(--citeproc)'--citeproc'[Process citations with citeproc.]' \
    '(--highlight-style)'--highlight-style='[Syntax highlighting style.]:value: ' \
    '(--pdf-engine)'--pdf-engine='[Engine used to produce PDF output.]:value:_quarto_enum -- '\''pdflatex'\'' '\''lualatex'\'' '\''xelatex'\'' '\''tectonic'\'' '\''latexmk'\'' '\''context'\'' '\''wkhtmltopdf'\'' '\''weasyprint'\'' '\''typst'\''' \
    '(--mathjax)'--mathjax'[Render mathematics with MathJax.]' \
    '(--katex)'--katex'[Render mathematics with KaTeX.]' \
    '(--wrap)'--wrap='[Text wrapping in the output.]:value:_quarto_enum -- '\''auto'\'' '\''none'\'' '\''preserve'\''' \
    '(--reference-doc)'--reference-doc='[Reference document for docx, pptx, or odt output.]:value:_files -g "*.(docx|pptx|odt)"' \
    '(--shift-heading-level-by)'--shift-heading-level-by='[Shift heading levels by this amount.]:value: ' \
    '1:file:_files -g "*.(qmd|ipynb|md|Rmd|rmd|markdown)"' \
    '*:args: '

}

_quarto_serve() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-render)'--no-render'[Do not render the document before serving.]' \
    '(-p --port)'{-p,--port=}'[The TCP port that the application should listen on.]:port: ' \
    '(--host)'--host='[Hostname to bind to (defaults to 127.0.0.1)]:host: ' \
    '(--browser)'--browser'[Open a browser to preview the site.]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:input:_files -g "*.(qmd|ipynb|md|Rmd|rmd|markdown)"'

}

_quarto_create() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--open)'--open='[Open new artifact in this editor (positron, vscode, rstudio)]:editor:_quarto_enum -- '\''positron'\'' '\''vscode'\'' '\''rstudio'\''' \
    '(--no-open)'--no-open'[Do not open in an editor]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:type:_quarto_enum -- '\''project'\'' '\''extension'\''' \
    '*:commands: '

}

_quarto_use() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '1: :->command' \
    '*:: :->argument'

  case $state in
    command)
      local -a subcommands
      subcommands=( \
      'template:Use a Quarto template for this directory or project.' \
      'binder:Configure the current project with Binder support.' \
      'brand:Use a brand for this project.' \
      )
      _describe -t commands 'quarto command' subcommands
      ;;
    argument)
      case $words[1] in
        template) _quarto_use_template ;;
        binder) _quarto_use_binder ;;
        brand) _quarto_use_brand ;;
      esac
      ;;
  esac
}

_quarto_use_template() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '1:target: '

}

_quarto_use_binder() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '*: :_files'

}

_quarto_use_brand() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--force)'--force'[Skip all prompts and confirmations]' \
    '(--dry-run)'--dry-run'[Show what would happen without making changes]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:target: '

}

_quarto_add() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--embed)'--embed='[Embed this extension within another extension (used when authoring extensions).]:extensionId: ' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:extension: '

}

_quarto_update() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--embed)'--embed='[Embed this extension within another extension (used when authoring extensions).]:extensionId: ' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '*:target:_quarto_enum -- '\''tinytex'\'' '\''chrome-headless-shell'\'' '\''verapdf'\'''

}

_quarto_remove() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--embed)'--embed='[Remove this extension from within another extension (used when authoring extensions).]:extensionId: ' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '*:target: '

}

_quarto_convert() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(-o --output)'{-o,--output=}'[Write output to PATH.]:path:_files' \
    '(--with-ids)'--with-ids'[Include ids in conversion]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:input:_files -g "*.(qmd|ipynb|md|Rmd|rmd|markdown)"'

}

_quarto_pandoc() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '*: :_files'

}

_quarto_typst() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '*: :_files'

}

_quarto_run() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:script:_files -g "*.(ts|js|py|R|r|lua)"' \
    '*:args: '

}

_quarto_list() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:type:_quarto_enum -- '\''extensions'\'' '\''tools'\'''

}

_quarto_install() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--update-path)'--update-path'[Update system path when a tool is installed]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '*:target:_quarto_enum -- '\''tinytex'\'' '\''chrome-headless-shell'\'' '\''verapdf'\'''

}

_quarto_uninstall() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm actions]' \
    '(--update-path)'--update-path'[Update system path when a tool is installed]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:tool:_quarto_enum -- '\''tinytex'\'' '\''chrome-headless-shell'\'' '\''verapdf'\'''

}

_quarto_tools() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '*: :_files'

}

_quarto_publish() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--id)'--id='[Identifier of content to publish]:id: ' \
    '(--server)'--server='[Server to publish to]:server: ' \
    '(--token)'--token='[Access token for publising provider]:token: ' \
    '(--no-render)'--no-render'[Do not render before publishing.]' \
    '(--no-prompt)'--no-prompt'[Do not prompt to confirm publishing destination]' \
    '(--no-browser)'--no-browser'[Do not open a browser to the site after publishing]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:provider:_quarto_enum -- '\''quarto-pub'\'' '\''gh-pages'\'' '\''connect'\'' '\''posit-connect-cloud'\'' '\''netlify'\'' '\''confluence'\'' '\''huggingface'\''' \
    '2:path:_files -g "*.(qmd|ipynb|md|Rmd|rmd|markdown)"'

}

_quarto_check() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--output)'--output='[Output as JSON to a file]:path:_files' \
    '(--no-strict)'--no-strict'[When set, will not fail if dependency versions don'\''t match precisely]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '1:target:_quarto_enum -- '\''install'\'' '\''jupyter'\'' '\''knitr'\'' '\''versions'\'' '\''all'\'''

}

_quarto_call() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '1: :->command' \
    '*:: :->argument'

  case $state in
    command)
      local -a subcommands
      subcommands=( \
      'engine:Access functionality specific to quarto'\''s different rendering engines.' \
      'build-ts-extension:Build TypeScript execution engine extensions.' \
      'typst-gather:Gather Typst packages for a format extension.' \
      )
      _describe -t commands 'quarto command' subcommands
      ;;
    argument)
      case $words[1] in
        engine) _quarto_call_engine ;;
        build-ts-extension) _quarto_call_build_ts_extension ;;
        typst-gather) _quarto_call_typst_gather ;;
      esac
      ;;
  esac
}

_quarto_call_engine() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '1:engine-name:_quarto_enum -- '\''jupyter'\'' '\''knitr'\'' '\''markdown'\'' '\''julia'\''' \
    '*:args: '

}

_quarto_call_build_ts_extension() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--check)'--check'[Type-check only (skip bundling)]' \
    '(--init-config)'--init-config'[Generate deno.json with absolute importMap path]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '1:entry-point:_files -g "*.(ts)"'

}

_quarto_call_typst_gather() {
  local context state state_descr line
  typeset -A opt_args

  _arguments -C -s \
    '(-h --help)'{-h,--help}'[Show this help.]' \
    '(--init-config)'--init-config'[Generate a starter typst-gather.toml in current directory]' \
    '(--log)'--log='[Path to log file]:file:_files' \
    '(--log-level)'--log-level='[Log level (debug, info, warning, error, critical)]:level:_quarto_enum -- '\''debug'\'' '\''info'\'' '\''warning'\'' '\''error'\'' '\''critical'\''' \
    '(--log-format)'--log-format='[Log format (plain, json-stream)]:format:_quarto_enum -- '\''plain'\'' '\''json-stream'\''' \
    '(--quiet)'--quiet'[Suppress console output.]' \
    '(--profile)'--profile='[Active project profile(s)]:value: ' \
    '*: :_files'

}

_quarto "$@"
