Support symlinked extension directory in `_extensions/`

Open
#9,069 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
cli

Research direction

Start by reproducing the failure with the linked testproject extension: enter its docs directory and run quarto render with the symlink in _extensions/. Trace the projectType and projectContext paths shown in the stack trace, then verify that the same render succeeds with the symlink while preserving custom project type support.

Written by the indexing model from the issue text.

Description

enhancement extensions file-systems
Bug description

In https://github.com/quarto-dev/quarto-cli/discussions/8579 I have been discussing the best way to structure a repository for a Quarto extension alongside a documentation website that uses that extension. @coatless has had success symlinking the doc website's extension folder (whether for a single extension or several) to the parent folder (eg. so if the documentation website is in /docs, /docs/_extensions/testproject -> /_extensions/testproject).

I'm trying to pursue this option, but I find that if my extension involves a custom project type (see reprex extension), I get an error when I render the documentation website.

Steps to reproduce

Clone the reprex extension, then:

$ cd docs
$ quarto render
ERROR: Unsupported project type testproject

Stack trace:
    at projectType (file:///Users/rensa/Applications/quarto/bin/quarto.js:37943:15)
    at projectContext (file:///Users/rensa/Applications/quarto/bin/quarto.js:72786:30)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async render (file:///Users/rensa/Applications/quarto/bin/quarto.js:81779:19)
    at async Command.fn (file:///Users/rensa/Applications/quarto/bin/quarto.js:81954:32)
    at async Command.execute (file:///Users/rensa/Applications/quarto/bin/quarto.js:8104:13)
    at async quarto (file:///Users/rensa/Applications/quarto/bin/quarto.js:114999:5)
    at async file:///Users/rensa/Applications/quarto/bin/quarto.js:115017:9
Expected behavior

If I delete the symlink and manually copy the files into the doc website's extension folder, it renders fine:

$ cd _extensions
$ rm testproject
$ cp -r ../../_extensions/testproject .
$ quarto render
[1/2] index.qmd
[2/2] about.qmd

Output created: _site/index.html
Your environment
  • IDE: none (using terminal)
  • macOS: 14.2.1
  • Quarto: have tested on both 1.4.550 and pre-release (at commit 581c7e54d)
Quarto check output

Using the pre-release:

Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /Users/rensa/code/quarto-cli/package/dist/bin

Check file:///Users/rensa/code/quarto-cli/src/resources/vendor/deno-land/x/puppeteer@9-0-2/mod.ts
[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/rensa/Library/TinyTeX/bin/universal-darwin
      Version: 2021

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

[✓] Checking Python 3 installation....OK
      Version: 3.9.7 (Conda)
      Path: /Users/rensa/miniforge3/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources
      LibPaths:
        - /Users/rensa/Library/R/arm64/4.2/library
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      knitr: 1.42
      rmarkdown: 2.21

[✓] Checking Knitr engine render......OK
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.