quarto-dev / quarto-dev/quarto-cli

Project specify port for localhost

Aperta
#8,965 18 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug preview projects
Lingua principale
JavaScript
Stelle
6k
Fork
458
Merge medio
1g 9h
PR unite (30g)
41

Descrizione

Bug description

When I render a Quarto qmd file "--to clean-revealjs" or "--to html" in VSCode via the preview button or CTRL-SHIFT-K Quarto uses a random port for the localhost. The Quarto Project Options and the Quarto Creating a Website states one can insert:

project:    
  preview: 
    port: 4200

However, despite having inserted this option into the project's _quarto.yml a random port number is still used. Other options in the _quarto.yml file are being applied, so I know the manifest is found and read. Some others have reported the same experience:

https://stackoverflow.com/questions/75715950/quarto-project-specify-port-for-localhost

Also tried setting the browser option to true and false which also had no effect.

project:    
  preview: 
    port: 4200
    browser: true

When the preview is re-rendered automatically after a change, then having a different port number is disruptive to the development workflow experience when showing the preview in both the VSCode preview and a browser.

Steps to reproduce
  1. Add to the project directory a _quarto.yml file that contains:
project:    
  preview: 
    port: 4200
  1. Open a .qmd file in VSCode with the Quarto extension.

  2. Preview the .qmd document with CTRL-SHIFT-P | Quarto Preview Format... | format: clean-revealjs or format: html

Observe the quarto command in the terminal is missing the --port option.

No matter the port number specified, Quarto continues to choose a random port number instead of accepting the project.preview.port value in _quarto.yml.

Expected behavior

Terminal output for the preview command should say:

quarto preview [...qmd file...] --no-browser --no-watch-inputs --port 4200

Actual behavior

Terminal output for the preview command is missing the --port option, despite it being in the _quarto.yml file.

quarto preview [...qmd file...] --no-browser --no-watch-inputs

For this image, this was the command (at the top of the terminal scroll not seen in image below):

quarto preview c:/dev/trinity-courses/110-essentials-of-computing-S24/lectures/lecture-7.1.qmd --to clean-revealjs --no-browser --no-watch-inputs

image

Your environment
  • IDE: VSCode 1.87
  • Quarto plugin: v1.111.0
  • Windows: 11
Quarto check output
Quarto 1.4.550
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.550
      Path: C:\Users\jonat\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2023.10
      Chromium: 869685

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\jonat\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2023

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: C:/Users/jonat/AppData/Local/Programs/Python/Python312/python.exe
      Jupyter: 5.7.1
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.2.3
      Path: C:/PROGRA~1/R/R-42~1.3
      LibPaths:
        - C:/Program Files/R/R-4.2.3/library
      knitr: 1.42
      rmarkdown: 2.21

[>] Checking Knitr engine render......OK

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Reproduce the VSCode preview using a project _quarto.yml containing project.preview.port and inspect the generated quarto preview command. Start from the command invocation described in the issue; done means the command includes --port 4200 and the preview uses that stable port for HTML or clean-revealjs output.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.