quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.55k stars 293 forks source link

Supplementary JS files are not being uploaded to Quarto Pub via `quarto publish` #6828

Open coatless opened 9 months ago

coatless commented 9 months ago

Bug description

The issue is an elevation of the original discussion post regarding supplementary files and quarto pub, c.f. https://github.com/quarto-dev/quarto-cli/discussions/6487

So, I've tried to publish a demo Qmd file onto Quarto pub with the updated structure now; but, even with using quarto.doc.add_html_dependency(), I'm getting a similar error on page load.

Missing webr service workers

You can see the document here:

https://coatless.quarto.pub/webr-enabled-code-cells/

Is there a way to see what files are being uploaded onto Quarto Pub? Or what files are present with a quarto.pub site?

I published to https://quarto.pub using the publishing command with QUARTO_PUB_AUTH_TOKEN.

Steps to reproduce

In particular, we have:

# Create a directory and change into it
mkdir quarto-publish-bug && cd $_

# Obtain the extension
quarto add coatless/quarto-webr@0.3.2

# Download demo document
curl --location --remote-header-name --remote-name https://github.com/coatless/quarto-webr/webr-demo.qmd

# Set quarto-pub token obtained from
# https://quartopub.com/profile/
export QUARTO_PUB_AUTH_TOKEN="not-telling1"

# Render and publish the document
quarto publish quarto-pub webr-demo.qmd

Gives:

? Publish with account: › QUARTO_PUB_AUTH_TOKEN
? Document name: › webr-enabled-code-cells

[✓] Creating quarto-pub document

Rendering for publish:

processing file: webr-demo.qmd
1/5                  
2/5 [unnamed-chunk-1]
3/5                  
4/5 [unnamed-chunk-2]
5/5                  
output file: webr-demo.knit.md

Warning messages:
1: In grSoftVersion() :
  unable to load shared object '/usr/local/lib/R/modules//R_X11.so':
  libXt.so.6: cannot open shared object file: No such file or directory
2: In get_engine(options$engine) :
  Unknown language engine 'webr' (must be registered via knit_engines$set()).
pandoc 
  to: html
  output-file: webr-demo.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  toc: true

metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  title: webR-enabled code cells

[✓] Preparing to publish document
[✓] Uploading files (complete)
[✓] Deploying published document
[✓] Published document: https://coatless.quarto.pub/webr-enabled-code-cells
[✓] Account site updated: https://coatless.quarto.pub

This was built and published using quarto-1.4.358 and quarto-webr @ v0.3.2

Expected behavior

Ideally, the javascript service workers generated -- webr-serviceworkers.js and webr-workers.js -- should be present on Quarto pub. When files are being uploaded onto Quarto pub, it would be great to be able to also see a list of whats being sent. Similarly, it would be good to understand the files being stored on quarto.pub.

Actual behavior

The javascript service workers are not available on quarto pub.

Your environment

Quarto check output

Quarto 1.4.358
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.7: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.4: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.358
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2023.09
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/rstudio/.TinyTeX/bin/x86_64-linux
      Version: 2023

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.12
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /usr/local/lib/R
      LibPaths:
        - /usr/local/lib/R/site-library
        - /usr/local/lib/R/library
      knitr: 1.43
      rmarkdown: 2.24

[✓] Checking Knitr engine render......OK
cscheid commented 9 months ago

I don't think we have a way to produce the list of uploaded files to a publishing target (but we should!)

coatless commented 9 months ago

This issue is also biting documents with shinylive, c.f.

https://coatless-quarto.github.io/r-shinylive-demo/

Missing service worker...

Edit after some hacking:

Well... Looks like if I add the resources key into the HTML file this ensures the service worker is uploaded. Could the add_html_dependency() not be syncing with the resources key?

  html:
    resources: 
      - shinylive-sw.js